diff options
author | Ruben Rodriguez <ruben@fsf.org> | 2018-05-03 19:51:33 -0400 |
---|---|---|
committer | Ruben Rodriguez <ruben@fsf.org> | 2018-05-03 19:51:33 -0400 |
commit | 6e2b4fb5cf520da4a7a84a9c3a27e1228369563f (patch) | |
tree | 40ac0144923b8706c05032a4f4ba4ea8047f2aba | |
parent | 7994332e313c801c5167ad4bd42e654f7d3dfc0f (diff) |
HACK: do not process non-html documents in read_document
Processing them breaks reading js documents directly. The method is crude it needs to be generalized for other mime-types, in particular librejs breaks visualizing any binary files (e.g. images)
-rw-r--r-- | main_background.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main_background.js b/main_background.js index df931de..a2ab782 100644 --- a/main_background.js +++ b/main_background.js @@ -1269,10 +1269,14 @@ function read_document(a){ } filter.onstop = event => { var test = new ArrayBuffer(); - 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(); + } if(whitelisted == true){ dbg_print("WHITELISTED"); // Doesn't matter if this is accepted or blocked, it will still be whitelisted |