| Index: chrome/content/cssProperties.js |
| =================================================================== |
| --- a/chrome/content/cssProperties.js |
| +++ b/chrome/content/cssProperties.js |
| @@ -51,18 +51,36 @@ CSSPropertyFilters.prototype = { |
| var value = style.getPropertyValue(property); |
| var priority = style.getPropertyPriority(property); |
| styles.push(property + ": " + value + (priority ? " !" + priority : "") + ";"); |
| } |
| styles.sort(); |
| return styles.join(" "); |
| }, |
| + isSameOrigin: function(stylesheet) |
| + { |
| + try |
| + { |
| + return new URL(stylesheet.href).origin == this.window.location.origin; |
| + } |
| + catch (e) |
| + { |
| + // Invalid URL, assume that it is first-party. |
| + return true; |
| + } |
| + }, |
| + |
| findSelectors: function(stylesheet, selectors) |
| { |
| + // Explicitly ignore third-party stylesheets to ensure consistent behavior |
| + // between Firefox and Chrome. |
| + if (!this.isSameOrigin(stylesheet)) |
| + return; |
| + |
| 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) |