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

Side by Side Diff: lib/cssInjection.js

Issue 29739594: Issue 6543 - Match requests without tabId/frameId in their originating context (Closed)
Patch Set: Created April 2, 2018, 2:55 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return true; 157 return true;
158 } 158 }
159 159
160 port.on("elemhide.getSelectors", (message, sender) => 160 port.on("elemhide.getSelectors", (message, sender) =>
161 { 161 {
162 let selectors = []; 162 let selectors = [];
163 let emulatedPatterns = []; 163 let emulatedPatterns = [];
164 let trace = devtools.hasPanel(sender.page.id); 164 let trace = devtools.hasPanel(sender.page.id);
165 let inline = !userStyleSheetsSupported; 165 let inline = !userStyleSheetsSupported;
166 166
167 if (!checkWhitelisted(sender.page, sender.frame, 167 if (!checkWhitelisted(sender.page, sender.frame, null,
168 RegExpFilter.typeMap.DOCUMENT | 168 RegExpFilter.typeMap.DOCUMENT |
169 RegExpFilter.typeMap.ELEMHIDE)) 169 RegExpFilter.typeMap.ELEMHIDE))
170 { 170 {
171 let hostname = extractHostFromFrame(sender.frame); 171 let hostname = extractHostFromFrame(sender.frame);
172 let specificOnly = checkWhitelisted(sender.page, sender.frame, 172 let specificOnly = checkWhitelisted(sender.page, sender.frame, null,
173 RegExpFilter.typeMap.GENERICHIDE); 173 RegExpFilter.typeMap.GENERICHIDE);
174 174
175 selectors = ElemHide.getSelectorsForDomain( 175 selectors = ElemHide.getSelectorsForDomain(
176 hostname, 176 hostname,
177 specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING 177 specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING
178 ); 178 );
179 179
180 for (let filter of ElemHideEmulation.getRulesForDomain(hostname)) 180 for (let filter of ElemHideEmulation.getRulesForDomain(hostname))
181 emulatedPatterns.push({selector: filter.selector, text: filter.text}); 181 emulatedPatterns.push({selector: filter.selector, text: filter.text});
182 } 182 }
(...skipping 16 matching lines...) Expand all
199 response.inlineEmulated = true; 199 response.inlineEmulated = true;
200 200
201 return response; 201 return response;
202 }); 202 });
203 203
204 port.on("elemhide.injectSelectors", (message, sender) => 204 port.on("elemhide.injectSelectors", (message, sender) =>
205 { 205 {
206 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, 206 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors,
207 message.groupName); 207 message.groupName);
208 }); 208 });
OLDNEW
« no previous file with comments | « lib/csp.js ('k') | lib/filterComposer.js » ('j') | lib/requestBlocker.js » ('J')

Powered by Google App Engine
This is Rietveld