From 022b76e77a1cc6014738196ca4bd5adf919af7d2 Mon Sep 17 00:00:00 2001 From: Stacey Van Herk <13419300+svanherk@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:26:06 -0400 Subject: [PATCH] fix: Temporarily add logging around how long it takes to reset mouse position (#55) --- src/browser/reset.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/browser/reset.js b/src/browser/reset.js index 6c9d6819..06ed5eb3 100644 --- a/src/browser/reset.js +++ b/src/browser/reset.js @@ -23,7 +23,11 @@ export async function reset(opts) { window.scroll(0, 0); + const startTime = Date.now(); await sendMouse({ type: 'move', position: [0, 0] }).catch(() => {}); + const timeTaken = Date.now() - startTime; + // eslint-disable-next-line no-console + if (timeTaken > 200) console.log(`*** Took ${timeTaken}ms to reset mouse position.`); if (document.activeElement !== document.body) { document.activeElement.blur();