Index: lib/contentPolicy.js |
=================================================================== |
--- a/lib/contentPolicy.js |
+++ b/lib/contentPolicy.js |
@@ -104,16 +104,26 @@ var Policy = exports.Policy = |
let id = iface["TYPE_" + typeName]; |
this.type[typeName] = id; |
this.typeDescr[id] = typeName; |
this.localizedDescr[id] = Utils.getString("type_label_" + typeName.toLowerCase()); |
this.typeMask[id] = RegExpFilter.typeMap[typeName]; |
} |
} |
+ this.type.GENERICBLOCK = 0xFFFB; |
+ this.typeDescr[0xFFFB] = "GENERICBLOCK"; |
+ this.localizedDescr[0xFFFB] = Utils.getString("type_label_genericblock"); |
+ this.typeMask[0xFFFB] = RegExpFilter.typeMap.GENERICBLOCK; |
+ |
+ this.type.GENERICHIDE = 0xFFFC; |
+ this.typeDescr[0xFFFC] = "GENERICHIDE"; |
+ this.localizedDescr[0xFFFC] = Utils.getString("type_label_generichide"); |
+ this.typeMask[0xFFFC] = RegExpFilter.typeMap.GENERICHIDE; |
+ |
this.type.ELEMHIDE = 0xFFFD; |
this.typeDescr[0xFFFD] = "ELEMHIDE"; |
this.localizedDescr[0xFFFD] = Utils.getString("type_label_elemhide"); |
this.typeMask[0xFFFD] = RegExpFilter.typeMap.ELEMHIDE; |
this.type.POPUP = 0xFFFE; |
this.typeDescr[0xFFFE] = "POPUP"; |
this.localizedDescr[0xFFFE] = Utils.getString("type_label_popup"); |
@@ -179,28 +189,27 @@ var Policy = exports.Policy = |
if (match instanceof WhitelistFilter) |
{ |
FilterStorage.increaseHitCount(match, wnd); |
RequestNotifier.addNodeData(testWnd.document, topWnd, Policy.type.DOCUMENT, getHostname(parentWndLocation), false, testWndLocation, match); |
return true; |
} |
let genericType = (contentType == Policy.type.ELEMHIDE ? |
- RegExpFilter.typeMap.GENERICHIDE : |
- RegExpFilter.typeMap.GENERICBLOCK); |
+ Policy.type.GENERICHIDE : |
+ Policy.type.GENERICBLOCK); |
let parentDocDomain = getHostname(parentWndLocation); |
- let nogenericMatch = defaultMatcher.matchesAny( |
- testWndLocation, genericType, parentDocDomain, false, testSitekey |
- ); |
+ let nogenericMatch = defaultMatcher.matchesAny(testWndLocation, |
+ Policy.typeMask[genericType], parentDocDomain, false, testSitekey); |
if (nogenericMatch instanceof WhitelistFilter) |
{ |
nogeneric = true; |
FilterStorage.increaseHitCount(nogenericMatch, wnd); |
- RequestNotifier.addNodeData(testWnd.document, topWnd, contentType, |
+ RequestNotifier.addNodeData(testWnd.document, topWnd, genericType, |
parentDocDomain, false, testWndLocation, |
nogenericMatch); |
} |
if (testWnd.parent == testWnd) |
break; |
if (testWnd == testSitekeyWnd) |