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

Side by Side Diff: lib/hitLogger.js

Issue 29995566: Noissue - Avoid loop if DevTools is closed (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Feb. 2, 2019, 4:14 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld