This file contains hidden or 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
var webappCache = window.applicationCache; | |
webappCache.addEventListener("updateready", updateCache, false); | |
webappCache.update(); | |
function updateCache() { | |
webappCache.swapCache(); | |
alert("Une nouvelle version est disponible.\nVeuillez rafraîchir la page pour mettre à jour."); | |
} |
This file contains hidden or 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
switch (appCache.status) { | |
case appCache.UNCACHED: // UNCACHED == 0 | |
return 'UNCACHED'; | |
break; | |
case appCache.IDLE: // IDLE == 1 | |
return 'IDLE'; | |
break; | |
... |
This file contains hidden or 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
if (webappCache.status == window.applicationCache.UPDATEREADY) |
This file contains hidden or 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
interface ApplicationCache { | |
// update status | |
const unsigned short UNCACHED = 0; | |
const unsigned short IDLE = 1; | |
const unsigned short CHECKING = 2; | |
const unsigned short DOWNLOADING = 3; | |
const unsigned short UPDATEREADY = 4; | |
const unsigned short OBSOLETE = 5; | |
readonly attribute unsigned short status; |
This file contains hidden or 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
<link rel="apple-touch-startup-image" href="startup.png" /> |
This file contains hidden or 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
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
This file contains hidden or 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
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-touch-fullscreen" content="yes"> |
This file contains hidden or 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
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon.png" /> |
This file contains hidden or 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
<link rel="apple-touch-icon" href="apple-touch-icon.png"/> |
This file contains hidden or 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
Creating Application Cache with manifest http://localhost/le-chemin-vers-votre-manifest | |
Application Cache Checking event | |
Application Cache Downloading event | |
Application Cache Progress event (0 of 3) | |
... (1 of 3) | |
... (2 of 3) | |
... (3 of 3) | |
Application Cache Cached event |