Index: lib/devtools.js |
=================================================================== |
--- a/lib/devtools.js |
+++ b/lib/devtools.js |
@@ -22,6 +22,8 @@ |
let {FilterStorage} = require("filterStorage"); |
let {defaultMatcher} = require("matcher"); |
let {FilterNotifier} = require("filterNotifier"); |
+let {extractHostFromFrame} = require("url"); |
+let {port} = require("messaging"); |
const nonRequestTypes = ["DOCUMENT", "ELEMHIDE", "GENERICBLOCK", "GENERICHIDE"]; |
@@ -155,7 +157,7 @@ |
* @param {string[]} selectors The CSS selectors of active elemhide filters |
* @param {string} docDomain The IDN-decoded hostname of the document |
*/ |
-exports.logHiddenElements = function(page, selectors, docDomain) |
+function logHiddenElements(page, selectors, docDomain) |
{ |
let panel = getActivePanel(page); |
{ |
@@ -380,3 +382,11 @@ |
panels[inspectedTabId] = {port: port, records: []}; |
}); |
+ |
+port.on("devtools.traceElemHide", (message, sender) => |
+{ |
+ logHiddenElements( |
+ message.page, message.selectors, |
+ extractHostFromFrame(sender.frame) |
+ ); |
+}); |