-
Notifications
You must be signed in to change notification settings - Fork 13
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
Navigator APIs #61
Comments
If you look at https://developer.mozilla.org/en-US/docs/Web/API/Navigator, there are many more things available on |
These methods are not present at the WorkerNavigator, which is the navigator object in web worker contexts. The So I would avoid expanding the common-minimum-api to be the full set of |
Oh sure, I wasn’t suggesting we include all those APIs in the common minimum. Just that we should perhaps rename this from “attributes” to some thing like “Navigator APIs” because some of the keys on |
Sure, thanks for the suggestion! |
I think there's enough consensus among the runtimes that we should add at least some of these. I will say that workers is likely unable to ever add |
Node, Deno and Bun all implement the following (reference 1, reference 2):
Node and Deno additionally implement:
Likewise I think |
Note that Deno Deploy supports |
Definitely. Just running in the cloud, these aren't useful (or would be strange to use), but many runtimes, at least the ones most seem to refer to, are equally at home running locally for tooling. I don't think there is an abundance of people using edge-runtime or cloudflare workers to run cli tools, but Bun and Deno do get some use, and of course, Deno. And then there is also doing a runtime emulation of browser environments. Though, I think that case could more likely be simply polyfilled. |
Would not simply providing them with "dummy" results be valuable? Or would it be better to not have them at all to make feature detection easier? I guess I'd be torn between whether easy feature detection is better than being interface compliant (even if functionally incorrect) |
There are lots of APIs defined on the Navigator object. For now, the common minimum API merely defines
navigator.userAgent
as part of the common APIs that WinterCG runtimes are interested in implementing.However, it is being proposed to add more properties to
Navigator
in Node.js for usefulness (e.g.Navigator.hardwareConcurrency
) and legacy compatibility (e.g. constantNavigator.appVersion
version)Current implementation status:
Navigator.userAgent
Navigator.hardwareConcurrency
Navigator.platform
Navigator.language
Navigator.languages
Navigator.onLine
Navigator.userAgent
andNavigator.platform
)I believe the common APIs of
Navigator
should be extended to include attributes that were shipped in more than two runtimes. Also, if there are strong push-backs on adding the above APIs to the common minimum API, we should be wary of shipping them to reduce the gaps between the runtimes.The text was updated successfully, but these errors were encountered: