3 ms·
Awesome, didn't know about the Page Visibility API but now I'd like to explore it as a way to stop/start subscribing to streaming data.
by thex10 4y ago
Awesome, didn't know about the Page Visibility API but now I'd like to explore it as a way to stop/start subscribing to streaming data.
- ghayes 4y agoI just tend to wrap my timer callbacks in a requestAnimationFrame, which should delay processing when the page isn’t visible. I guess this is a hack, but it’s been with me for so long now.
- alwayslikethis 4y agoI use an extension to disable/spoof it by default as a way to counteract those annoying websites that wants you to watch things in their entirety.
- notatoad 4y agoif applications are using it for non-nefarious reasons, the fallback behaviour for people like you who block it is to use more of your bandwidth or battery power to render non-visible elements. it's an optimization for most people, so it's still worth implementing even if some clients block the API.