Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created June 19, 2018 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/75a0d71b8024b5944a1a2043ede04715 to your computer and use it in GitHub Desktop.
Save goofmint/75a0d71b8024b5944a1a2043ede04715 to your computer and use it in GitHub Desktop.
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