OLD | NEW |
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 * Whether the origin of the request and document differs | 82 * Whether the origin of the request and document differs |
83 * @param {?string} request.sitekey | 83 * @param {?string} request.sitekey |
84 * The active sitekey if there is any | 84 * The active sitekey if there is any |
85 * @param {?boolean} request.specificOnly | 85 * @param {?boolean} request.specificOnly |
86 * Whether generic filters should be ignored | 86 * Whether generic filters should be ignored |
87 * @param {?BlockingFilter} filter | 87 * @param {?BlockingFilter} filter |
88 * The matched filter or null if there is no match | 88 * The matched filter or null if there is no match |
89 */ | 89 */ |
90 exports.logRequest = (tabIds, request, filter) => | 90 exports.logRequest = (tabIds, request, filter) => |
91 { | 91 { |
92 for (let tabId of tabIds) | 92 if (eventEmitter.hasListeners()) |
93 eventEmitter.emit(tabId, request, filter); | 93 { |
| 94 for (let tabId of tabIds) |
| 95 eventEmitter.emit(tabId, request, filter); |
| 96 } |
94 }; | 97 }; |
95 | 98 |
96 /** | 99 /** |
97 * Logs active element hiding filters for a tab. | 100 * Logs active element hiding filters for a tab. |
98 * | 101 * |
99 * @param {number} tabId The ID of the tab, the elements were hidden in | 102 * @param {number} tabId The ID of the tab, the elements were hidden in |
100 * @param {string[]} selectors The selectors of applied ElemHideFilters | 103 * @param {string[]} selectors The selectors of applied ElemHideFilters |
101 * @param {string[]} filters The text of applied ElemHideEmulationFilters | 104 * @param {string[]} filters The text of applied ElemHideEmulationFilters |
102 * @param {string} docDomain The hostname of the document | 105 * @param {string} docDomain The hostname of the document |
103 */ | 106 */ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 153 } |
151 }; | 154 }; |
152 | 155 |
153 port.on("hitLogger.traceElemHide", (message, sender) => | 156 port.on("hitLogger.traceElemHide", (message, sender) => |
154 { | 157 { |
155 logHiddenElements( | 158 logHiddenElements( |
156 sender.page.id, message.selectors, message.filters, | 159 sender.page.id, message.selectors, message.filters, |
157 extractHostFromFrame(sender.frame) | 160 extractHostFromFrame(sender.frame) |
158 ); | 161 ); |
159 }); | 162 }); |
OLD | NEW |