Skip to content

Commit 7884a67

Browse files
committed
Add WebDriver BiDi network request logging
1 parent 84ea7db commit 7884a67

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

fetch.bs

+33
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,11 @@ Unless stated otherwise, it is false.
20832083

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

2086+
<p>A <a for=/>request</a> has an associated <dfn export for=request>navigation id</dfn>.
2087+
Unless stated otherwise, it is null.
2088+
2089+
<p class=note>This is for exclusive use by HTML's navigate algorithm. [[!HTML]]
2090+
20862091
<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>render-blocking</dfn>.
20872092
Unless stated otherwise, it is false.
20882093

@@ -2124,6 +2129,13 @@ otherwise, it is unset.
21242129
<a for=request>done flag</a>, and <a for=request>timing allow failed flag</a> are used as
21252130
bookkeeping details by the <a for=/>fetch</a> algorithm.
21262131

2132+
<p>A <a for=/>request</a> has an associated
2133+
<dfn export for=request id=concept-request-id>request id</dfn> which is a unique
2134+
string automatically set when the <a for=/>request</a> is created.
2135+
2136+
Note: the [=request id=] is used by WebDriver-BiDi. When a request is [=cloned=],
2137+
the created request gets a unique [=request id=]. [[!WEBDRIVER-BIDI]]
2138+
21272139
<hr>
21282140

21292141
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
@@ -4684,6 +4696,11 @@ steps:
46844696
<a for=request>URL</a>, <a for="fetch params">request</a>'s
46854697
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
46864698
<var>bodyInfo</var>, and <var>responseStatus</var>.
4699+
4700+
<li><p>If <var>response</var> is a <a>network error</a>, run
4701+
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
4702+
run the <a>WebDriver BiDi response completed</a> steps with
4703+
<var>request</var> and <var>response</var>.
46874704
</ol>
46884705

46894706
<li>
@@ -4934,6 +4951,13 @@ these steps:
49344951
<a>filtered response</a>, and to <var>response</var>'s
49354952
<a for="filtered response">internal response</a> otherwise.
49364953

4954+
<!-- the serviceworker spec is responsible for emmitting the WebDriver BiDi
4955+
request events in this case. That's necessary to ensure that the events are
4956+
only generated if the serviceworker will handle the fetch, and to get the
4957+
correct event ordering in the case of network fallback -->
4958+
<li><p>Run the [=WebDriver BiDi response started=] steps with
4959+
<var>request</var> and <var>response</var>.
4960+
49374961
<li>
49384962
<p>If one of the following is true
49394963

@@ -5338,6 +5362,10 @@ run these steps:
53385362
<a for="header list">append</a> (`<code>Cache-Control</code>`, `<code>max-age=0</code>`) to
53395363
<var>httpRequest</var>'s <a for=request>header list</a>.
53405364

5365+
<!-- After this point the request is not further modified before being either
5366+
retrieved from the cache or sent -->
5367+
<li><p>Run the <a>WebDriver BiDi before request sent</a> steps with <a>request</a>.
5368+
53415369
<li>
53425370
<p>If <var>httpRequest</var>'s <a for=request>cache mode</a> is "<code>no-store</code>" or
53435371
"<code>reload</code>", then:
@@ -5540,6 +5568,8 @@ run these steps:
55405568
<li><p><a>If aborted</a>, then return the <a for=/>appropriate network error</a> for
55415569
<var>fetchParams</var>.
55425570

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

55445574
<!-- If response is still null, we require a forwarded request. -->
55455575
<li>
@@ -5803,6 +5833,9 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
58035833

58045834
<li><p>Wait until all the HTTP response headers are transmitted.
58055835

5836+
<li><p>Run the [=WebDriver BiDi response started=] steps with
5837+
|request| and |response|.
5838+
58065839
<li><p>Let <var>status</var> be the HTTP response's status code.
58075840

58085841
<li>

0 commit comments

Comments
 (0)