From dac392dedab6a4372d6e1d41483735d192e97eef Mon Sep 17 00:00:00 2001 From: hackademix Date: Mon, 9 Jul 2018 00:08:26 +0200 Subject: More specific content-type exception for dynamic script injection. --- src/bg/RequestUtil.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 = []; -- cgit v1.2.3