You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, document.hasFocus() doesn't work on localhost. It always returns true when DevTools is Open.
EDIT just checked if this is by chance not an issue with HTTP vs HTTPS, and It turns out the same issue happens on any host when a page is served via HTTP.
To test the issue, open the page and switch tab and back and open dev tools. Do the same when dev tools is open.
EDIT 2: Just installing SSL certificate for localhost, and serving files with https don't solve the issue. visibilityState still don't change when dev tools is open.
The text was updated successfully, but these errors were encountered:
jcubic
changed the title
visibilitychange and visibilityState doesn't work when DevTools is Open
visibilitychange and visibilityState doesn't work when using HTTP and DevTools is Open
Nov 28, 2024
Description
I've tried to write code that use both API and the even don't fire when you change tabs and the
visibilityState
is always'visible'
.Steps to reproduce
Actual result
No logs in console until you close the DevTools before you switch tabs.
Expected result
The event should fire the
document.visibilityState
should changeReproduces how often
Easily reproduced
Brave version (brave://version info)
Channel information
Reproducibility
Miscellaneous information
It works fine in Google Chrome and Firefox
Additionally,
document.hasFocus()
doesn't work onlocalhost
. It always returnstrue
when DevTools is Open.EDIT just checked if this is by chance not an issue with HTTP vs HTTPS, and It turns out the same issue happens on any host when a page is served via HTTP.
Here is reproduction: http://u.just.net.pl
To test the issue, open the page and switch tab and back and open dev tools. Do the same when dev tools is open.
EDIT 2: Just installing SSL certificate for localhost, and serving files with https don't solve the issue.
visibilityState
still don't change when dev tools is open.The text was updated successfully, but these errors were encountered: