Skip to content

Commit 527ca76

Browse files
committed
Add WebDriver BiDi network request logging
1 parent 1085f4f commit 527ca76

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

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

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

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

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

22032217
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
@@ -2274,7 +2288,9 @@ is to return the result of <a>serializing a request origin</a> with <var>request
22742288

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

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

48354856
<li>
@@ -5171,6 +5192,13 @@ these steps:
51715192
<a>filtered response</a>; otherwise to <var>response</var>'s
51725193
<a for="filtered response">internal response</a>.
51735194

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

@@ -5298,8 +5326,12 @@ these steps:
52985326

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

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

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

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

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

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

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

60686109
<li>

0 commit comments

Comments
 (0)