summaryrefslogtreecommitdiff
path: root/src/bg
diff options
context:
space:
mode:
authorhackademix2018-07-19 00:31:34 +0200
committerhackademix2018-07-19 00:31:34 +0200
commit091056692685779a9f4c87f1ec9884fa4804b708 (patch)
treebe9166cff91db7517e5b1d87290a20e69fb305c3 /src/bg
parentc0fbf92cfaa4529b2eb5635511c6c23ba1470c9f (diff)
downloadnoscript-091056692685779a9f4c87f1ec9884fa4804b708.tar.gz
noscript-091056692685779a9f4c87f1ec9884fa4804b708.tar.xz
noscript-091056692685779a9f4c87f1ec9884fa4804b708.zip
Removed useless work-around suggested in moz bug 1410755 which caused Tor Browser content process crashes.
Diffstat (limited to 'src/bg')
-rw-r--r--src/bg/RequestUtil.js19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/bg/RequestUtil.js b/src/bg/RequestUtil.js
index 234ca4a..5a52975 100644
--- a/src/bg/RequestUtil.js
+++ b/src/bg/RequestUtil.js
@@ -1,10 +1,8 @@
'use strict';
{
- let NULL = new Uint8Array();
-
let xmlFeedOrImage = /^(?:(?:application|text)\/(?:(?:r(?:ss|df)|atom)\+)xml(;|$))|image\//i;
let rawXml = /^(?:application|text)\/xml;/i;
- let brokenOnLoad;
+ let brokenXMLOnLoad;
let pendingRequests = new Map();
@@ -83,12 +81,12 @@
}
if (xmlFeedOrImage.test(content.type) && !/\/svg\b/i.test(content.type)) return;
- if (typeof brokenOnLoad === "undefined") {
- brokenOnLoad = await (async () => parseInt((await browser.runtime.getBrowserInfo()).version) < 61)();
+ if (typeof brokenXMLOnLoad === "undefined") {
+ brokenXMLOnLoad = await (async () => parseInt((await browser.runtime.getBrowserInfo()).version) < 61)();
}
- let mustCheckFeed = brokenOnLoad && frameId === 0 && rawXml.test(content.type);
- debug("mustCheckFeed = %s, brokenOnLoad = %s", mustCheckFeed, brokenOnLoad);
+ let mustCheckFeed = brokenXMLOnLoad && frameId === 0 && rawXml.test(content.type);
+ debug("mustCheckFeed = %s, brokenXMLOnLoad = %s", mustCheckFeed, brokenXMLOnLoad);
let filter = browser.webRequest.filterResponseData(requestId);
let buffer = [];
let first = true;
@@ -114,13 +112,6 @@
}
};
- if (brokenOnLoad) {
- filter.onstart = event => {
- filter.write(NULL);
- debug("onstart", url);
- }
- }
-
filter.ondata = event => {
if (first) {
runAndFlush();