File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 55// @author James Teh <jamie@jantrid.net>
66// @copyright 2019-2025 Mozilla Corporation, Derek Riemer, James Teh
77// @license Mozilla Public License version 2.0
8- // @version 2025.1
8+ // @version 2025.2
99// @include https://web.whatsapp.com/
1010// ==/UserScript==
1111
@@ -254,6 +254,15 @@ function userInit(){
254254 button . click ( ) ;
255255 }
256256 } , { capture : true } ) ;
257+ document . addEventListener ( "focusout" , event => {
258+ // When the tab loses focus, WhatsApp forces focus into the message list,
259+ // regardless of where it was before. Override that absurdity.
260+ setTimeout ( ( ) => {
261+ if ( ! document . hasFocus ( ) && document . activeElement != event . target ) {
262+ event . target . focus ( ) ;
263+ }
264+ } , 50 ) ;
265+ } ) ;
257266}
258267
259268/*** Lights, camera, action! ***/
You can’t perform that action at this time.
0 commit comments