aboutsummaryrefslogtreecommitdiff
path: root/main_background.js
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@fsf.org>2018-05-11 14:00:33 -0400
committerRuben Rodriguez <ruben@fsf.org>2018-05-11 14:00:33 -0400
commit0166d8c292987a523f708d95188e81952074a990 (patch)
tree978630f7529a6bfa0487acd4cbc5f78903d20367 /main_background.js
parentf0fb8061ce5ac4c23ea1a2cbf94c4aa1a3f33897 (diff)
Refactor whitelisting at read_script()
Diffstat (limited to 'main_background.js')
-rw-r--r--main_background.js8
1 files changed, 1 insertions, 7 deletions
diff --git a/main_background.js b/main_background.js
index ada6230..a8a0536 100644
--- a/main_background.js
+++ b/main_background.js
@@ -1082,13 +1082,7 @@ function read_script(a){
console.log("read_script "+a.url);
var res = test_url_whitelisted(a.url);
res.then(function(whitelisted){
- var edit_script;
- if(whitelisted == true){
- // Doesn't matter if this is accepted or blocked, it will still be whitelisted
- edit_script = get_script(str,a.url,a["tabId"],true);
- } else{
- edit_script = get_script(str,a.url,a["tabId"],false);
- }
+ var edit_script = get_script(str,a.url,a["tabId"],whitelisted,-1);
edit_script.then(function(edited){
filter.write(encoder.encode(edited));
filter.disconnect();