diff options
Diffstat (limited to 'src/content/staticNS.js')
-rw-r--r-- | src/content/staticNS.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/content/staticNS.js b/src/content/staticNS.js index ca9de41..59f2b39 100644 --- a/src/content/staticNS.js +++ b/src/content/staticNS.js @@ -35,9 +35,17 @@ fetchPolicy() { let url = document.URL; - debug(`Fetching policy from document %s, readyState %s, content %s`, - url, document.readyState, document.documentElement.outerHTML); - + debug(`Fetching policy from document %s, readyState %s`, + url, document.readyState + , document.documentElement.outerHTML, // DEV_ONLY + document.domain, document.baseURI, window.isSecureContext // DEV_ONLY + ); + if (/^(javascript|about):/.test(url)) { + url = document.readyState === "loading" + ? document.baseURI + : `${window.isSecureContext ? "https" : "http"}://${document.domain}`; + debug("Fetching policy for actual URL %s (was %s)", url, document.URL); + } if (!/^(?:file|ftp|https?):/i.test(url)) { (async () => { let policy; |