From 4a761efaed0d77f3bd1f16cf06a7929abd2147d4 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Fri, 29 May 2020 22:06:24 +0200 Subject: [PATCH] Find all blacklisted origins in stack --- src/ext/lib/Logger.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/ext/lib/Logger.js b/src/ext/lib/Logger.js index 345462b..521efab 100644 --- a/src/ext/lib/Logger.js +++ b/src/ext/lib/Logger.js @@ -227,29 +227,21 @@ class Logger { stackInfo['mousemove'] = false; stackInfo['exitLogs'] = false; - // here we check which source triggered the action. We know that only one of these - // functions will appear in the trace at most once (and if more than one of these - // appears — e.g. frameCheck triggered by user toggling autodetection in popup — - // the most recent one will be the correct one 99% of the time) + // here we check which source triggered the action. There can be more + // than one source, too, so we don't break when we find the first one for (const line of stackInfo.stack.trace) { if (line === 'doPeriodicPlayerElementChangeCheck') { stackInfo['periodicPlayerCheck'] = true; - break; } else if (line === 'doPeriodicFallbackChangeDetectionCheck') { stackInfo['periodicVideoStyleChangeCheck'] = true; - break; } else if (line === 'frameCheck') { stackInfo['aard'] = true; - break; } else if (line === 'execAction') { stackInfo['keyboard'] = true; - break; } else if (line === 'processReceivedMessage') { stackInfo['popup'] = true; - break; } else if (line === 'handleMouseMove') { stackInfo['mousemove'] = true; - break; } }