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

Unified Diff: include.preload.js

Issue 29370970: [adblockpluschrome] Issue 3596 - Added support for CSS property filters to devtools panel (Closed)
Patch Set: No longer use ElementHidingTracer to log ElemHideEmulationFilter in the devpanel Created Jan. 12, 2017, 1:38 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 | « no previous file | lib/devtools.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
diff --git a/include.preload.js b/include.preload.js
index 86e52c32afceb894f6591a84b0eca3b1842383ce..8fb6e6aebb6df8c1c8de8bedf0b7fa64896a5d1f 100644
--- a/include.preload.js
+++ b/include.preload.js
@@ -490,11 +490,27 @@ ElemHide.prototype = {
return shadow;
},
- addSelectors: function(selectors)
+ addSelectors: function(selectors, filters)
{
if (selectors.length == 0)
return;
+ // In case of an ElemHideEmulationFilter the selector doesn't match the
+ // selector of the filter ([-abp-properties=...] vs actual css selector
+ // depending on the sites css). To still allow the devtools panel to find
+ // the correct filter addSelector gets also passed the filterText of the
+ // ElemHideEmulationFilter used to produce the selectors.
+ if (filters)
Sebastian Noack 2017/01/12 17:03:29 Yeah, this is more like it works on Firefox curren
Sebastian Noack 2017/01/12 17:03:29 And yes, it's also not great that we message the b
wspee 2017/01/19 16:20:15 Done.
wspee 2017/01/19 16:20:15 Done.
+ {
+ let traceSelectors = [];
+ for (let filter of filters)
+ traceSelectors.push(filter.replace(/^.*?##/, ""));
+ ext.backgroundPage.sendMessage({
+ type: "devtools.traceElemHide",
+ selectors: traceSelectors
+ });
+ }
+
if (!this.style)
{
// Create <style> element lazily, only if we add styles. Add it to
« no previous file with comments | « no previous file | lib/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld