Index: lib/child/requestNotifier.js |
=================================================================== |
--- a/lib/child/requestNotifier.js |
+++ b/lib/child/requestNotifier.js |
@@ -275,19 +275,20 @@ RequestNotifier.prototype = |
/** |
* Attaches request data to a DOM node. |
* @param {Node} node node to attach data to |
* @param {Window} topWnd top-level window the node belongs to |
* @param {String} contentType request type, e.g. "IMAGE" |
* @param {String} docDomain domain of the document that initiated the request |
* @param {Boolean} thirdParty will be true if a third-party server has been requested |
* @param {String} location the address that has been requested |
- * @param {Filter} filter filter applied to the request or null if none |
+ * @param {String} filter filter applied to the request or null if none |
+ * @param {String} filterType type of filter applied to the request |
*/ |
-RequestNotifier.addNodeData = function(node, topWnd, contentType, docDomain, thirdParty, location, filter) |
+RequestNotifier.addNodeData = function(node, topWnd, {contentType, docDomain, thirdParty, location, filter, filterType}) |
{ |
let entry = { |
id: ++requestEntryMaxId, |
type: contentType, |
docDomain, thirdParty, location, filter |
}; |
let existingData = nodeData.get(node); |
@@ -308,31 +309,30 @@ RequestNotifier.addNodeData = function(n |
hidden: 0, |
blocked: 0, |
whitelisted: 0, |
filters: {} |
}); |
} |
let stats = windowStats.get(topWnd.document); |
- let filterType = (filter ? filter.type : null); |
if (filterType != "elemhide" && filterType != "elemhideexception" && filterType != "cssproperty") |
stats.items++; |
if (filter) |
{ |
if (filterType == "blocking") |
stats.blocked++; |
else if (filterType == "whitelist" || filterType == "elemhideexception") |
stats.whitelisted++; |
else if (filterType == "elemhide" || filterType == "cssproperty") |
stats.hidden++; |
- if (filter.text in stats.filters) |
- stats.filters[filter.text]++; |
+ if (filter in stats.filters) |
+ stats.filters[filter]++; |
else |
- stats.filters[filter.text] = 1; |
+ stats.filters[filter] = 1; |
} |
// Notify listeners |
for (let notifier of notifiers.values()) |
if (!notifier.window || notifier.window == topWnd) |
notifier.notifyListener(node, entry); |
} |