| Index: chrome/content/cssProperties.js |
| =================================================================== |
| --- a/chrome/content/cssProperties.js |
| +++ b/chrome/content/cssProperties.js |
| @@ -53,16 +53,31 @@ CSSPropertyFilters.prototype = { |
| styles.push(property + ": " + value + (priority ? " !" + priority : "") + ";"); |
| } |
| styles.sort(); |
| return styles.join(" "); |
| }, |
| findSelectors: function(stylesheet, selectors) |
| { |
| + try |
|
Sebastian Noack
2016/04/19 14:47:01
I guess we should move this logic to a seperate fu
Wladimir Palant
2016/04/19 15:07:42
Done.
|
| + { |
| + // Explicitly ignore third-party stylesheets to ensure consistent behavior |
| + // between Firefox and Chrome. |
| + if (stylesheet.href && |
|
Sebastian Noack
2016/04/19 14:47:01
This check seems to be redundant as we catch the e
Wladimir Palant
2016/04/19 15:07:42
I don't really like intentionally running into exc
|
| + new URL(stylesheet.href).origin != this.window.location.origin) |
| + { |
|
Sebastian Noack
2016/04/19 14:47:01
Nit: Redundant braces.
Wladimir Palant
2016/04/19 15:07:42
Not redundant, actually required for readability s
|
| + return; |
| + } |
| + } |
| + catch (e) |
| + { |
| + // An invalid URL, can be ignored. |
| + } |
| + |
| var rules = stylesheet.cssRules; |
| if (!rules) |
| return; |
| for (var i = 0; i < rules.length; i++) |
| { |
| var rule = rules[i]; |
| if (rule.type != rule.STYLE_RULE) |