diff options
author | Ruben Rodriguez <ruben@fsf.org> | 2018-05-11 14:07:55 -0400 |
---|---|---|
committer | Ruben Rodriguez <ruben@fsf.org> | 2018-05-11 14:07:55 -0400 |
commit | 7b3839d22a8e6c0fd763eb9f2151d500dc6d03f9 (patch) | |
tree | c399a7dd96e13117c39815242adb7debb4df2c08 | |
parent | 673ebdf926260cc3b6c49acc187e0fc28bf482fa (diff) |
Correct hack that prevents parsing non-html documents. Still needs work.
-rw-r--r-- | main_background.js | 10 |
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"); |