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

Delta Between Two Patch Sets: lib/cssInjection.js

Issue 29545645: Issue 5695 - Use tabs.insertCSS if extensionTypes.CSSOrigin exists (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Always pass selectors if trace or inject is true Created Sept. 19, 2017, 5:44 a.m.
Right Patch Set: Flatten out logic and remove blank line Created Sept. 20, 2017, 2:14 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 if (!checkWhitelisted(sender.page, sender.frame, 49 if (!checkWhitelisted(sender.page, sender.frame,
50 RegExpFilter.typeMap.DOCUMENT | 50 RegExpFilter.typeMap.DOCUMENT |
51 RegExpFilter.typeMap.ELEMHIDE)) 51 RegExpFilter.typeMap.ELEMHIDE))
52 { 52 {
53 let specificOnly = checkWhitelisted(sender.page, sender.frame, 53 let specificOnly = checkWhitelisted(sender.page, sender.frame,
54 RegExpFilter.typeMap.GENERICHIDE); 54 RegExpFilter.typeMap.GENERICHIDE);
55 selectors = ElemHide.getSelectorsForDomain( 55 selectors = ElemHide.getSelectorsForDomain(
56 extractHostFromFrame(sender.frame), 56 extractHostFromFrame(sender.frame),
57 specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING 57 specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING
58 ); 58 );
59
60 if (!inject && selectors.length > 0)
61 hideElements(sender.page.id, sender.frame.id, selectors);
62 } 59 }
63 60
61 if (!inject && selectors.length > 0)
62 hideElements(sender.page.id, sender.frame.id, selectors);
63
64 let response = {trace, inject}; 64 let response = {trace, inject};
65
Manish Jethani 2017/09/20 02:24:00 I'm assuming you meant delete this blank line here
66 if (trace || inject) 65 if (trace || inject)
67 response.selectors = selectors; 66 response.selectors = selectors;
68 67
69 return response; 68 return response;
70 }); 69 });
71 70
72 port.on("elemhide.injectSelectors", (msg, sender) => 71 port.on("elemhide.injectSelectors", (msg, sender) =>
73 { 72 {
74 hideElements(sender.page.id, sender.frame.id, msg.selectors); 73 hideElements(sender.page.id, sender.frame.id, msg.selectors);
75 }); 74 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld