Index: lib/requestBlocker.js |
=================================================================== |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -24,19 +24,20 @@ |
const {defaultMatcher} = require("matcher"); |
const {FilterNotifier} = require("filterNotifier"); |
const {Prefs} = require("prefs"); |
const {checkWhitelisted, getKey} = require("whitelisting"); |
const {stringifyURL, extractHostFromFrame, isThirdParty} = require("url"); |
const {port} = require("messaging"); |
const devtools = require("devtools"); |
-// Chrome and Firefox (WebExtensions) can't distinguish between |
-// OBJECT_SUBREQUEST and OBJECT requests. |
-RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT; |
+// Chrome can't distinguish between OBJECT_SUBREQUEST and OBJECT requests. |
+if (!("OBJECT_SUBREQUEST" in chrome.webRequest.ResourceType)) |
+ RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT; |
+ |
Sebastian Noack
2017/06/12 12:20:43
Nit: The extra blank line added here is redundant.
Jon Sonesen
2017/06/12 15:37:47
Acknowledged.
|
// Map of content types reported by the browser to the respecitve content types |
// used by Adblock Plus. Other content types are simply mapped to OTHER. |
let resourceTypes = new Map(function*() |
{ |
for (let type in RegExpFilter.typeMap) |
yield [type.toLowerCase(), type]; |