From 540dc46044afc6909c9e453b983244468e0ac9b3 Mon Sep 17 00:00:00 2001 From: hackademix Date: Mon, 6 Aug 2018 23:22:31 +0200 Subject: Fixed scripts whose URLs had a query string could not be whitelisted. --- main_background.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main_background.js') diff --git a/main_background.js b/main_background.js index d401b96..e128f9b 100644 --- a/main_background.js +++ b/main_background.js @@ -326,7 +326,6 @@ async function addReportEntry(tabId, scriptHashOrUrl, action, update = false) { try { active_connections[tabId].postMessage({show_info: unused_data[tabId]}); } catch(e) { - console.error(e); } } @@ -890,8 +889,7 @@ var ResponseHandler = { * Here we do the heavylifting, analyzing unknown scripts */ async post(response) { - let {url, type} = response.request; - url = ListStore.urlItem(url); + let {type} = response.request; let handle_it = type === "script" ? handle_script : handle_html; return await handle_it(response, response.whitelisted); } @@ -903,6 +901,7 @@ var ResponseHandler = { async function handle_script(response, whitelisted){ let {text, request} = response; let {url, tabId} = request; + url = ListStore.urlItem(url); let edited = await get_script(text, url, tabId, whitelisted, -2); return Array.isArray(edited) ? edited[0] : edited; } @@ -1075,6 +1074,7 @@ function edit_html(html,url,tabid,wl){ async function handle_html(response, whitelisted) { let {text, request} = response; let {url, tabId, type} = request; + url = ListStore.urlItem(url); if (type === "main_frame") { delete unused_data[tabId]; browser.browserAction.setBadgeText({ -- cgit v1.2.3