Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Jun 19, 2018
Embed
What would you like to do?
self.addEventListener('install', e => {
// インストール時に実行
e.waitUntil(
caches.open('mismith').then(cache => {
return cache.addAll([
'/',
'/client.js',
'/style.css',
'/ok.svg', // オンライン用
'/fail.svg' // オフライン用
])
.then(() => self.skipWaiting());
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment