serviceworker.skipWaiting
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 3.6k
- Forks
- 324
- Avg merge
- 14d 22h
- Merged PRs (30d)
- 1
Description
Allowing:
const reg = await navigator.serviceWorker.ready;
if (reg.waiting) {
await reg.waiting.skipWaiting();
location.reload();
}
Usecase: The new service worker has installed, I've shown a message to the user like "New version found. Update now?", which they have clicked.
Currently developers have to postMessage to the service worker for this behaviour.
It's also an opportunity for us to rethink when skipWaiting should resolve in this case. It could resolve once the service worker has begun activating.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the service worker API sequence in the issue and compare it with the current postMessage workaround. Determine the intended activation and resolution semantics for waiting.skipWaiting(), then document the agreed behavior and any required specification changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100