diff --git a/README.md b/README.md index c931207..7f98a0f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + +
@@ -135,7 +137,7 @@ Below are non-custodial open-source wallets that use features specific to Bitcoi ## Mobile - [Electron-Cash](https://electroncash.org) - Android [[src]](https://github.com/Electron-Cash/Electron-Cash/tree/master/android) and iOS [[src]](https://github.com/Electron-Cash/Electron-Cash/tree/master/ios) versions available with more limited functionality. -- [Paytaca](https://www.paytaca.com/) [[src]] (https://github.com/paytaca/paytaca-app) - A mobile wallet for Android, iOS and ChromeOS +- [Paytaca](https://www.paytaca.com/) [[src]](https://github.com/paytaca/paytaca-app) - A mobile wallet for Android, iOS and ChromeOS - [zapit](https://zapit.io/#/) - A native, non-custodial Bitcoin Cash wallet for iOS and Android. - [flowee pay](https://flowee.org/products/pay/) [[src]](https://codeberg.org/Flowee/pay/) [[apk]](https://flowee.org/products/pay/) [[docs]](https://flowee.org/docs/pay/) - A user friendly wallet for Android and Linux desktop. - [Bitcoin.com](https://wallet.bitcoin.com/) - A user friendly bitcoin wallet. diff --git a/manifest.webmanifest b/manifest.webmanifest new file mode 100644 index 0000000..8247655 --- /dev/null +++ b/manifest.webmanifest @@ -0,0 +1,17 @@ +{ + "name": "Awesome Bitcoin Cash", + "short_name": "🚀", + "description": "Bitcoin Cash (BCH) links", + "scope": "/", + "start_url": "/", + "background_color": "#8dc351", + "theme_color": "#8dc351", + "display": "standalone", + "icons": [ + { + "src": "/assets/awesome-bitcoin-cash.png", + "type": "image/png", + "sizes": "700x700" + } + ] + } \ No newline at end of file diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..78513ce --- /dev/null +++ b/sw.js @@ -0,0 +1,52 @@ +var GHPATH = '/'; +var APP_PREFIX = 'awesome_bitcoin_'; +var VERSION = 'version_002'; +var URLS = [ + `${GHPATH}/`, + `${GHPATH}/index.html`, + `${GHPATH}/assets/css/styles.css`, + `${GHPATH}/assets/awesome-bitcoin-cash.svg`, + `${GHPATH}/js/app.js` +] + +var CACHE_NAME = APP_PREFIX + VERSION +self.addEventListener('fetch', function (e) { + console.log('Fetch request : ' + e.request.url); + e.respondWith( + caches.match(e.request).then(function (request) { + if (request) { + console.log('Responding with cache : ' + e.request.url); + return request + } else { + console.log('File is not cached, fetching : ' + e.request.url); + return fetch(e.request) + } + }) + ) +}) + +self.addEventListener('install', function (e) { + e.waitUntil( + caches.open(CACHE_NAME).then(function (cache) { + console.log('Installing cache : ' + CACHE_NAME); + return cache.addAll(URLS) + }) + ) +}) + +self.addEventListener('activate', function (e) { + e.waitUntil( + caches.keys().then(function (keyList) { + var cacheWhitelist = keyList.filter(function (key) { + return key.indexOf(APP_PREFIX) + }) + cacheWhitelist.push(CACHE_NAME); + return Promise.all(keyList.map(function (key, i) { + if (cacheWhitelist.indexOf(key) === -1) { + console.log('Deleting cache : ' + keyList[i] ); + return caches.delete(keyList[i]) + } + })) + }) + ) +}) \ No newline at end of file