Skip to content

Commit 5df348c

Browse files
committed
Add WebDriver BiDi network request logging
1 parent 086e35f commit 5df348c

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

fetch.bs

+42-1
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
2133+
id</dfn> (a string). 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,15 @@ 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/request id=] is used by WebDriver-BiDi. It remains constant
2183+
across all requests resulting from a redirect of an initial request. When a
2184+
request is [=request/cloned=], the created request gets a unique
2185+
[=request/request id=]. [[!WEBDRIVER-BIDI]]
2186+
21672187
<hr>
21682188

21692189
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
@@ -2240,7 +2260,7 @@ is to return the result of <a>serializing a request origin</a> with <var>request
22402260

22412261
<ol>
22422262
<li><p>Let <var>newRequest</var> be a copy of <var>request</var>, except for its
2243-
<a for=request>body</a>.
2263+
<a for=request>body</a> and <a for=request>request id</a>.
22442264

22452265
<li><p>If <var>request</var>'s <a for=request>body</a> is non-null, set <var>newRequest</var>'s
22462266
<a for=request>body</a> to the result of <a lt=clone for=body>cloning</a> <var>request</var>'s
@@ -4779,6 +4799,11 @@ steps:
47794799
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
47804800
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
47814801
<var>bodyInfo</var>, and <var>responseStatus</var>.
4802+
4803+
<li><p>If <var>response</var> is a <a>network error</a>, run
4804+
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
4805+
run the <a>WebDriver BiDi response completed</a> steps with
4806+
<var>request</var> and <var>response</var>.
47824807
</ol>
47834808

47844809
<li>
@@ -5129,6 +5154,13 @@ these steps:
51295154
<a>filtered response</a>; otherwise to <var>response</var>'s
51305155
<a for="filtered response">internal response</a>.
51315156

5157+
<!-- Service Workers is responsible for emmitting the WebDriver BiDi
5158+
request events in this case. That's necessary to ensure that the events are
5159+
only generated if the service worker will handle the fetch, and to get the
5160+
correct event ordering in the case of network fallback -->
5161+
<li><p>Run the [=WebDriver BiDi response started=] steps with
5162+
<var>request</var> and <var>response</var>.
5163+
51325164
<li>
51335165
<p>If one of the following is true
51345166

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

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

@@ -5758,6 +5794,8 @@ run these steps:
57585794
<li><p><a>If aborted</a>, then return the <a for=/>appropriate network error</a> for
57595795
<var>fetchParams</var>.
57605796

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

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

60226060
<li><p>Wait until all the HTTP response headers are transmitted.
60236061

6062+
<li><p>Run the [=WebDriver BiDi response started=] steps with
6063+
|request| and |response|.
6064+
60246065
<li><p>Let <var>status</var> be the HTTP response's status code.
60256066

60266067
<li>

0 commit comments

Comments
 (0)