Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pavel-durov/app.cache.handler
This plugin iterates over html app.cache file list and downloads it to the local folder
https://github.com/pavel-durov/app.cache.handler
Last synced: about 1 month ago
JSON representation
This plugin iterates over html app.cache file list and downloads it to the local folder
- Host: GitHub
- URL: https://github.com/pavel-durov/app.cache.handler
- Owner: Pavel-Durov
- Created: 2015-11-05T14:11:12.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-05T14:22:24.000Z (about 9 years ago)
- Last Synced: 2024-12-06T21:32:27.505Z (about 1 month ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This plugin originaly created as I was developing Cordova app for Windows 8.1 platform as a target. The main issue was that the webView of that version (v2.0) didn't support html appcache feature.
So I wrote this plugin in order to iterate over the appcache list and download one by one the files to application local folder.However, This plugin can be used for any list of files that needed to download, sumply replace the values which set with const keys.
Usage:
1. Install the plugin.
2.
var url = "This-Is-The-Url-Of-The-App-Cache";
var envelope = {}
envelope[window.cacheHandler.constKeys.URL] = url;
//The char which on which split operation based
envelope[window.cacheHandler.constKeys.SPLIT_BY_KEY] = "\r\n";
//Base url for for requests
envelope[window.cacheHandler.constKeys.BASE_URL] = "http://localhost:1234";
//The main page which is not cached (if no-store tag applied)
envelope[window.cacheHandler.constKeys.INDEX_HTML] = "index.html";
window.cacheHandler.fetch(envelope, function (done) {
//Called if all files completed successfully
}, function (error) {
//Called if one of the files failed to download
//error - contains array of failed requests
});