summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhackademix2018-07-09 00:08:26 +0200
committerhackademix2018-07-09 00:08:26 +0200
commitdac392dedab6a4372d6e1d41483735d192e97eef (patch)
tree4c1e72e975df18aed16508e35dd067479aa17085
parent48690ee92ef1b053d38aa44dce48966a2db4b7ce (diff)
downloadnoscript-dac392dedab6a4372d6e1d41483735d192e97eef.tar.gz
noscript-dac392dedab6a4372d6e1d41483735d192e97eef.tar.xz
noscript-dac392dedab6a4372d6e1d41483735d192e97eef.zip
More specific content-type exception for dynamic script injection.
-rw-r--r--src/bg/RequestUtil.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bg/RequestUtil.js b/src/bg/RequestUtil.js
index 39b1bf7..873f153 100644
--- a/src/bg/RequestUtil.js
+++ b/src/bg/RequestUtil.js
@@ -1,6 +1,7 @@
'use strict';
{
let NULL = new Uint8Array();
+ let xmlFeedOrImage = /^(?:(?:application|text)\/(?:(?:r(?:ss|df)|atom)\+)?xml(;|$))|image\//i;
let brokenOnLoad = (async () => parseInt(await browser.runtime.getBrowserInfo().version) < 61);
let pendingRequests = new Map();
@@ -60,7 +61,7 @@
let content = this.getContentMetaData(request);
debug(request.url, content.type);
- if (/^[\w/+-]*\b(xml|image)\b/i.test(content.type) && !/\bhtml\b/i.test(content.type)) return;
+ if (xmlFeedOrImage.test(content.type) && !/\/svg\b/i.test(content.type)) return;
let filter = browser.webRequest.filterResponseData(requestId);
let buffer = [];