-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(http): Add pages for Service Workers #37230
Conversation
Preview URLs
Flaws (2)Note! 3 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
External URLs (1)URL:
(comment last updated: 2024-12-19 23:06:42) |
## Directives | ||
|
||
- `<scope>` | ||
- : A string representing a URL that defines a service worker's registration scope; that is, what range of URLs a service worker can control. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true, but perhaps we should capture that it is the top level directory?
- : A string representing a URL that defines a service worker's registration scope; that is, what range of URLs a service worker can control. | |
- : A string representing a URL that defines a service worker's registration scope; that is, a URL that defines the root path of the range of URLs that a service worker can control. |
## Directives | ||
|
||
- `<scope>` | ||
- : A string representing a URL that defines a service worker's registration scope; that is, what range of URLs a service worker can control. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, what counts as a valid URL? Relative URLs? Absolute URLs? What if there are query parameters? What if this is a file? Is it relative to the site root?
Usually these kinds of headers take either absolute or relative URLs (to site root), and query parameters are stripped along with any credentials and file names. But sometimes the rules are different, so we should say.
<td>{{Glossary("Response header")}}</td> | ||
</tr> | ||
<tr> | ||
<th scope="row">{{Glossary("Forbidden header name")}}</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name for requests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, we might want to discuss whether we want this table row on response headers at all, seeing as it's always No
except for Set-Cookie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anyone else agree that we should move the Forbidden XYZ lists from the the glossary into the HTTP documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, great idea, I think it might be time to do that
- {{HTTPHeader("Service-Worker")}} | ||
- : Included in fetches for a service worker's script resource. | ||
This header helps administrators log service worker script requests for monitoring purposes. | ||
- {{HTTPHeader("Service-Worker-Allowed")}} | ||
- : Used to remove the [path restriction](/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#why_is_my_service_worker_failing_to_register) by including this header [in the response of the Service Worker script](https://w3c.github.io/ServiceWorker/#service-worker-script-response). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this description to, in particular, remove the spec link. Should be something along the lines of "Use allow a service worker to be registered to a broader scope that allowed by its URL location ..."
files/en-us/web/api/service_worker_api/using_service_workers/index.md
Outdated
Show resolved
Hide resolved
- In Firefox, Service Worker APIs are hidden and cannot be used when the user is in [private browsing mode](https://bugzil.la/1320796), or when history is disabled, or if cookies are cleared when Firefox is closed. | ||
- In Chrome, registration fails when the "Block all cookies (not recommended)" option is enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this into BCD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see f6de952
Co-authored-by: Hamish Willee <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
files/en-us/web/api/service_worker_api/using_service_workers/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/service_worker_api/using_service_workers/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/service_worker_api/using_service_workers/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/service_worker_api/using_service_workers/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/service_worker_api/using_service_workers/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/service_worker_api/using_service_workers/index.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I did some minor nit fixes (which I hope are OK) and merging. Hurrah
* docs(http): service-worker-allowed header * feat(http): Add pages for Service Workers * Apply suggestions from code review Co-authored-by: Hamish Willee <[email protected]> * Update files/en-us/web/http/headers/service-worker/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore(http): reword common pitfalls for service worker registration failures * Apply suggestions from code review --------- Co-authored-by: Hamish Willee <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
Additions:
Changes:
register()
SW page for clarityRelated issues and pull requests
Fixes #34854