From fbde2eeb44bf234f1c4c1b0d214a14cdee041987 Mon Sep 17 00:00:00 2001 From: The Doggy Brad <94173621+thedoggybrad@users.noreply.github.com> Date: Fri, 23 Dec 2022 18:25:47 +0800 Subject: [PATCH] PWA = Impossible --- pwa/manifest.json | 38 ------------------------------------- pwa/service_worker_check.js | 9 --------- pwa/service_worker_main.js | 27 -------------------------- 3 files changed, 74 deletions(-) delete mode 100644 pwa/manifest.json delete mode 100644 pwa/service_worker_check.js delete mode 100644 pwa/service_worker_main.js diff --git a/pwa/manifest.json b/pwa/manifest.json deleted file mode 100644 index ef7b09f..0000000 --- a/pwa/manifest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "short_name": "QR Scanner", - "name": "QR Scanner", - "description": "It is an Online QR Code Scanner from TheDoggyBrad that is easy to use.", - "display": "standalone", - "orientation": "portrait", - "icons": [ - { - "src": "https://raw.githubusercontent.com/thedoggybrad/qrscanner/main/images/touch/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "https://raw.githubusercontent.com/thedoggybrad/qrscanner/main/images/touch/android-chrome-512x512.png", - "sizes": "512x512", - "type": "image/png" - }], - "start_url": "https://thedoggybrad.github.io/qrscanner/index.html?utm_source=homescreen", - "theme_color": "#e4e4e4", - "background_color": "#fff", - "screenshots": [ - { - "src": "https://raw.githubusercontent.com/thedoggybrad/qrscanner/main/images/screenshots/screenshot1.png", - "type": "image/png", - "sizes": "586x1041" - }, - { - "src": "https://raw.githubusercontent.com/thedoggybrad/qrscanner/main/images/screenshots/screenshot2.png", - "type": "image/png", - "sizes": "586x1041" - }, - { - "src": "https://raw.githubusercontent.com/thedoggybrad/qrscanner/main/images/screenshots/screenshot3.png", - "type": "image/png", - "sizes": "586x1041" - } - ] -} diff --git a/pwa/service_worker_check.js b/pwa/service_worker_check.js deleted file mode 100644 index 6a3a4a9..0000000 --- a/pwa/service_worker_check.js +++ /dev/null @@ -1,9 +0,0 @@ -if ('serviceWorker' in navigator) { - navigator.serviceWorker.register('https://thedoggybrad.github.io/2048ontheweb/pwa/service_worker_main.js').then(function(registration) { - // Registration was successful - console.log('ServiceWorker registration successful with scope: ', registration.scope); - }).catch(function(err) { - // registration failed :( - console.log('ServiceWorker registration failed: ', err); - }); -} diff --git a/pwa/service_worker_main.js b/pwa/service_worker_main.js deleted file mode 100644 index b679cb3..0000000 --- a/pwa/service_worker_main.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -const CACHE_NAME = 'cache-v2'; -// The files we want to cache -const resourceList = [ - '/', - 'https://thedoggybrad.github.io/qrscanner/index.html', - -]; - -self.addEventListener('install', event => { - event.waitUntil(caches.open(CACHE_NAME).then(cache => { - return cache.addAll(resourceList); - })); -}); - -function addToCache(cacheName, resourceList) { - caches.open(cacheName).then(cache => { - return cache.addAll(resourceList); - }); -} - -self.addEventListener('fetch', event => { - event.respondWith(caches.match(event.request).then(response => { - return response || fetch(event.request); - })); -});