what should fetch() do if request's window has been destroyed or stopped?
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2.3k
- Forks
- 403
- Avg merge
- 21h 16m
- Merged PRs (30d)
- 4
Description
The fetch spec currently associates the current client or window with a request object. This is important for allowing fetch(event.request) in service workers to work when the request requires mixed content or client certificate dialogs. These requests need UX interaction to work properly.
There is a race, however. Between the time the request is created and when the fetch() uses the window property, the original window can:
- Be closed or otherwise destroyed.
- Have its stop button pressed.
It seems the spec should handle (1) by checking if the window is closed before permitting mixed content and client certificates.
For (2), I have more questions...
In gecko we treat pressing the stop button as cancelling all document related network requests. By associating the window with the request, we could also cancel fetch(event.request) when the original window is stopped (or closed). Should we?
On the one hand, it seems to reflect the wishes of the user. On the other hand, the service worker may want to do event.waitUntil(cache.add(event.request)) with the intention of caching it in the background.
Thoughts?
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 by reviewing the Fetch Standard's request client or window association and the discussion in this issue about destroyed windows and stopped documents. The issue is done when the specification has a decided, explicit behavior for closed windows and for fetch(event.request) after the source window is stopped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- api, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100