-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Description
I’d like to suggest implementing navigator.userAgentData as a built-in global API.
This would help bring better support for web-standard APIs and improve feature parity between browser and runtime environments. It's especially useful in universal (isomorphic) codebases where one shouldn't have to rely on environment-specific globals like process, or check for the presence of Deno or Bun in globalThis.
Having navigator.userAgentData built in would provide a clean and consistent way to detect key runtime details such as:
- the brand (e.g. Deno, Bun, Node)
- the version of the runtime
- the platform (e.g. macOS, Windows, Linux, etc.)
This would be highly useful in scenarios where server-side code needs to branch based on the environment but still adhere to web platform standards. It removes the need for runtime-specific APIs like process.version or string parsing from user agent headers.
Please consider supporting this as a native part of the runtime.