fix: handle denied storage access

This commit is contained in:
GochoMugo 2025-12-11 08:53:13 +03:00
parent 81e27fc18c
commit 8cc571f548
No known key found for this signature in database
GPG key ID: 7B6A01CB57AA39E4

View file

@ -12,7 +12,13 @@
if (!currentScript) return;
const { hostname, href, origin } = location;
const localStorage = href.startsWith('data:') ? undefined : window.localStorage;
let localStorage;
try {
localStorage = href.startsWith('data:') ? undefined : window.localStorage;
} catch {
/* (DOMException) SecurityError: Access is denied for this document. */
}
const _data = 'data-';
const _false = 'false';