Skip to content

Commit 4a74678

Browse files
authored
Formatting
1 parent 97b6fba commit 4a74678

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

Diff for: proposals/manifest_trial_tokens.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ into all contexts with the extension's origin.
2929

3030
#### Use Cases
3131

32-
Greater availability and beter ergonomics of Origin and Deprecation tokens.
32+
Greater availability and better ergonomics of Origin and Deprecation tokens.
3333

3434
##### Participation in Origin and Deprecation Trials for Open Web APIs
3535

@@ -41,15 +41,15 @@ legacy behaviors and deprecated APIs.
4141
##### Creation of Origin and Deprecation Trials for WebExtension APIs
4242

4343
As of writing, WebExtension system does not have a convenient way of shipping
44-
changes to WebExtension APIs. In leu of Origin Trials framework browsers resort
44+
changes to WebExtension APIs. In lieu of Origin Trials framework browsers resort
4545
to workarounds (or their combination):
46-
- make the change backwards-compatiable, if possible, with perpetually
46+
- make the change backwards-compatible, if possible, with perpetually
4747
deprecated legacy behavior. This keeps around deprecated code paths and
48-
behaviors indefinitelly. This could be resolved via deprecation trials.
49-
- launch an enirely different API under a new name, keeping around the old
50-
code paths and behaviors indefinitelly.
48+
behaviors indefinitely. This could be resolved via deprecation trials.
49+
- launch an entirely different API under a new name, keeping around the old
50+
code paths and behaviors indefinitely.
5151
- launch a change to pre-release Canary/Nightly and Beta channels and
52-
and ask for developer feedback prior to launch to Stable. Some issues slip
52+
ask for developer feedback prior to launch to Stable. Some issues slip
5353
through this testing and get fossilized in the final API. This could be
5454
resolved via origin trails.
5555
- limit the change via allow- and block-lists specified at in browser source
@@ -93,33 +93,33 @@ Upon manifest parsing, browser should parse `trial_tokens` like so:
9393
warnings
9494
- browsers can limit the total number of parsed and/or accepted tokens
9595
- browsers can limit the length of each token
96-
- browsers can limit the the total length of all parsed and/or accepted tokens
96+
- browsers can limit the total length of all parsed and/or accepted tokens
9797
- browsers can validate token structure, content, and signature at parse time;
98-
in particular, tokens should not contain conrol characters like new lines
99-
and charaxter returns which could affect HTTP header serealization and
98+
in particular, tokens should not contain control characters like new lines
99+
and charaxter returns which could affect HTTP header serialization and
100100
parsing
101101

102102
#### Manifest parsing algorithm
103103
1. if `trial_tokens` is not present, return
104104
2. if `trial_tokens` is not an array or if `trial_tokens` is an empty array,
105105
(optionally) log a benign warning and return
106106
3. for every element `token` of `trial_tokens`:
107-
3.1. (optionally) if the maximum number of accepted tokens is reached,
108-
skip all other tokens
109-
3.2. if `token` is not a string, skip it and (optionally) log a benign
110-
warning
111-
3.2. if `token` is an empty string, skip it and (optionally) log a benign
112-
warning
113-
3.3. (optionally) if `token` is too long to be parsed, skip it and
114-
(optionally) log a benign warning
115-
3.4. if token has been encountered before, skip it and (optionally) log
116-
a benign warning
117-
3.5. (optionally) attempt to parse the token and validate it. If validation
118-
fails, skip the token and (optionally) log a benign warning.
119-
Note: browsers may disregard token expiration errors, if they are not
120-
sure about the corrctness of system timestamp at the time of token
121-
validation
122-
3.6. append token to the collection of accepted tokens
107+
1. (optionally) if the maximum number of accepted tokens is reached,
108+
skip all other tokens
109+
2. if `token` is not a string, skip it and (optionally) log a benign
110+
warning
111+
3. if `token` is an empty string, skip it and (optionally) log a benign
112+
warning
113+
4. (optionally) if `token` is too long to be parsed, skip it and
114+
(optionally) log a benign warning
115+
5. if token has been encountered before, skip it and (optionally) log
116+
a benign warning
117+
6. (optionally) attempt to parse the token and validate it. If validation
118+
fails, skip the token and (optionally) log a benign warning.
119+
Note: browsers may disregard token expiration errors if they are not
120+
sure about the correctness of system timestamp at the time of token
121+
validation
122+
7. append token to the collection of accepted tokens
123123
4. if at least one token is accepted in step 3, save the token collection in
124124
parsed manifest under `trial_tokens` key
125125

@@ -153,10 +153,10 @@ Trial tokens system already incorporate some degree of abuse mitigations:
153153

154154
This new manifest key contains values which will be inserted into headers of
155155
local HTTP-like responses. Browsers must ensure that the provided tokens can
156-
not escape header serealization. Browsers also must ensure that tokens do not
156+
not escape header serialization. Browsers also must ensure that tokens do not
157157
cause headers to exceed implementation-specific limits so that response is
158-
processed in different way (e.g., adding a large number of tokens must not
159-
cuase removal of security headers like CSP).
158+
processed in different way (e.g., a large number of long tokens must not
159+
cuase removal of other headers or response content).
160160

161161
## Alternatives
162162

@@ -167,7 +167,7 @@ cuase removal of security headers like CSP).
167167
Document contexts can activate tokens by
168168
[embedding them in DOM](<meta http-equiv="origin-trial" content="TOKEN_GOES_HERE">)
169169
`<meta>` tag, both statically and dynamically. Extension service workers can
170-
spawn documents and with embedded tokens and proxy calls to trial features via
170+
spawn documents and embedded tokens and proxy calls to trial features via
171171
the said document.
172172

173173
## Implementation Notes

0 commit comments

Comments
 (0)