summaryrefslogtreecommitdiff
path: root/background/webrequest.js
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-14 18:49:55 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-14 18:49:55 +0100
commitcf838016b70bc55d8fb19a10b4deb580289e3769 (patch)
tree8c6e8f271e38f8cf7edd7ae733b68ac70c2b7076 /background/webrequest.js
parent1869062a9d6ae736bdfe5e2993dfe1f280af4d8b (diff)
downloadbrowser-extension-cf838016b70bc55d8fb19a10b4deb580289e3769.tar.gz
browser-extension-cf838016b70bc55d8fb19a10b4deb580289e3769.zip
restore chromium support
Diffstat (limited to 'background/webrequest.js')
-rw-r--r--background/webrequest.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/background/webrequest.js b/background/webrequest.js
index cb89a3d..bceba26 100644
--- a/background/webrequest.js
+++ b/background/webrequest.js
@@ -113,6 +113,9 @@ function on_before_request(details)
if (details.type !== "xmlhttprequest")
return {cancel: true};
+ if (details.url.startsWith(redirect_url_template))
+ return;
+
#IF DEBUG
console.debug(`Settings queried using XHR for '${details.url}'.`);
#ENDIF
@@ -130,14 +133,14 @@ function on_before_request(details)
return {cancel: true};
}
- const policy = decide_policy(tree, details.url, default_allow, secret);
+ const policy = decide_policy(tree, queried_url, default_allow, secret);
if (!policy.error) {
const encoded_policy = encodeURIComponent(JSON.stringify(policy));
return {redirectUrl: redirect_url_template + encoded_policy};
}
}
- console.warn(`Bad request! Expected ${browser.runtime.getURL("dummy")}?url=<valid_urlencoded_url>. Got ${request_url}. This might be the result of page fingerprinting the browser.`);
+ console.warn(`Bad request! Expected ${browser.runtime.getURL("dummy")}?url=<valid_urlencoded_url>. Got ${details.url}. This might be the result of page fingerprinting the browser.`);
return {cancel: true};
}