Index: chrome/content/elemHideEmulation.js |
=================================================================== |
--- a/chrome/content/elemHideEmulation.js |
+++ b/chrome/content/elemHideEmulation.js |
@@ -78,38 +78,39 @@ ElemHideEmulation.prototype = { |
findSelectors: function(stylesheet, selectors, filters) |
{ |
// Explicitly ignore third-party stylesheets to ensure consistent behavior |
// between Firefox and Chrome. |
if (!this.isSameOrigin(stylesheet)) |
return; |
- let rules = stylesheet.cssRules; |
+ var rules = stylesheet.cssRules; |
if (!rules) |
return; |
- for (let rule of rules) |
+ for (var i = 0; i < rules.length; i++) |
{ |
+ var rule = rules[i]; |
if (rule.type != rule.STYLE_RULE) |
continue; |
- let style = this.stringifyStyle(rule.style); |
- for (let pattern of this.patterns) |
+ var style = this.stringifyStyle(rule.style); |
+ this.patterns.forEach(function(pattern) |
Wladimir Palant
2017/03/08 10:31:50
Last I checked, calling forEach caused suboptimal
|
{ |
if (pattern.regexp.test(style)) |
{ |
- let subSelectors = splitSelector(rule.selectorText); |
- for (let subSelector of subSelectors) |
+ var subSelectors = splitSelector(rule.selectorText); |
+ subSelectors.forEach(function(subSelector) |
{ |
selectors.push(pattern.prefix + subSelector + pattern.suffix); |
filters.push(pattern.text); |
- } |
+ }); |
} |
- } |
+ }); |
} |
}, |
addSelectors: function(stylesheets) |
{ |
var selectors = []; |
var filters = []; |
for (var i = 0; i < stylesheets.length; i++) |