fix: handle denied storage access

This commit is contained in:
GochoMugo committed 2025-12-11 08:53:13 +03:00
1 parent 81e27fc18c
commit 8cc571f548
1 file changed
+7 -1
+7 -1
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';