Index: lib/contentPolicy.js |
diff --git a/lib/contentPolicy.js b/lib/contentPolicy.js |
index b0498da6ec3bf66b35e35d8d8114e99ad3477707..eaef9b016156797948a5b3b3f812f4fe8f6d9591 100644 |
--- a/lib/contentPolicy.js |
+++ b/lib/contentPolicy.js |
@@ -162,6 +162,8 @@ let Policy = exports.Policy = |
let docDomain = getHostname(wndLocation); |
let match = null; |
let [sitekey, sitekeyWnd] = getSitekey(wnd); |
+ let nogeneric = false; |
+ |
if (!match && Prefs.enabled) |
{ |
let testWnd = wnd; |
@@ -181,6 +183,23 @@ let Policy = exports.Policy = |
return true; |
} |
+ let genericType = (contentType == Policy.type.ELEMHIDE ? |
+ RegExpFilter.typeMap.GENERICHIDE : |
+ RegExpFilter.typeMap.GENERICBLOCK); |
+ let parentDocDomain = getHostname(parentWndLocation); |
+ let nogenericMatch = defaultMatcher.matchesAny( |
+ testWndLocation, genericType, parentDocDomain, false, testSitekey |
+ ); |
+ if (nogenericMatch instanceof WhitelistFilter) |
+ { |
+ nogeneric = true; |
+ |
+ FilterStorage.increaseHitCount(nogenericMatch, wnd); |
+ RequestNotifier.addNodeData(testWnd.document, topWnd, contentType, |
+ parentDocDomain, false, testWndLocation, |
+ nogenericMatch); |
+ } |
+ |
if (testWnd.parent == testWnd) |
break; |
@@ -236,13 +255,17 @@ let Policy = exports.Policy = |
RequestNotifier.addNodeData(node, topWnd, contentType, docDomain, false, locationText, exception); |
return true; |
} |
+ |
+ if (nogeneric && match.isGeneric()) |
+ return true; |
} |
let thirdParty = (contentType == Policy.type.ELEMHIDE ? false : isThirdParty(location, docDomain)); |
if (!match && Prefs.enabled && contentType in Policy.typeMask) |
{ |
- match = defaultMatcher.matchesAny(locationText, Policy.typeMask[contentType], docDomain, thirdParty, sitekey); |
+ match = defaultMatcher.matchesAny(locationText, Policy.typeMask[contentType], |
+ docDomain, thirdParty, sitekey, nogeneric); |
if (match instanceof BlockingFilter && node.ownerDocument && !(contentType in Policy.nonVisual)) |
{ |
let prefCollapse = (match.collapse != null ? match.collapse : !Prefs.fastcollapse); |