diff options
Diffstat (limited to 'background/policy_smuggler.js')
-rw-r--r-- | background/policy_smuggler.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/background/policy_smuggler.js b/background/policy_smuggler.js index 180dcb7..ad8d565 100644 --- a/background/policy_smuggler.js +++ b/background/policy_smuggler.js @@ -16,8 +16,10 @@ const browser = window.browser; const url_item = window.url_item; const gen_unique = window.gen_unique; + const get_query_best = window.get_query_best; var storage; + var query_best; function redirect(request) { @@ -35,12 +37,11 @@ return {cancel : false}; } - let settings = storage.get(TYPE_PREFIX.PAGE, url); - console.log("got", storage.get(TYPE_PREFIX.PAGE, url), "for", url); + let [pattern, settings] = query_best(url); if (settings === undefined || !settings.allow) return {cancel : false}; - second_target = (first_target || "") + (second_target || "") + second_target = (first_target || "") + (second_target || ""); console.log(["redirecting", request.url, (base_url + unique + second_target)]); @@ -52,6 +53,7 @@ async function start() { storage = await get_storage(); + query_best = await get_query_best(); chrome.webRequest.onBeforeRequest.addListener( redirect, |