summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorhackademix2019-10-31 00:14:26 +0100
committerhackademix2019-10-31 00:14:26 +0100
commit54c24a5405b0aaea159c1875a05bc01c44f3f90b (patch)
treecb3d5a148bb7000dfc3684be242d79867dd2ab86 /src/content
parent45cebc1c490748d9b9af77d44bfc8fadaa0532a5 (diff)
downloadnoscript-54c24a5405b0aaea159c1875a05bc01c44f3f90b.tar.gz
noscript-54c24a5405b0aaea159c1875a05bc01c44f3f90b.tar.xz
noscript-54c24a5405b0aaea159c1875a05bc01c44f3f90b.zip
On Chrome limit SyncMessage usage to non-HTTP urls.
Diffstat (limited to 'src/content')
-rw-r--r--src/content/staticNS.js11
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) {