Permalink
Browse files

Programmatically update the app cache on page load. Mobile Safari is …

…getting on my nerves.
  • Loading branch information...
cheeaun committed Mar 4, 2012
1 parent 1ffc19f commit 5d44a4bcdde2d1230b38b18348acc7ed5311523a
Showing with 9 additions and 0 deletions.
  1. +9 −0 hn.js
View
9 hn.js
@@ -395,4 +395,13 @@
}
}, 15);
}, false);
+
+ // Programmatically update the app cache
+ if (w.applicationCache) w.addEventListener('load', function(){
+ w.applicationCache.addEventListener('updateready', function(){
+ if (w.applicationCache.status == w.applicationCache.UPDATEREADY){
+ w.applicationCache.swapCache();
+ }
+ }, false);
+ }, false);
}(window, document);

0 comments on commit 5d44a4b

Please sign in to comment.