Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created October 4, 2018 23:30
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/c56eac3a267e2c7a0049303681914add to your computer and use it in GitHub Desktop.
Save goofmint/c56eac3a267e2c7a0049303681914add to your computer and use it in GitHub Desktop.
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Service Worker登録完了
}, /*catch*/ function(error) {
// Service Worker登録失敗
});
} else {
// Service Workerをサポートしていない
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment