Skip to content

Commit

Permalink
Issue WICG#196 - On second thought, let's call it Sec-CH-UA-Full-Vers…
Browse files Browse the repository at this point in the history
…ion-List
  • Loading branch information
miketaylr committed Sep 9, 2021
1 parent ac95343 commit 48232f2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ a corresponding JavaScript API:
* `Sec-CH-UA-Platform`
* `Sec-CH-UA-Platform-Version`
* `Sec-CH-UA`
* `Sec-CH-UA-Full-Version` (deprecated in favor of `Sec-CH-UA-Version-List`)
* `Sec-CH-UA-Version-List`
* `Sec-CH-UA-Full-Version` (deprecated in favor of `Sec-CH-UA-Full-Version-List`)
* `Sec-CH-UA-Full-Version-List`


## Contributing
Expand Down Expand Up @@ -221,7 +221,7 @@ accomplish this as follows:
```

Advisement: `Sec-CH-UA-Full-Version` is deprecated and will be removed in the future.
Developers should use `Sec-CH-UA-Version-List` instead.
Developers should use `Sec-CH-UA-Full-Version-List` instead.

1. The `Sec-CH-UA-Platform` header field represents the platform's brand and major version. For
example:
Expand All @@ -230,11 +230,11 @@ accomplish this as follows:
Sec-CH-UA-Platform: "Windows"
```

1. The `Sec-CH-UA-Version-List` header field represents the full version for each brand in its
1. The `Sec-CH-UA-Full-Version-List` header field represents the full version for each brand in its
brand list. For example:

```http
Sec-CH-UA-Version-List: "Microsoft Edge"; v="92.0.902.73", "Chromium"; v="92.0.4515.131", "?Not:Your Browser"; v="3.1.2.0"
Sec-CH-UA-Full-Version-List: "Microsoft Edge"; v="92.0.902.73", "Chromium"; v="92.0.4515.131", "?Not:Your Browser"; v="3.1.2.0"
```

