Created
April 16, 2012 08:59
-
-
Save ydkn/2397174 to your computer and use it in GitHub Desktop.
HTML5 offline requirements
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; | |
// updates | |
void update(); | |
void swapCache(); | |
// events | |
attribute Function onchecking; | |
attribute Function onerror; | |
attribute Function onnoupdate; | |
attribute Function ondownloading; | |
attribute Function onprogress; | |
attribute Function onupdateready; | |
attribute Function oncached; | |
attribute Function onobsolete; | |
}; | |
ApplicationCache implements EventTarget; |
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
<!DOCTYPE html> | |
<html lang="en" manifest="/offline.appcache"> | |
<head> | |
... | |
</head> |
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
CACHE MANIFEST | |
CACHE: | |
/index.html | |
/page1.html | |
/styles.css | |
/scripts.js | |
http://cdn.example.net/logo.png | |
FALLBACK: | |
/only_online.html /offline.html | |
NETWORK: | |
http://* | |
https://* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment