Closed ysc3839 closed 3 years ago
I'm not sure if Genshin Schedule would benefit from service workers, because it's generally expected to be open alongside the game which requires an internet connection.
I also think this will completely break the website for users who enabled synchronization, because the website heavily relies on fetching the latest synchronized data and sending patches when you change things. This doesn't work without an internet connection.
The service worker does nothing. It won't break the website. For example, a Chinese forum v2ex.com use the same way to make it installable: https://v2ex.com/sw.js
var CACHE_NAME = 'v2ex-cache-v1';
var urlsToCache = [
'/static/fonts/PressStart2P-Regular.ttf'
];
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(CACHE_NAME).then(cache => cache.addAll(urlsToCache))
);
});
self.addEventListener('fetch', () => {});
The service worker does nothing. It won't break the website.
Interesting. I have little knowledge on what service workers do or how they are implemented, so this is good to know.
And don't force landscape orientation in manifest.