Index: lib/filterComposer.js |
=================================================================== |
--- a/lib/filterComposer.js |
+++ b/lib/filterComposer.js |
@@ -96,6 +96,7 @@ |
{ |
let typeMask = RegExpFilter.typeMap[details.type]; |
let docDomain = extractHostFromFrame(frame); |
+ let specificOnly = checkWhitelisted(page, frame, RegExpFilter.typeMap.GENERICBLOCK); |
kzar
2016/02/03 10:29:41
Nit: Long line
|
// Add a blocking filter for each URL of the element that can be blocked |
for (let url of details.urls) |
@@ -106,13 +107,16 @@ |
let filter = defaultMatcher.whitelist.matchesAny( |
url, typeMask, docDomain, |
isThirdParty(urlObj, docDomain), |
- getKey(page, frame) |
+ getKey(page, frame), specificOnly |
); |
if (!filter) |
{ |
let filterText = url.replace(/^[\w\-]+:\/+(?:www\.)?/, "||"); |
+ if (specificOnly) |
+ filterText += "$domain=" + docDomain; |
+ |
if (filters.indexOf(filterText) == -1) |
filters.push(filterText); |
} |