aboutsummaryrefslogtreecommitdiff
path: root/main_background.js
diff options
context:
space:
mode:
authorhackademix <giorgio@maone.net>2018-08-06 23:22:31 +0200
committerhackademix <giorgio@maone.net>2018-08-06 23:22:31 +0200
commit540dc46044afc6909c9e453b983244468e0ac9b3 (patch)
tree94ee88311db6731a528ef984facbbe6826397cea /main_background.js
parent3f2aca651b85d73c8a217bda927c36bf7e6b43f8 (diff)
Fixed scripts whose URLs had a query string could not be whitelisted.
Diffstat (limited to 'main_background.js')
-rw-r--r--main_background.js6
1 files changed, 3 insertions, 3 deletions
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({