4. These client hints should also be exposed via JavaScript APIs via a new
Expand All @@ -252,19 +252,19 @@ accomplish this as follows:
boolean mobile; // true
DOMString architecture; // "arm"
DOMString bitness; // "64"
FrozenArray<NavigatorUABrandVersion> fullVersionList; // [ {brand: "Google Chrome", version: "84.0.4147.0"}, {brand: "Chromium", version: "84.0.4147"} ]
DOMString model; // "X644GTM"
DOMString platform; // "PhoneOS"
DOMString platformVersion; // "10A"
DOMString uaFullVersion; // deprecated in favor of versionList
FrozenArray<NavigatorUABrandVersion> versionList; // [ {brand: "Google Chrome", version: "84.0.4147.0"}, {brand: "Chromium", version: "84.0.4147"} ]
DOMString uaFullVersion; // deprecated in favor of fullVersionList
};
[Exposed=(Window,Worker)]
interface NavigatorUAData {
readonly attribute FrozenArray<NavigatorUABrandVersion> brands; // [ {brand: "Google Chrome", version: "84"}, {brand: "Chromium", version: "84"} ]
readonly attribute boolean mobile; // false
readonly attribute platform; // "PhoneOS"
Promise<UADataValues> getHighEntropyValues(sequence<DOMString> hints); // { architecture: "arm", bitness: "64", model: "X644GTM", platform: "PhoneOS", platformVersion: "10A", versionList: [ {brand: "Google Chrome", version: "84.1.2.3"}, {brand: "Chromium", version: "84.1.2.3"}, {brand: "Not A;Brand", version: "101.3.2.9"} ] }
Promise<UADataValues> getHighEntropyValues(sequence<DOMString> hints); // { architecture: "arm", bitness: "64", model: "X644GTM", platform: "PhoneOS", platformVersion: "10A", fullVersionList: [ {brand: "Google Chrome", version: "84.1.2.3"}, {brand: "Chromium", version: "84.1.2.3"}, {brand: "Not A;Brand", version: "101.3.2.9"} ] }
};
interface mixin NavigatorUA {
Expand Down Expand Up @@ -306,7 +306,7 @@ Sec-CH-UA-Platform: “Windows”
If a server delivers the following response header:

```http
Accept-CH: Sec-CH-UA-Version-List, Sec-CH-UA-Arch
Accept-CH: Sec-CH-UA-Full-Version-List, Sec-CH-UA-Arch
```

Then subsequent requests to `https://example.com` will include the following request headers:
Expand All @@ -317,7 +317,7 @@ User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
Sec-CH-UA: "Chrome"; v="74", ";Not)Your=Browser"; v="13"
Sec-CH-UA-Mobile: ?0
Sec-CH-UA-Platform: "Windows"
Sec-CH-UA-Version-List: "Chrome"; v="74.0.3729.0", "Chromium"; v="74.0.3729.0", "?Not:Your Browser"; v="13.0.1.0"
Sec-CH-UA-Full-Version-List: "Chrome"; v="74.0.3729.0", "Chromium"; v="74.0.3729.0", "?Not:Your Browser"; v="13.0.1.0"
Sec-CH-UA-Arch: "arm"
```

Expand All @@ -335,12 +335,12 @@ Sec-CH-UA-Mobile: ?0
Sec-CH-UA-Platform: “Windows”
```

The server responds that the `Sec-CH-UA-Version-List` is required on first-request in order to
The server responds that the `Sec-CH-UA-Full-Version-List` is required on first-request in order to
deliver some optimized resource, for example:

```http
Accept-CH: Sec-CH-UA-Version-List
Critical-CH: Sec-CH-UA-Version-List
Accept-CH: Sec-CH-UA-Full-Version-List
Critical-CH: Sec-CH-UA-Full-Version-List
```

The client then retries the initial request with the requested hints:
Expand All @@ -351,7 +351,7 @@ User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
Sec-CH-UA: "Chrome"; v="74", ";Not)Your=Browser"; v="13"
Sec-CH-UA-Mobile: ?0
Sec-CH-UA-Platform: “Windows”
Sec-CH-UA-Version-List: "Chrome"; v="74.0.3729.0", "Chromium"; v="74.0.3729.0", "?Not:Your Browser"; v="13.0.1.0"
Sec-CH-UA-Full-Version-List: "Chrome"; v="74.0.3729.0", "Chromium"; v="74.0.3729.0", "?Not:Your Browser"; v="13.0.1.0"
```

The user agent can make reasonable decisions about when to honor requests for detailed user agent
Expand Down
28 changes: 14 additions & 14 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ The 'Sec-CH-UA-Full-Version' Header Field {#sec-ch-ua-full-version}
--------------------------------

Advisement: `Sec-CH-UA-Full-Version` is deprecated and will be removed in the future. Developers
should use <a href="#sec-ch-ua-version-list">`Sec-CH-UA-Version-List`</a> instead.
should use <a href="#sec-ch-ua-full-version-list">`Sec-CH-UA-Full-Version-List`</a> instead.

The <dfn http-header>`Sec-CH-UA-Full-Version`</dfn> request header field gives a server information
about the user agent's [=user agent/full version=]. It is a [=Structured Header=]
Expand Down Expand Up @@ -652,20 +652,20 @@ The header's ABNF is:
Sec-CH-UA-Platform-Version = sf-string
```

The 'Sec-CH-UA-Version-List' Header Field {#sec-ch-ua-version-list}
The 'Sec-CH-UA-Full-Version-List' Header Field {#sec-ch-ua-full-version-list}
--------------------------------

The <dfn http-header>`Sec-CH-UA-Version-List`</dfn> request header field gives a server information
about the [=user agent/full version=] for each brand in its [=brands=] list. It is a
The <dfn http-header>`Sec-CH-UA-Full-Version-List`</dfn> request header field gives a server
information about the [=user agent/full version=] for each brand in its [=brands=] list. It is a
[=Structured Header=] whose value MUST be a [=structured header/list=] [[!RFC8941]].

The header's ABNF is:

``` abnf
Sec-CH-UA-Version-List = sf-list
Sec-CH-UA-Full-Version-List = sf-list
```

To <dfn abstract-op>return the `Sec-CH-UA-Version-List` value for a request</dfn>, perform the
To <dfn abstract-op>return the `Sec-CH-UA-Full-Version-List` value for a request</dfn>, perform the
following steps:

1. Let |version type| be the type [=user agent/full version=].
Expand All @@ -677,7 +677,7 @@ following steps:

Note: These client hints can be evoked with the following set of [=client hints tokens=]:
`Sec-CH-UA`, `Sec-CH-UA-Arch`, `Sec-CH-UA-Bitness`, `Sec-CH-UA-Full-Version`, `Sec-CH-UA-Mobile`,
`Sec-CH-UA-Model`, `Sec-CH-UA-Platform`, `Sec-CH-UA-Platform-Version`, `Sec-CH-UA-Version-List`
`Sec-CH-UA-Model`, `Sec-CH-UA-Platform`, `Sec-CH-UA-Platform-Version`, `Sec-CH-UA-Full-Version-List`

Interface {#interface}
=================
Expand All @@ -696,8 +696,8 @@ dictionary UADataValues {
DOMString model;
DOMString platform;
DOMString platformVersion;
DOMString uaFullVersion; // deprecated in favor of versionList
FrozenArray&lt;NavigatorUABrandVersion&gt; versionList;
DOMString uaFullVersion; // deprecated in favor of fullVersionList
FrozenArray&lt;NavigatorUABrandVersion&gt; fullVersionList;
};

dictionary UALowEntropyJSON {
Expand Down Expand Up @@ -866,7 +866,7 @@ ISSUE(wicg/ua-client-hints): We can improve upon when and why a UA decides to re
to the [=user agent=]'s [=user agent/platform version=].
1. If |hints| [=list/contains=] "uaFullVersion", set |uaData|["{{UADataValues/uaFullVersion}}"]
to the user agent's [=user agent/full version=].
1. If |hints| [=list/contains=] "versionList", set |uaData|["{{UADataValues/versionList}}"]
1. If |hints| [=list/contains=] "fullVersionList", set |uaData|["{{UADataValues/fullVersionList}}"]
to [=this=]'s [=relevant global object=]'s
[=WindowOrWorkerGlobalScope/version list frozen array=].
1. [=Queue a task=] on the [=permission task source=] to [=resolve=] |p| with |uaData|.
Expand Down Expand Up @@ -1009,7 +1009,7 @@ IANA Considerations {#iana}

This document intends to define the `Sec-CH-UA`, `Sec-CH-UA-Arch`, `Sec-CH-UA-Bitness`,
`Sec-CH-UA-Full-Version`, `Sec-CH-UA-Mobile`, `Sec-CH-UA-Model`, `Sec-CH-UA-Platform`,
`Sec-CH-UA-Platform-Version`, and the `Sec-CH-UA-Version-List` HTTP request header fields, and
`Sec-CH-UA-Platform-Version`, and the `Sec-CH-UA-Full-Version-List` HTTP request header fields, and
register them in the permanent message header field registry ([[RFC3864]]).

It also intends to deprecate usage of the `User-Agent` header field.
Expand Down Expand Up @@ -1118,18 +1118,18 @@ Author/Change controller: IETF

Specification document: this specification ([[#sec-ch-ua-platform-version]])

'Sec-CH-UA-Version-List' Header Field {#iana-version-list}
'Sec-CH-UA-Full-Version-List' Header Field {#iana-full-version-list}
-------------------------

Header field name: Sec-CH-UA-Version-List
Header field name: Sec-CH-UA-Full-Version-List

Applicable protocol: http

Status: standard

Author/Change controller: IETF

Specification document: this specification ([[#sec-ch-ua-version-list]])
Specification document: this specification ([[#sec-ch-ua-full-version-list]])

'User-Agent' Header Field {#iana-user-agent}
-------------------------
Expand Down

0 comments on commit 48232f2

Please sign in to comment.