mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
fix: handle denied storage access
This commit is contained in:
parent
81e27fc18c
commit
8cc571f548
1 changed files with 7 additions and 1 deletions
|
|
@ -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';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue