Skip to content

Commit 4eb1c56

Browse files
committed
Add WebDriver BiDi network request logging
1 parent 086e35f commit 4eb1c56

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

fetch.bs

+39
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262
110110
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https",
111111
"publisher": "IETF",
112112
"title": "Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs)"
113+
},
114+
"WEBDRIVER-BIDI": {
115+
"authors": [],
116+
"href": "https://w3c.github.io/webdriver-bidi/",
117+
"publisher": "W3C",
118+
"title": "WebDriver BiDi"
113119
}
114120
}
115121
</pre>
@@ -2123,6 +2129,11 @@ Unless stated otherwise, it is false.
21232129

21242130
<p class=note>This is for exclusive use by HTML's navigate algorithm. [[!HTML]]
21252131

2132+
<p>A <a for=/>request</a> has an associated <dfn export for=request>navigation id</dfn>.
2133+
Unless stated otherwise, it is null.
2134+
2135+
<p class=note>This is for exclusive use by HTML's navigate algorithm. [[!HTML]]
2136+
21262137
<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>render-blocking</dfn>.
21272138
Unless stated otherwise, it is false.
21282139

@@ -2164,6 +2175,13 @@ otherwise, it is unset.
21642175
<a for=request>done flag</a>, and <a for=request>timing allow failed flag</a> are used as
21652176
bookkeeping details by the <a for=/>fetch</a> algorithm.
21662177

2178+
<p>A <a for=/>request</a> has an associated
2179+
<dfn export for=request id=concept-request-id>request id</dfn> which is a unique
2180+
string automatically set when the <a for=/>request</a> is created.
2181+
2182+
Note: the [=request id=] is used by WebDriver-BiDi. When a request is [=request/cloned=],
2183+
the created request gets a unique [=request id=]. [[!WEBDRIVER-BIDI]]
2184+
21672185
<hr>
21682186

21692187
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
@@ -4779,6 +4797,11 @@ steps:
47794797
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
47804798
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
47814799
<var>bodyInfo</var>, and <var>responseStatus</var>.
4800+
4801+
<li><p>If <var>response</var> is a <a>network error</a>, run
4802+
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
4803+
run the <a>WebDriver BiDi response completed</a> steps with
4804+
<var>request</var> and <var>response</var>.
47824805
</ol>
47834806

47844807
<li>
@@ -5129,6 +5152,13 @@ these steps:
51295152
<a>filtered response</a>; otherwise to <var>response</var>'s
51305153
<a for="filtered response">internal response</a>.
51315154

5155+
<!-- the serviceworker spec is responsible for emmitting the WebDriver BiDi
5156+
request events in this case. That's necessary to ensure that the events are
5157+
only generated if the serviceworker will handle the fetch, and to get the
5158+
correct event ordering in the case of network fallback -->
5159+
<li><p>Run the [=WebDriver BiDi response started=] steps with
5160+
<var>request</var> and <var>response</var>.
5161+
51325162
<li>
51335163
<p>If one of the following is true
51345164

@@ -5663,6 +5693,10 @@ run these steps:
56635693
<p class=note>This intentionally does not depend on <var>httpRequest</var>'s
56645694
<a for=request>credentials mode</a>.
56655695

5696+
<!-- After this point the request is not further modified before being either
5697+
retrieved from the cache or sent -->
5698+
<li><p>Run the <a>WebDriver BiDi before request sent</a> steps with <a>request</a>.
5699+
56665700
<li><p>Set <var>httpCache</var> to the result of <a>determining the HTTP cache partition</a>,
56675701
given <var>httpRequest</var>.
56685702

@@ -5758,6 +5792,8 @@ run these steps:
57585792
<li><p><a>If aborted</a>, then return the <a for=/>appropriate network error</a> for
57595793
<var>fetchParams</var>.
57605794

5795+
<li><p>If <var>response</var> is not null, run the <a>WebDriver BiDi response
5796+
started</a> steps with <var>request</var> and <var>response</var>.
57615797

57625798
<!-- If response is still null, we require a forwarded request. -->
57635799
<li>
@@ -6021,6 +6057,9 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
60216057

60226058
<li><p>Wait until all the HTTP response headers are transmitted.
60236059

6060+
<li><p>Run the [=WebDriver BiDi response started=] steps with
6061+
|request| and |response|.
6062+
60246063
<li><p>Let <var>status</var> be the HTTP response's status code.
60256064

60266065
<li>

0 commit comments

Comments
 (0)