LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 }); |
LEFT | RIGHT |