Merge pull request #3872 from GochoMugo/fix/denied-storage-access
fix: handle denied storage access
This commit is contained in:
1 file changed
+7
-1
@@ -12,7 +12,13 @@
|
|||||||
if (!currentScript) return;
|
if (!currentScript) return;
|
||||||
|
|
||||||
const { hostname, href, origin } = location;
|
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 _data = 'data-';
|
||||||
const _false = 'false';
|
const _false = 'false';
|
||||||
|
|||||||
Reference in new issue
Block a user