Skip to content

Make serviceWorker an optional attribute of Navigator and WorkerNavigator #1527

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

Closed
stavros-tsioulis opened this issue Apr 21, 2025 · 2 comments

Comments

@stavros-tsioulis
Copy link

There are secure contexts where serviceWorker does not exist as a property of navigator, such as Firefox's private mode and IABs on apps like Messenger.

MDN also confirms this:
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/serviceWorker.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/serviceWorker

@tidoust
Copy link
Member

tidoust commented Apr 22, 2025

Webref merely collects the Web IDL as it is defined in underyling specs. Could you raise this issue in the w3c/ServiceWorker repository where the spec is being developed?

I note that, in general, the concepts of private/incognito mode, in app browsing, and WebViews, are not defined in specs for now, and may mean different things to different browser vendors. Specs don't usually attempt to account for these contexts as a result, except in privacy/security considerations. For WebViews, the WebView Community Group is currently exploring that space with a view to hopefully and eventually converging on a common definition.

In practice, implementers may choose to support an API in all contexts, only in some contexts, or nowhere at all, which de facto makes most APIs that hook into navigator optional already. The Service Workers API is not the only one in that case.

I'm closing this issue in Webref as out of scope for the project itself.

@tidoust tidoust closed this as completed Apr 22, 2025
@stavros-tsioulis
Copy link
Author

Thanks a lot for the reply. I don't think it's wise to delve further into it, given there are ongoing efforts into coming to an agreement on how implementers respect the spec, and how the spec can adjust to their needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants