On Chrome limit SyncMessage usage to non-HTTP urls.

This commit is contained in:
hackademix 2019-10-31 00:14:26 +01:00
parent 45cebc1c49
commit 54c24a5405
1 changed files with 9 additions and 2 deletions

View File

@ -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) {