Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.preload.js

Issue 29575739: Issue 5864 - Remove previous style sheet before adding one (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Use "standard" group name Created Jan. 25, 2018, 2:28 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/cssInjection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -374,17 +374,17 @@
// avoid creating the shadowRoot twice.
let shadow = document.documentElement.shadowRoot ||
document.documentElement.createShadowRoot();
shadow.appendChild(document.createElement("shadow"));
return shadow;
},
- addSelectorsInline(selectors, filters, groupName)
+ addSelectorsInline(selectors, groupName)
{
let style = this.styles.get(groupName);
if (style)
{
while (style.sheet.cssRules.length > 0)
style.sheet.deleteRule(0);
}
@@ -453,17 +453,17 @@
// 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:
// https://bugs.chromium.org/p/chromium/issues/detail?id=632009
// https://bugzilla.mozilla.org/show_bug.cgi?id=1310026
- this.addSelectorsInline(selectors, filters, "emulated");
+ this.addSelectorsInline(selectors, "emulated");
}
else
{
browser.runtime.sendMessage({
type: "elemhide.injectSelectors",
selectors,
groupName: "emulated"
});
@@ -497,17 +497,17 @@
this.tracer = null;
if (response.trace)
this.tracer = new ElementHidingTracer();
this.inline = response.inline;
if (this.inline)
- this.addSelectorsInline(response.selectors);
+ this.addSelectorsInline(response.selectors, "standard");
if (this.tracer)
this.tracer.addSelectors(response.selectors);
this.elemHideEmulation.apply(response.emulatedPatterns);
});
}
};
« no previous file with comments | « no previous file | lib/cssInjection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld