Skip to main content

Questions tagged [visibilitychange]

The tag has no usage guidance, but it has a tag wiki.

visibilitychange
0 votes
0 answers
21 views

How much time do I have to save data to local storage when browser visibility changes to hidden?

I want to save page data to local storage upon tab close or reload. I am saving data upon visibilitychange event to hidden. I've read this is the recommended way to do so per Page Lifecycle API and ...
Konrad Jamrozik's user avatar
2 votes
0 answers
36 views

visibilitychange not firing on browser close in firefox

I am trying to send some data for analytics on browser close and the visibilitychange event listener is not being triggered on browser close on firefox. This works as expected in chrome. MDN says this ...
prajot surey's user avatar
0 votes
1 answer
48 views

How to Warn Users Before Changing Tabs or Minimizing Window During an Online Quiz?

I am conducting an online quiz, Here is what I want to achieve: Detect when a user tries to switch tabs or windows. Detect when a user tries to minimize the window. Display a warning message before ...
Lakshmi Intern_AEPL's user avatar
0 votes
0 answers
26 views

When switching from safari to another and then back to safari, I can't detect that safari has been reopened consistently (React Native)

I am building a react-native / expo application that I am running as a web app. When I tab out of safari, and wait 10-15 seconds and tab back into it, my application is not consistently reconnecting ...
DevDenzo's user avatar
0 votes
0 answers
28 views

How do I hide an entire HTML page, but make the page still renders and still exist?

I'm making an extension to hide the ChromeOS bookshelf by displaying a completely hidden tab, so the device would register a window being drawn, but the user could not interact or notice it. This is ...
grumpyman1's user avatar
2 votes
1 answer
786 views

Browser visibilitychange event no longer fired on page navigation?

The MDN docs say that the visibilitychange event fires with a visibilityState of hidden when a user navigates to a new page, switches tabs, closes the tab, minimizes or closes the browser, or, on ...
jdrub's user avatar
  • 70
0 votes
0 answers
41 views

Android - Why this TextView is moving its position after changing its visibility programmatically?

Initially both TextViews are visible and aligned correctly: After clicking the Button, I set both TextViews visibility to GONE. Second time I click on the Button, I set the visibility again to ...
xerez's user avatar
  • 69
0 votes
0 answers
881 views

Visibility Detector flutter

I am using visibility detector in flutter to check for 100% visibility of a widget. But even when the widget is behind a fixed app bar the visibility detector considers it to be 100% visible. What is ...
Prakhar Bhalla's user avatar
1 vote
0 answers
486 views

Detecting browser tab crash in mobile Safari

We are building a web application that sometimes crashes in Mobile Safari due to a jetsam event, where the OS kills the process because of bad memory usage. We think we have a handle on the bug, but ...
SidSethupathi's user avatar
3 votes
1 answer
2k views

At first only Default time bar disappears after timeout and then again after timeout full controller disappears of Exoplayer

As shown in the image and video, I am facing an issue while using styled player view. I have set controllerShowTimeoutMs to 2 seconds, but I am getting results as shown in the below image... Or as In ...
Akhil Hothi's user avatar
6 votes
1 answer
2k views

`visibilitychange` firing as "hidden" and not "visible" for new window initial load

I am launching a new tab and trying to add a visibilitychange handler for the window in order to add unload behavior, since all the docs recommend that over onunload and pagehide. My plan was to ...
cebo's user avatar
  • 778
4 votes
1 answer
2k views

Do not fire visibilitychange event on document reloads(refresh, page navigation) but fire on close browser, close tab, or switch tab

document.addEventListener("visibilitychange", onVisibilityChange, { passive: true, }); This will fire even when someone navigates away from my page. Ofcourse this is logical. But is ...
Arjen's user avatar
  • 1,100
2 votes
0 answers
540 views

Switching fullscreen triggers a "visibilitychange" event on safari

On Safari (15.3) on Macos (11.6.4), and possibly on ios too, enabling and disabling fullscreen triggers a "visibilitychange" event. It doesn't on Chrome and Firefox. Is there a simple way to ...
user1657853's user avatar
1 vote
0 answers
51 views

Visibility.js doesn't fire state change

In my react project have visibility.js package imported, which I am using to re-render page if user opens web view from background and more then 5 min is passed, inside one of my hook I have simple ...
Vano's user avatar
  • 730
2 votes
0 answers
3k views

Why is my fetch keepalive call on page unload failing in Safari?

I need to send back a bit of data for reporting when the user closes or leaves a specific page. So I set up an API endpoint and am using window.fetch with the keepalive flag set to make sure that the ...
Dark Phoenix's user avatar

15 30 50 per page