Skip to content

Commit

Permalink
Fix clients.claim() and skipWaiting() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
humphd committed Apr 3, 2019
1 parent efad0a6 commit 47b93cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/nohost-sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/nohost-sw.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/nohost-sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const config = (function(location) {
importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.1.1/workbox-sw.js');

workbox.setConfig({
debug: config.debug,
skipWaiting: true,
clientsClaim: true,
directoryIndex: config.directoryIndex
debug: config.debug
});

addEventListener('install', () => self.skipWaiting());
addEventListener('activate', () => self.clients.claim());

// This will trigger the importScripts() for workbox.strategies and its dependencies
// See workaround in https://developers.google.com/web/tools/workbox/modules/workbox-sw#avoid_async_imports
workbox.loadModule('workbox-strategies');
Expand Down

0 comments on commit 47b93cb

Please sign in to comment.