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

Unified Diff: lib/cssInjection.js

Issue 29575739: Issue 5864 - Remove previous style sheet before adding one (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Rebase and fix errors Created Jan. 24, 2018, 4:36 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 | « include.preload.js ('k') | polyfill.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/cssInjection.js
===================================================================
--- a/lib/cssInjection.js
+++ b/lib/cssInjection.js
@@ -38,31 +38,31 @@
frameId,
matchAboutBlank: true,
runAt: "document_start"
});
}
function removeStyleSheet(tabId, frameId, styleSheet)
{
- chrome.tabs.removeCSS(tabId, {
+ browser.tabs.removeCSS(tabId, {
code: styleSheet,
cssOrigin: "user",
frameId,
matchAboutBlank: true
});
}
-function updateFrameStyles(pageId, frameId, selectors, groupName)
+function updateFrameStyles(tabId, frameId, selectors, groupName)
{
let styleSheet = null;
if (selectors.length > 0)
styleSheet = selectors.join(", ") + "{display: none !important;}";
- let frame = ext.getFrame(pageId, frameId);
+ let frame = ext.getFrame(tabId, frameId);
if (!frame.injectedStyleSheets)
frame.injectedStyleSheets = new Map();
let oldStyleSheet = frame.injectedStyleSheets.get(groupName);
// Ideally we would compare the old and new style sheets and skip this code
// if they're the same, but the old style sheet can be a leftover from a
// previous instance of the frame. We must add the new style sheet
« no previous file with comments | « include.preload.js ('k') | polyfill.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld