aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@fsf.org>2018-05-11 14:07:55 -0400
committerRuben Rodriguez <ruben@fsf.org>2018-05-11 14:07:55 -0400
commit7b3839d22a8e6c0fd763eb9f2151d500dc6d03f9 (patch)
treec399a7dd96e13117c39815242adb7debb4df2c08
parent673ebdf926260cc3b6c49acc187e0fc28bf482fa (diff)
Correct hack that prevents parsing non-html documents. Still needs work.
-rw-r--r--main_background.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/main_background.js b/main_background.js
index 00aae37..a5b43be 100644
--- a/main_background.js
+++ b/main_background.js
@@ -1284,10 +1284,12 @@ function read_document(a){
var res = test_url_whitelisted(a.url);
res.then(function(whitelisted){
var edit_page;
- if(! str.includes("<html")){
- dbg_print("not html");
- filter.write(encoder.encode(str));
- filter.disconnect();
+ // TODO Fix this ugly HACK!
+ if(! str.includes("<html")){
+ dbg_print("not html");
+ filter.write(encoder.encode(str));
+ filter.disconnect();
+ return {};
}
if(whitelisted == true){
dbg_print("WHITELISTED");