Visibility-related event on `window` do not work (in one profile only)
-
On one of my profiles, for some reason, events such as
blur
,focus
,visibilitychange
do not work onwindow
.So if I run this code in the console:
window.addEventListener('blur', () => { console.log('BLUR WINDOW') });
or this:
window.addEventListener('visibilitychange', (e) => { console.log(e) });
and then switch tabs and switch back, nothing is logged.
However, when I do the same on my other Vivaldi profile or in a Private Window, it works fine. This is so weird.
I thought it might be related to an extension, so I disabled all installed extensions and restarted Vivaldi, but that didn’t help. I also checked whether I had changed anything in
vivaldi:flags
orvivaldi:experiments
, there was nothing unusual.So, I'm still trying to figure out the reason. Any ideas? Could there be a setting I’m missing?
P.S. I discovered this while trying to understand why TanStack Query's
useQuery
doesn't trigger refetch whenrefetchOnWindowFocus
is not changed tofalse
and has its defaulttrue
value.