Merge pull request #3872 from GochoMugo/fix/denied-storage-access

fix: handle denied storage access
This commit is contained in:
Mike Cao 2026-01-06 18:03:16 -08:00 committed by GitHub
commit 17d24bf8e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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';