3 ms·
It might make sense to detect page visibility prior to loading a pay-per-load API like Mapbox GL JS, Apple Maps on Web, etc. The scenario I imagine is: 1. You
by tppiotrowski 4y ago
It might make sense to detect page visibility prior to loading a pay-per-load API like Mapbox GL JS, Apple Maps on Web, etc.
The scenario I imagine is:
1. Your map is loaded
2. User opens a new tab (your map is now in a background tab)
3. User restarts browser and existing tabs are loaded
4. You get charged for an API load even though the page is not visible
Does anyone know if this is the case?
Edit: also analytics. If you don't load your GA until page is visible, I wonder what impact that has on your visitor numbers
- lloydatkinson 4y agoSeems like a good use case. I wrote a Christmas quiz app in December and I could see from the server logs someone must have left the scoreboard page open for weeks as I used polling to check for the latest score. Checking if the tab was even active would have been a good idea.