Removed useless work-around suggested in moz bug 1410755 which caused Tor Browser content process crashes.
This commit is contained in:
parent
c0fbf92cfa
commit
0910566926
|
@ -1,10 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
{
|
{
|
||||||
let NULL = new Uint8Array();
|
|
||||||
|
|
||||||
let xmlFeedOrImage = /^(?:(?:application|text)\/(?:(?:r(?:ss|df)|atom)\+)xml(;|$))|image\//i;
|
let xmlFeedOrImage = /^(?:(?:application|text)\/(?:(?:r(?:ss|df)|atom)\+)xml(;|$))|image\//i;
|
||||||
let rawXml = /^(?:application|text)\/xml;/i;
|
let rawXml = /^(?:application|text)\/xml;/i;
|
||||||
let brokenOnLoad;
|
let brokenXMLOnLoad;
|
||||||
|
|
||||||
let pendingRequests = new Map();
|
let pendingRequests = new Map();
|
||||||
|
|
||||||
|
@ -83,12 +81,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xmlFeedOrImage.test(content.type) && !/\/svg\b/i.test(content.type)) return;
|
if (xmlFeedOrImage.test(content.type) && !/\/svg\b/i.test(content.type)) return;
|
||||||
if (typeof brokenOnLoad === "undefined") {
|
if (typeof brokenXMLOnLoad === "undefined") {
|
||||||
brokenOnLoad = await (async () => parseInt((await browser.runtime.getBrowserInfo()).version) < 61)();
|
brokenXMLOnLoad = await (async () => parseInt((await browser.runtime.getBrowserInfo()).version) < 61)();
|
||||||
}
|
}
|
||||||
|
|
||||||
let mustCheckFeed = brokenOnLoad && frameId === 0 && rawXml.test(content.type);
|
let mustCheckFeed = brokenXMLOnLoad && frameId === 0 && rawXml.test(content.type);
|
||||||
debug("mustCheckFeed = %s, brokenOnLoad = %s", mustCheckFeed, brokenOnLoad);
|
debug("mustCheckFeed = %s, brokenXMLOnLoad = %s", mustCheckFeed, brokenXMLOnLoad);
|
||||||
let filter = browser.webRequest.filterResponseData(requestId);
|
let filter = browser.webRequest.filterResponseData(requestId);
|
||||||
let buffer = [];
|
let buffer = [];
|
||||||
let first = true;
|
let first = true;
|
||||||
|
@ -114,13 +112,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (brokenOnLoad) {
|
|
||||||
filter.onstart = event => {
|
|
||||||
filter.write(NULL);
|
|
||||||
debug("onstart", url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
filter.ondata = event => {
|
filter.ondata = event => {
|
||||||
if (first) {
|
if (first) {
|
||||||
runAndFlush();
|
runAndFlush();
|
||||||
|
|
Loading…
Reference in New Issue