Created by: richarddd
This enables users to tell the service worker to skip waiting.
Example:
serviceWorker.register({
...
onWaiting((waitingWorker) => {
waitingWorker.postMessage({ type: "SKIP_WAITING" })
window.location.reload();
})
...
});
This PR also adds check if multiple service workers are registered so only the correct one triggers the callbacks we pass to serviceWorker.register
Activity
requested review from @root
requested review from @root
requested review from @root
requested review from @root
Created by: facebook-github-bot
Hi richarddd! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!
added CLA Signed label
added stale label