Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/devtools.js

Issue 29338491: Issue 3823 - Split up message responder code (Closed)
Patch Set: Don't check for instance of Promise, avoid creating unnecessary arays Created March 21, 2016, 1:25 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include.preload.js ('k') | lib/filterComposer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
+ );
+});
« no previous file with comments | « include.preload.js ('k') | lib/filterComposer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld