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

Delta Between Two Patch Sets: lib/hitLogger.js

Issue 29907589: Issue 7054 - Update the adblockpluscore dependency to 5cb695da5a40, adblockplusui to f86abf2efdfd (Closed)
Left Patch Set: Add all the changes Created Nov. 29, 2018, 5:29 p.m.
Right Patch Set: Address PS12 Comment Created Jan. 8, 2019, 1:02 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 | « lib/firefoxDataCleanup.js ('k') | lib/indexedDBBackup.js » ('j') | 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 */ 107 */
108 function logHiddenElements(tabId, selectors, filters, docDomain) 108 function logHiddenElements(tabId, selectors, filters, docDomain)
109 { 109 {
110 if (HitLogger.hasListener(tabId)) 110 if (HitLogger.hasListener(tabId))
111 { 111 {
112 for (let subscription of filterStorage.subscriptions()) 112 for (let subscription of filterStorage.subscriptions())
113 { 113 {
114 if (subscription.disabled) 114 if (subscription.disabled)
115 continue; 115 continue;
116 116
117 for (let filter of subscription.filters) 117 for (let filter of subscription.filters())
118 { 118 {
119 // We only know the exact filter in case of element hiding emulation. 119 // We only know the exact filter in case of element hiding emulation.
120 // For regular element hiding filters, the content script only knows 120 // For regular element hiding filters, the content script only knows
121 // the selector, so we have to find a filter that has an identical 121 // the selector, so we have to find a filter that has an identical
122 // selector and is active on the domain the match was reported from. 122 // selector and is active on the domain the match was reported from.
123 let isActiveElemHideFilter = filter instanceof ElemHideFilter && 123 let isActiveElemHideFilter = filter instanceof ElemHideFilter &&
124 selectors.includes(filter.selector) && 124 selectors.includes(filter.selector) &&
125 filter.isActiveOnDomain(docDomain); 125 filter.isActiveOnDomain(docDomain);
126 126
127 if (isActiveElemHideFilter || filters.includes(filter.text)) 127 if (isActiveElemHideFilter || filters.includes(filter.text))
(...skipping 26 matching lines...) Expand all
154 } 154 }
155 }; 155 };
156 156
157 port.on("hitLogger.traceElemHide", (message, sender) => 157 port.on("hitLogger.traceElemHide", (message, sender) =>
158 { 158 {
159 logHiddenElements( 159 logHiddenElements(
160 sender.page.id, message.selectors, message.filters, 160 sender.page.id, message.selectors, message.filters,
161 extractHostFromFrame(sender.frame) 161 extractHostFromFrame(sender.frame)
162 ); 162 );
163 }); 163 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld