Skip to content

Commit f010d62

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

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
@@ -2123,6 +2123,11 @@ Unless stated otherwise, it is false.
21232123

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

2126+
<p>A <a for=/>request</a> has an associated <dfn export for=request>navigation
2127+
id</dfn> (a string). Unless stated otherwise, it is null.
2128+
2129+
<p class=note>This is for exclusive use by HTML's navigate algorithm. [[!HTML]]
2130+
21262131
<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>render-blocking</dfn>.
21272132
Unless stated otherwise, it is false.
21282133

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

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

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

22412255
<ol>
22422256
<li><p>Let <var>newRequest</var> be a copy of <var>request</var>, except for its
2243-
<a for=request>body</a>.
2257+
<a for=request>body</a> and <a for=request>request id</a>.
2258+
2259+
<li><p>Let <var>newRequest's</var> <a for=request>request id</a> be a new
2260+
unique string.
22442261

22452262
<li><p>If <var>request</var>'s <a for=request>body</a> is non-null, set <var>newRequest</var>'s
22462263
<a for=request>body</a> to the result of <a lt=clone for=body>cloning</a> <var>request</var>'s
@@ -4779,6 +4796,11 @@ steps:
47794796
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
47804797
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
47814798
<var>bodyInfo</var>, and <var>responseStatus</var>.
4799+
4800+
<li><p>If <var>response</var> is a <a>network error</a>, run
4801+
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
4802+
run the <a>WebDriver BiDi response completed</a> steps with
4803+
<var>request</var> and <var>response</var>.
47824804
</ol>
47834805

47844806
<li>
@@ -5129,6 +5151,13 @@ these steps:
51295151
<a>filtered response</a>; otherwise to <var>response</var>'s
51305152
<a for="filtered response">internal response</a>.
51315153

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

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

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

@@ -5758,6 +5791,8 @@ run these steps:
57585791
<li><p><a>If aborted</a>, then return the <a for=/>appropriate network error</a> for
57595792
<var>fetchParams</var>.
57605793

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

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

60226057
<li><p>Wait until all the HTTP response headers are transmitted.
60236058

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

60266064
<li>

0 commit comments

Comments
 (0)