Last active
September 23, 2015 21:18
-
-
Save thomasyip/618005 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Here is the simplified version. Courtesy of Mike Koss. | |
* | |
* See, http://labnote.beedesk.com/the-pitfalls-of-html5-applicationcache | |
*/ | |
function handleAppCache() { | |
if (applicationCache == undefined) { | |
return; | |
} | |
if (applicationCache.status == applicationCache.UPDATEREADY) { | |
applicationCache.swapCache(); | |
location.reload(); | |
return; | |
} | |
applicationCache.addEventListener('updateready', handleAppCache, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment