3 ms·
Visibility API for browser tabs/windows
- voxx 15y agothis is pretty cool. very practical for advertising purposes and things like that.
- chris_wot 15y agoNot to mention that it helps stop Firefox from using up all your battery life! :-)
- philbo 15y agoI wonder how much global warming can be accounted for by CPU cycles spent needlessly executing instructions from undisplayed web pages? If every website started using the Page Visibility API, we could save the planet! This library looks good, the high-level timer and initialiser stuff is a nice abstraction.
- loceng 15y agoIt's likely more the method of energy generation for powering computers that is potentially (probably) contributing to pollution, which would be affecting global warming than the actual heat accounted for by CPUs..
- bhauer 15y agoThanks for this! I was looking for something similar just a week ago.
- tommi 15y ago"improve user interface experience (for example, by stopping video playback or slideshow when user switches to another browser tab)." In general, please don't do that. I might want to listen to the video or check and save a reference from the video in an another browser window. I think there are many uses cases where this kind of automation, especially without ability to disable it, actually hinders usability.
- TazeTSchnitzel 15y agoI agree. This is something that bothers me in Windows 8: the fact applications have to "pause" when they run in the background. Unfortunately, this prevents you from listening to music in a YouTube video without having the browser on-screen.
- taitems 15y agoYou can hack up something similar with the idleTimer plugin, modified by Paul Irish. http://paulirish.com/2009/jquery-idletimer-plugin/ http://paulirish.com/2009/jquery-idletimer-plugin/