Manifest and SW

{
“name”: “RayBOT Chat”,
“short_name”: “RayBOT”,
“start_url”: “./”,
“display”: “standalone”,
“background_color”: “#ffffff”,
“theme_color”: “#ffffff”,
“icons”: [
{
“src”: “icon.png”,
“sizes”: “192×192”,
“type”: “image/png”
}
]
}

Also SW

const cacheName = ‘raybot-cache-v1’;
const assets = [‘/’, ‘/index.html’, ‘/manifest.json’, ‘/icon.png’];

self.addEventListener(‘install’, event => {
event.waitUntil(caches.open(cacheName).then(cache => cache.addAll(assets))); });

self.addEventListener(‘fetch’, event => {
event.respondWith(
caches.match(event.request).then(response => response || fetch(event.request)) );
});

Leave a comment