Skip to content

Commit

Permalink
serv work
Browse files Browse the repository at this point in the history
  • Loading branch information
vvsviridov committed Apr 18, 2021
1 parent c7a262d commit 9b98a82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function pageInit() {
async function initServiceWorker() {
if ('serviceWorker' in navigator) {
try {
const reg = await navigator.serviceWorker.register('/assets/serviceworker.js')
const reg = await navigator.serviceWorker.register('/serviceworker.js')
console.log('Service worker register success', reg)
} catch (e) {
console.error('Service worker register fail')
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"display": "standalone",
"orientation": "portrait",
"scope": "/",
"start_url": "/",
"start_url": ".",
"icons": [
{
"src": "/assets/icon-192x192.png",
Expand Down
14 changes: 7 additions & 7 deletions assets/serviceworker.js → serviceworker.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const staticCacheName = 's-streamio-v1'

const assetUrls = [
'../index.html',
'script.js',
'style.css',
'icon-192x192.png',
'icon-256x256.png',
'icon-384x384.png',
'icon-512x512.png'
'index.html',
'/assets/script.js',
'/assets/style.css',
'/assets/icon-192x192.png',
'/assets/icon-256x256.png',
'/assets/icon-384x384.png',
'/assets/icon-512x512.png'
]

self.addEventListener('install', async event => {
Expand Down

0 comments on commit 9b98a82

Please sign in to comment.