Skip to content

Commit e5bc282

Browse files
committed
Add WebDriver BiDi network request logging
1 parent 0291bf1 commit e5bc282

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

fetch.bs

+39-1
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,11 @@ Unless stated otherwise, it is false.
21282128

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

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

@@ -2169,6 +2174,15 @@ otherwise, it is unset.
21692174
<a for=request>done flag</a>, and <a for=request>timing allow failed flag</a> are used as
21702175
bookkeeping details by the <a for=/>fetch</a> algorithm.
21712176

2177+
<p>A <a for=/>request</a> has an associated
2178+
<dfn export for=request id=concept-request-id>request id</dfn> which is a unique
2179+
string automatically set when the <a for=/>request</a> is created.
2180+
2181+
Note: the [=request/request id=] is used by WebDriver-BiDi. It remains constant
2182+
across all requests resulting from a redirect of an initial request. When a
2183+
request is [=request/cloned=], the created request gets a unique
2184+
[=request/request id=]. [[!WEBDRIVER-BIDI]]
2185+
21722186
<hr>
21732187

21742188
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
@@ -2245,7 +2259,10 @@ is to return the result of <a>serializing a request origin</a> with <var>request
22452259

22462260
<ol>
22472261
<li><p>Let <var>newRequest</var> be a copy of <var>request</var>, except for its
2248-
<a for=request>body</a>.
2262+
<a for=request>body</a> and <a for=request>request id</a>.
2263+
2264+
<li><p>Let <var>newRequest's</var> <a for=request>request id</a> be a new
2265+
unique string.
22492266

22502267
<li><p>If <var>request</var>'s <a for=request>body</a> is non-null, set <var>newRequest</var>'s
22512268
<a for=request>body</a> to the result of <a lt=clone for=body>cloning</a> <var>request</var>'s
@@ -4785,6 +4802,11 @@ steps:
47854802
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
47864803
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
47874804
<var>bodyInfo</var>, and <var>responseStatus</var>.
4805+
4806+
<li><p>If <var>response</var> is a <a>network error</a>, run
4807+
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
4808+
run the <a>WebDriver BiDi response completed</a> steps with
4809+
<var>request</var> and <var>response</var>.
47884810
</ol>
47894811

47904812
<li>
@@ -5139,6 +5161,13 @@ these steps:
51395161
<a>filtered response</a>; otherwise to <var>response</var>'s
51405162
<a for="filtered response">internal response</a>.
51415163

5164+
<!-- Service Workers is responsible for emmitting the WebDriver BiDi
5165+
request events in this case. That's necessary to ensure that the events are
5166+
only generated if the service worker will handle the fetch, and to get the
5167+
correct event ordering in the case of network fallback -->
5168+
<li><p>Run the [=WebDriver BiDi response started=] steps with
5169+
<var>request</var> and <var>response</var>.
5170+
51425171
<li>
51435172
<p>If one of the following is true
51445173

@@ -5673,6 +5702,10 @@ run these steps:
56735702
<p class=note>This intentionally does not depend on <var>httpRequest</var>'s
56745703
<a for=request>credentials mode</a>.
56755704

5705+
<!-- After this point the request is not further modified before being either
5706+
retrieved from the cache or sent -->
5707+
<li><p>Run the <a>WebDriver BiDi before request sent</a> steps with <var>request</var>.
5708+
56765709
<li><p>Set <var>httpCache</var> to the result of <a>determining the HTTP cache partition</a>,
56775710
given <var>httpRequest</var>.
56785711

@@ -5768,6 +5801,8 @@ run these steps:
57685801
<li><p><a>If aborted</a>, then return the <a for=/>appropriate network error</a> for
57695802
<var>fetchParams</var>.
57705803

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

57725807
<!-- If response is still null, we require a forwarded request. -->
57735808
<li>
@@ -6031,6 +6066,9 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
60316066

60326067
<li><p>Wait until all the HTTP response headers are transmitted.
60336068

6069+
<li><p>Run the [=WebDriver BiDi response started=] steps with
6070+
|request| and |response|.
6071+
60346072
<li><p>Let <var>status</var> be the HTTP response's status code.
60356073

60366074
<li>

0 commit comments

Comments
 (0)