Created
February 27, 2019 19:10
-
-
Save webmaxru/b57d1247826848dc0853b2bba20d2bd6 to your computer and use it in GitHub Desktop.
Workbox 4: workbox-window. Adding BroadcastChannel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const updateChannel = new BroadcastChannel('precache-channel'); | |
updateChannel.addEventListener('message', event => { | |
if (confirm(`New content is available!. Click OK to refresh`)) { | |
window.location.reload(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment