From 4fa44cda88a7aab41efac7ffcacb6733b3d25a67 Mon Sep 17 00:00:00 2001 From: mbeko Date: Tue, 7 Nov 2023 16:54:10 +0100 Subject: [PATCH] Open Meet chat window only upon pressing down the configured key Something has changed in Google Meet such that the chat isn't marked as having focus quickly enough, so the key release event triggers a second click on the chat button. The effect is that the chat disappears almost immediately after being opened. Therefore, now the chat button is not clicked upon the key release event. --- google-meet-ptt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-meet-ptt.js b/google-meet-ptt.js index 3979f55..abe271c 100644 --- a/google-meet-ptt.js +++ b/google-meet-ptt.js @@ -5,7 +5,7 @@ // @homepageURL https://josephgeis.dev/ // @description Makes Space into a Push-to-Talk button, makes Shift a PTT for the camera, and makes Enter a shortcut to the chat window. // @license MIT -// @version 1.0.2 +// @version 1.0.3 // @grant none // @include https://meet.google.com/* // ==/UserScript== @@ -54,7 +54,7 @@ function cameraMute(e) { } function chatWindow(e) { - if (e.key != window.chatKey || chatHasFocus()) return; + if (e.key != window.chatKey || e.type === "keyup" || chatHasFocus()) return; const chatMenuButton = document.querySelector("button[aria-label*='Chat']"); chatMenuButton.click();