57 lines
2.9 KiB
YAML
57 lines
2.9 KiB
YAML
groups:
|
|
- id: browser
|
|
prefix: browser
|
|
type: resource
|
|
brief: >
|
|
The web browser in which the application represented by the resource is running.
|
|
The `browser.*` attributes MUST be used only for resources that represent applications
|
|
running in a web browser (regardless of whether running on a mobile or desktop device).
|
|
attributes:
|
|
- id: brands
|
|
type: string[]
|
|
brief: 'Array of brand name and version separated by a space'
|
|
note: >
|
|
This value is intended to be taken from the
|
|
[UA client hints API](https://wicg.github.io/ua-client-hints/#interface)
|
|
(`navigator.userAgentData.brands`).
|
|
examples: [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
|
- id: platform
|
|
type: string
|
|
brief: 'The platform on which the browser is running'
|
|
note: >
|
|
This value is intended to be taken from the
|
|
[UA client hints API](https://wicg.github.io/ua-client-hints/#interface)
|
|
(`navigator.userAgentData.platform`). If unavailable, the legacy
|
|
`navigator.platform` API SHOULD NOT be used instead and this attribute
|
|
SHOULD be left unset in order for the values to be consistent.
|
|
|
|
The list of possible values is defined in the
|
|
[W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
|
|
Note that some (but not all) of these values can overlap with values
|
|
in the [`os.type` and `os.name` attributes](./os.md).
|
|
However, for consistency, the values in the `browser.platform` attribute
|
|
should capture the exact value that the user agent provides.
|
|
examples: ['Windows', 'macOS', 'Android']
|
|
- id: mobile
|
|
type: boolean
|
|
brief: 'A boolean that is true if the browser is running on a mobile device'
|
|
note: >
|
|
This value is intended to be taken from the
|
|
[UA client hints API](https://wicg.github.io/ua-client-hints/#interface)
|
|
(`navigator.userAgentData.mobile`). If unavailable, this attribute
|
|
SHOULD be left unset.
|
|
- id: language
|
|
type: string
|
|
brief: 'Preferred language of the user using the browser'
|
|
note: >
|
|
This value is intended to be taken from the Navigator API
|
|
`navigator.language`.
|
|
examples: ["en", "en-US", "fr", "fr-FR"]
|
|
- ref: user_agent.original
|
|
brief: 'Full user-agent string provided by the browser'
|
|
note: >
|
|
The user-agent value SHOULD be provided only from browsers that do not have a mechanism
|
|
to retrieve brands and platform individually from the User-Agent Client Hints API.
|
|
To retrieve the value, the legacy `navigator.userAgent` API can be used.
|
|
examples: ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36']
|