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

Delta Between Two Patch Sets: lib/cssInjection.js

Issue 29564767: Issue 242 - Use user style sheets on Chromium (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Fix regex matching and check only for Gecko Created Feb. 1, 2018, 8:02 a.m.
Right Patch Set: Do not check error message Created Feb. 1, 2018, 10:37 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include.preload.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 browser.tabs.insertCSS(tabId, { 73 browser.tabs.insertCSS(tabId, {
74 code: styleSheet, 74 code: styleSheet,
75 cssOrigin: "user", 75 cssOrigin: "user",
76 frameId, 76 frameId,
77 matchAboutBlank: true, 77 matchAboutBlank: true,
78 runAt: "document_start" 78 runAt: "document_start"
79 }); 79 });
80 } 80 }
81 catch (error) 81 catch (error)
82 { 82 {
83 if (!/\bcssOrigin\b/.test(error.message))
84 throw error;
85
86 userStyleSheetsSupported = false; 83 userStyleSheetsSupported = false;
87 } 84 }
88 85
89 return userStyleSheetsSupported; 86 return userStyleSheetsSupported;
90 } 87 }
91 88
92 function removeStyleSheet(tabId, frameId, styleSheet) 89 function removeStyleSheet(tabId, frameId, styleSheet)
93 { 90 {
94 if (!styleSheetRemovalSupported) 91 if (!styleSheetRemovalSupported)
95 return; 92 return;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 response.inlineEmulated = true; 173 response.inlineEmulated = true;
177 174
178 return response; 175 return response;
179 }); 176 });
180 177
181 port.on("elemhide.injectSelectors", (message, sender) => 178 port.on("elemhide.injectSelectors", (message, sender) =>
182 { 179 {
183 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, 180 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors,
184 message.groupName); 181 message.groupName);
185 }); 182 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld