Skip to content

Commit d41ef17

Browse files
committed
Add WebDriver BiDi network request logging
1 parent 4cb3cf2 commit d41ef17

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

fetch.bs

+44-3
Original file line numberDiff line numberDiff line change
@@ -2156,6 +2156,11 @@ Unless stated otherwise, it is false.
21562156

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

2159+
<p>A <a for=/>request</a> has an associated <dfn export for=request>WebDriver navigation id</dfn>
2160+
(null or a string). Unless stated otherwise, it is null.
2161+
2162+
<p class=note>This is for exclusive use by HTML's navigate algorithm. [[!HTML]]
2163+
21592164
<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>render-blocking</dfn>.
21602165
Unless stated otherwise, it is false.
21612166

@@ -2197,6 +2202,15 @@ otherwise, it is unset.
21972202
<a for=request>done flag</a>, and <a for=request>timing allow failed flag</a> are used as
21982203
bookkeeping details by the <a for=/>fetch</a> algorithm.
21992204

2205+
<p>A <a for=/>request</a> has an associated
2206+
<dfn export for=request id=concept-webdriver-id>WebDriver id</dfn>
2207+
which is a unique string automatically set when the <a for=/>request</a> is created.
2208+
2209+
<p class=note>The [=request/WebDriver id=] is used by WebDriver-BiDi. It remains constant
2210+
across all requests resulting from a redirect of an initial request. When a
2211+
request is [=request/cloned=], the created request gets a unique
2212+
[=request/WebDriver id=]. [[!WEBDRIVER-BIDI]]
2213+
22002214
<hr>
22012215

22022216
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
@@ -2273,7 +2287,9 @@ is to return the result of <a>serializing a request origin</a> with <var>request
22732287

22742288
<ol>
22752289
<li><p>Let <var>newRequest</var> be a copy of <var>request</var>, except for its
2276-
<a for=request>body</a>.
2290+
<a for=request>body</a> and <a for=request>WebDriver id</a>.
2291+
2292+
<li><p>Set <var>newRequest</var>'s <a for=request>WebDriver id</a> to a new unique string.
22772293

22782294
<li><p>If <var>request</var>'s <a for=request>body</a> is non-null, set <var>newRequest</var>'s
22792295
<a for=request>body</a> to the result of <a lt=clone for=body>cloning</a> <var>request</var>'s
@@ -4829,6 +4845,11 @@ steps:
48294845
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
48304846
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
48314847
<var>bodyInfo</var>, and <var>responseStatus</var>.
4848+
4849+
<li><p>If <var>response</var> is a <a>network error</a>, run
4850+
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
4851+
run the <a>WebDriver BiDi response completed</a> steps with
4852+
<var>request</var> and <var>response</var>.
48324853
</ol>
48334854

48344855
<li>
@@ -5170,6 +5191,13 @@ these steps:
51705191
<a>filtered response</a>; otherwise to <var>response</var>'s
51715192
<a for="filtered response">internal response</a>.
51725193

5194+
<li><p>Run the [=WebDriver BiDi response started=] steps with
5195+
<var>request</var> and <var>response</var>.
5196+
<!-- Service Workers is responsible for emmitting the WebDriver BiDi
5197+
request events in this case. That's necessary to ensure that the events are
5198+
only generated if the service worker will handle the fetch, and to get the
5199+
correct event ordering in the case of network fallback -->
5200+
51735201
<li>
51745202
<p>If one of the following is true
51755203

@@ -5297,8 +5325,12 @@ these steps:
52975325

52985326
<dt>"<code>follow</code>"
52995327
<dd>
5300-
<ol><li><p>Set <var>response</var> to the result of running <a>HTTP-redirect fetch</a> given
5301-
<var>fetchParams</var> and <var>response</var>.</ol>
5328+
<ol>
5329+
<li>Run the <a>WebDriver BiDi response completed</a> steps with <var>request</var> and
5330+
<var>response</var>.
5331+
<li><p>Set <var>response</var> to the result of running <a>HTTP-redirect fetch</a> given
5332+
<var>fetchParams</var> and <var>response</var>.
5333+
</ol>
53025334
</dl>
53035335
<!-- not resetting internalResponse since it's no longer used anyway -->
53045336
</ol>
@@ -5704,6 +5736,10 @@ run these steps:
57045736
<p class=note>This intentionally does not depend on <var>httpRequest</var>'s
57055737
<a for=request>credentials mode</a>.
57065738

5739+
<!-- After this point the request is not further modified before being either
5740+
retrieved from the cache or sent -->
5741+
<li><p>Run the <a>WebDriver BiDi before request sent</a> steps with <var>request</var>.
5742+
57075743
<li><p>Set <var>httpCache</var> to the result of <a>determining the HTTP cache partition</a>,
57085744
given <var>httpRequest</var>.
57095745

@@ -5799,6 +5835,8 @@ run these steps:
57995835
<li><p><a>If aborted</a>, then return the <a for=/>appropriate network error</a> for
58005836
<var>fetchParams</var>.
58015837

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

58035841
<!-- If response is still null, we require a forwarded request. -->
58045842
<li>
@@ -6062,6 +6100,9 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
60626100

60636101
<li><p>Wait until all the HTTP response headers are transmitted.
60646102

6103+
<li><p>Run the [=WebDriver BiDi response started=] steps with
6104+
|request| and |response|.
6105+
60656106
<li><p>Let <var>status</var> be the HTTP response's status code.
60666107

60676108
<li>

0 commit comments

Comments
 (0)