diff options
-rw-r--r-- | src/content/staticNS.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/content/staticNS.js b/src/content/staticNS.js index 5fc7ac4..447d619 100644 --- a/src/content/staticNS.js +++ b/src/content/staticNS.js @@ -34,11 +34,18 @@ }, fetchPolicy() { + let url = document.URL; + if (!UA.isMozilla && url.startsWith("http")) { + (async () => { + this.setup(await Messages.send("fetchPolicy", {url, contextUrl: url})); + })(); + return; + } debug(`Fetching policy from document %s, readyState %s, content %s`, - document.URL, document.readyState, document.documentElement.outerHTML); + url, document.readyState, document.documentElement.outerHTML); let originalState = document.readyState; let blockedScripts = []; - let url = document.URL; + addEventListener("beforescriptexecute", e => { // safety net for syncrhonous load on Firefox if (!this.canScript) { |