Index: lib/requestBlocker.js |
=================================================================== |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -33,26 +33,26 @@ |
// OBJECT_SUBREQUEST and OBJECT requests. |
RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT; |
// 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]; |
+ yield [type, type]; |
- yield ["sub_frame", "SUBDOCUMENT"]; |
+ yield ["SUB_FRAME", "SUBDOCUMENT"]; |
// Treat navigator.sendBeacon() the same as <a ping>, it's essentially the |
// same concept - merely generalized. |
- yield ["beacon", "PING"]; |
+ yield ["BEACON", "PING"]; |
// Treat <img srcset> and <picture> the same as other images. |
- yield ["imageset", "IMAGE"]; |
+ yield ["IMAGESET", "IMAGE"]; |
}()); |
function onBeforeRequestAsync(page, url, type, docDomain, |
thirdParty, sitekey, |
specificOnly, filter) |
{ |
if (filter) |
FilterNotifier.emit("filter.hitCount", filter, 0, 0, page); |
@@ -76,17 +76,17 @@ |
let docDomain = extractHostFromFrame(frame); |
let thirdParty = isThirdParty(url, docDomain); |
let sitekey = getKey(page, frame); |
let specificOnly = !!checkWhitelisted( |
page, frame, RegExpFilter.typeMap.GENERICBLOCK |
); |
- let mappedType = resourceTypes.get(type) || "OTHER"; |
+ let mappedType = resourceTypes.get(type.toUpperCase()) || "OTHER"; |
let filter = defaultMatcher.matchesAny( |
urlString, RegExpFilter.typeMap[mappedType], |
docDomain, thirdParty, sitekey, specificOnly |
); |
setTimeout(onBeforeRequestAsync, 0, page, urlString, |
mappedType, docDomain, |