Index: lib/content/elemHideEmulation.js |
=================================================================== |
--- a/lib/content/elemHideEmulation.js |
+++ b/lib/content/elemHideEmulation.js |
@@ -406,35 +406,44 @@ |
let elementFilters = []; |
let cssStyles = []; |
let stylesheetOnlyChange = !!stylesheets; |
if (!stylesheets) |
stylesheets = this.document.styleSheets; |
- for (let stylesheet of stylesheets) |
+ try |
{ |
- // Explicitly ignore third-party stylesheets to ensure consistent behavior |
- // between Firefox and Chrome. |
- if (!this.isSameOrigin(stylesheet)) |
- continue; |
+ for (let stylesheet of stylesheets) |
+ { |
+ // Explicitly ignore third-party stylesheets to ensure consistent behavior |
+ // between Firefox and Chrome. |
+ if (!this.isSameOrigin(stylesheet)) |
+ continue; |
- let rules = stylesheet.cssRules; |
- if (!rules) |
- continue; |
- |
- for (let rule of rules) |
- { |
- if (rule.type != rule.STYLE_RULE) |
+ let rules = stylesheet.cssRules; |
+ if (!rules) |
continue; |
- cssStyles.push(stringifyStyle(rule)); |
+ for (let rule of rules) |
+ { |
+ if (rule.type != rule.STYLE_RULE) |
+ continue; |
+ |
+ cssStyles.push(stringifyStyle(rule)); |
+ } |
} |
} |
+ catch (e) |
+ { |
+ // Make sure to not interrupt. |
+ // On Firefox we seem to get a InvalidAccessError when |
+ // enumerating the stylesheets. |
+ } |
let patterns = this.patterns.slice(); |
let pattern = null; |
let generator = null; |
let processPatterns = () => |
{ |
let cycleStart = performance.now(); |