| Index: lib/hitLogger.js |
| =================================================================== |
| --- a/lib/hitLogger.js |
| +++ b/lib/hitLogger.js |
| @@ -84,18 +84,21 @@ |
| * The active sitekey if there is any |
| * @param {?boolean} request.specificOnly |
| * Whether generic filters should be ignored |
| * @param {?BlockingFilter} filter |
| * The matched filter or null if there is no match |
| */ |
| exports.logRequest = (tabIds, request, filter) => |
| { |
| - for (let tabId of tabIds) |
| - eventEmitter.emit(tabId, request, filter); |
| + if (eventEmitter.hasListeners()) |
| + { |
| + for (let tabId of tabIds) |
| + eventEmitter.emit(tabId, request, filter); |
| + } |
| }; |
| /** |
| * Logs active element hiding filters for a tab. |
| * |
| * @param {number} tabId The ID of the tab, the elements were hidden in |
| * @param {string[]} selectors The selectors of applied ElemHideFilters |
| * @param {string[]} filters The text of applied ElemHideEmulationFilters |