aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main_background.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/main_background.js b/main_background.js
index dfdfd18..b0c8d9b 100644
--- a/main_background.js
+++ b/main_background.js
@@ -1068,9 +1068,10 @@ function read_script(a){
var filter = webex.webRequest.filterResponseData(a.requestId);
var decoder = new TextDecoder("utf-8");
var encoder = new TextEncoder();
+ var str = "";
- filter.ondata = event => {
- var str = decoder.decode(event.data, {stream: true});
+ filter.onstop = event => {
+ console.log("read_script "+a.url);
var res = test_url_whitelisted(a.url);
res.then(function(whitelisted){
var edit_script;
@@ -1086,6 +1087,9 @@ function read_script(a){
});
});
}
+ filter.ondata = event => {
+ str += decoder.decode(event.data, {stream: true});
+ }
return {};
}