Index: include.preload.js |
=================================================================== |
--- a/include.preload.js |
+++ b/include.preload.js |
@@ -340,16 +340,17 @@ |
}; |
function ElemHide() |
{ |
this.shadow = this.createShadowTree(); |
this.styles = new Map(); |
this.tracer = null; |
this.inline = true; |
+ this.inlineEmulated = true; |
this.emulatedPatterns = null; |
this.elemHideEmulation = new ElemHideEmulation( |
this.addSelectors.bind(this), |
this.hideElements.bind(this) |
); |
} |
ElemHide.prototype = { |
@@ -448,17 +449,17 @@ |
).join(", "); |
style.sheet.insertRule(selector + "{display: none !important;}", |
style.sheet.cssRules.length); |
} |
}, |
addSelectors(selectors, filters) |
{ |
- if (this.inline) |
+ if (this.inline || this.inlineEmulated) |
{ |
// Insert the style rules inline if we have been instructed by the |
// background page to do so. This is usually the case, except on platforms |
// that do support user stylesheets via the browser.tabs.insertCSS API |
// (Firefox 53 onwards for now and possibly Chrome in the near future). |
// Once all supported platforms have implemented this API, we can remove |
// the code below. See issue #5090. |
// Related Chrome and Firefox issues: |
@@ -501,16 +502,17 @@ |
if (this.tracer) |
this.tracer.disconnect(); |
this.tracer = null; |
if (response.trace) |
this.tracer = new ElementHidingTracer(); |
this.inline = response.inline; |
+ this.inlineEmulated = !!response.inlineEmulated; |
if (this.inline) |
this.addSelectorsInline(response.selectors, "standard"); |
if (this.tracer) |
this.tracer.addSelectors(response.selectors); |
this.elemHideEmulation.apply(response.emulatedPatterns); |