How Web Content Can Affect Power Usage
Power saving is great, except when it breaks apps.<p>Unfortunately, Webkit has broken certain web apps by their power saving features.<p>For example, on iOS, I have a Pandora-like web app that plays music. When my app is in the background and the current song ends, it won&#x27;t play the next song because iOS has suspended Javascript execution in the name of power saving. I&#x27;m not doing any <i>active</i> JS, just an event handler for audio.ended event. The event handler never fires when my app is the in background or when the screen is off, thus, I can&#x27;t play the next song. This effectively makes it impossible to build a functioning audio app&#x2F;radio station on iOS using web technologies.<p>I&#x27;ve reported this issue to Apple some 2 years ago, but they still haven&#x27;t fixed it.<p>Bonus: as of iOS 12, it also breaks web apps that are packaged with Cordova and published into the App Store.