diff options
author | hackademix | 2019-11-03 13:31:04 +0100 |
---|---|---|
committer | hackademix | 2019-11-03 13:31:04 +0100 |
commit | 4f08302084476cee636b869e94c12d57db41d963 (patch) | |
tree | 6d20f1510582c5a255439826281d00a19e8645a5 /src/content | |
parent | 049485e495e0d1ce0d54694d92500ecdeadb1ef0 (diff) | |
download | noscript-4f08302084476cee636b869e94c12d57db41d963.tar.gz noscript-4f08302084476cee636b869e94c12d57db41d963.tar.xz noscript-4f08302084476cee636b869e94c12d57db41d963.zip |
Fetch policies asynchronously for about: and javascript: URLs.
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/staticNS.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/content/staticNS.js b/src/content/staticNS.js index 59f2b39..82ef302 100644 --- a/src/content/staticNS.js +++ b/src/content/staticNS.js @@ -40,13 +40,14 @@ , 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)) { + 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); + } (async () => { let policy; try { |