| Index: chrome/content/elemHideEmulation.js |
| diff --git a/chrome/content/elemHideEmulation.js b/chrome/content/elemHideEmulation.js |
| index 95a4c5d4ba314ce0c5697c626e52e62edbde574c..b07e563608ced9b286848a58d4b6addaa478d753 100644 |
| --- a/chrome/content/elemHideEmulation.js |
| +++ b/chrome/content/elemHideEmulation.js |
| @@ -73,7 +73,7 @@ ElemHideEmulation.prototype = { |
| } |
| }, |
| - findSelectors: function(stylesheet, selectors, filters) |
| + findSelectors: function(stylesheet, filters) |
| { |
| // Explicitly ignore third-party stylesheets to ensure consistent behavior |
| // between Firefox and Chrome. |
| @@ -97,9 +97,15 @@ ElemHideEmulation.prototype = { |
| if (pattern.regexp.test(style)) |
| { |
| var subSelectors = splitSelector(rule.selectorText); |
| + var selectors = [] |
|
Sebastian Noack
2017/02/06 14:59:21
Nit: Missing semicolon
wspee
2017/02/07 11:59:41
Done.
|
| + |
| for (var k = 0; k < subSelectors.length; k++) |
| selectors.push(pattern.prefix + subSelectors[k] + pattern.suffix); |
| - filters[pattern.text] = true; |
| + |
| + if (!(pattern.text in filters)) |
| + filters[pattern.text] = selectors; |
|
Sebastian Noack
2017/02/06 14:59:21
While changing the API here anyway, it might be a
wspee
2017/02/07 11:59:41
Done.
|
| + else |
| + filters[pattern.text] = filters[pattern.text].concat(selectors); |
| } |
| } |
| } |
| @@ -107,11 +113,10 @@ ElemHideEmulation.prototype = { |
| addSelectors: function(stylesheets) |
| { |
| - var selectors = []; |
| var filters = {}; |
| for (var i = 0; i < stylesheets.length; i++) |
| - this.findSelectors(stylesheets[i], selectors, filters); |
| - this.addSelectorsFunc(selectors, Object.keys(filters)); |
| + this.findSelectors(stylesheets[i], filters); |
| + this.addSelectorsFunc(filters); |
| }, |
| onLoad: function(event) |