Currently if the sidebar is closed, the last open tab still has document.visibilityState == "visible". Switching between tabs correctly triggers this being set to "hidden" (my guess you use one shared browser renderer smthsmth? that automatically handles updating this state).
If there is a way, could setting the state to hidden (also triggering a 'visibilitychange' event and updating document.hidden?) be manually invoked on the browser somehow? Alternatively could the renderer be directed to target some "null" page (e.g. about:blank) so that the old page becomes "hidden"?
As a side effect of this "bug", pages which rely on visibility state/events for some functionality misuse this incorrect value. E.g. discord notifications are disabled when the page is visible, even if the sidebar is closed and thus the page is not visible.
Recreate:
- open a tab in sidebar
- open devtools for that tab
- observe
document.visibilityState => "visible"
- close sidebar (e.g. click on the opened tab icon)
- observe
document.visibilityState => "visible" (This should ideally be "hidden")
- open DIFFERENT tab in sidebar
- observe
document.visibilityState => "hidden" (for the original tab from step 1) (This is ideal behaviour)
Currently if the sidebar is closed, the last open tab still has
document.visibilityState == "visible". Switching between tabs correctly triggers this being set to"hidden"(my guess you use one shared browser renderer smthsmth? that automatically handles updating this state).If there is a way, could setting the state to hidden (also triggering a 'visibilitychange' event and updating document.hidden?) be manually invoked on the browser somehow? Alternatively could the renderer be directed to target some "null" page (e.g.
about:blank) so that the old page becomes "hidden"?As a side effect of this "bug", pages which rely on visibility state/events for some functionality misuse this incorrect value. E.g. discord notifications are disabled when the page is visible, even if the sidebar is closed and thus the page is not visible.
Recreate:
document.visibilityState=>"visible"document.visibilityState=>"visible"(This should ideally be"hidden")document.visibilityState=>"hidden"(for the original tab from step 1) (This is ideal behaviour)