Fix caches.AddAll that is not origin-relative
Summary
Fixes #19665 by saying it is document-and-service-worker-relative, not origin-relative.
Motivation
It's incorrect, and newbies to service workers may not realize this.
Supporting details
Issue #19665.
Related issues
Fixes #19665
Metadata
- [ ] Adds a new document
- [ ] Rewrites (or significantly expands) a document
- [x] Fixes a typo, bug, or other error
Preview URLs
Flaws
None! 🎉
External URLs
URL: /en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
Title: Using Service Workers
on GitHub
No new external URLs
(this comment was updated 2022-09-03 03:09:13.046095)
Thank you for your PR, @softorangetech200 !
In #19665 (comment), @noamr suggests that we should also update:
- https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll
- https://developer.mozilla.org/en-US/docs/Web/API/Cache/add
- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers
...with this detail. Do you think you could add these to your PR? Thank you!
I'll ask @noamr about what to add. Thanks.
Thank you for your PR, @softorangetech200 ! In #19665 (comment), @noamr suggests that we should also update:
- https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll
- https://developer.mozilla.org/en-US/docs/Web/API/Cache/add
- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers
...with this detail. Do you think you could add these to your PR? Thank you!
I'll ask @noamr about what to add. Thanks.
Yes, I think we need to add them in all the above. Also in Request.
Note that the URL can also be relative to a regular worker script, not just a service worker.
Perhaps (thinking out loud) the right way to wording would be that those functions receive URLs or requests - basically anything that could be an input to the Request constructor, and in that constructor mention that the URLs are relative to the base URL, which is the document URL or the worker's location.
Thank you for your PR, @softorangetech200 ! In #19665 (comment), @noamr suggests that we should also update:
- https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll
- https://developer.mozilla.org/en-US/docs/Web/API/Cache/add
- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers
...with this detail. Do you think you could add these to your PR? Thank you!
I'll ask @noamr about what to add. Thanks.
Yes, I think we need to add them in all the above. Also in Request.
Note that the URL can also be relative to a regular worker script, not just a service worker.
Perhaps (thinking out loud) the right way to wording would be that those functions receive URLs or requests - basically anything that could be an
inputto the Request constructor, and in that constructor mention that the URLs are relative to the base URL, which is the document URL or the worker's location.
I'll push all changes later. Thanks!
@softorangetech1122 , are you intending to come back to this PR? Otherwise I will have a go at finishing it off myself. Thanks!
@softorangetech1122, this is still waiting in your response to https://github.com/mdn/content/pull/19955#issuecomment-1287544579
This pull request has merge conflicts that must be resolved before it can be merged.
@wbamberg I went ahead and closed this one for lack of response. https://github.com/mdn/content/pull/19955/files still has the patch (such as it is). No further commits were ever pushed to the PR branch in response to the review comments.