diff --git a/src/tracker/index.js b/src/tracker/index.js index ad3648aca..85d274301 100644 --- a/src/tracker/index.js +++ b/src/tracker/index.js @@ -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';