Skip to content

Commit 4fa3194

Browse files
committed
Add WebDriver BiDi network request logging
1 parent a5560d2 commit 4fa3194

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

fetch.bs

+39
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262
109109
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https",
110110
"publisher": "IETF",
111111
"title": "Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs)"
112+
},
113+
"WEBDRIVER-BIDI": {
114+
"authors": [],
115+
"href": "https://w3c.github.io/webdriver-bidi/",
116+
"publisher": "W3C",
117+
"title": "WebDriver BiDi"
112118
}
113119
}
114120
</pre>
@@ -2072,6 +2078,11 @@ Unless stated otherwise, it is false.
20722078

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

2081+
<p>A <a for=/>request</a> has an associated <dfn export for=request>navigation id</dfn>.
2082+
Unless stated otherwise, it is null.
2083+
2084+
<p class=note>This is for exclusive use by HTML's navigate algorithm. [[!HTML]]
2085+
20752086
<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>render-blocking</dfn>.
20762087
Unless stated otherwise, it is false.
20772088

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

2127+
<p>A <a for=/>request</a> has an associated
2128+
<dfn export for=request id=concept-request-id>request id</dfn> which is a unique
2129+
string automatically set when the <a for=/>request</a> is created.
2130+
2131+
Note: the [=request id=] is used by WebDriver-BiDi. When a request is [=request/cloned=],
2132+
the created request gets a unique [=request id=]. [[!WEBDRIVER-BIDI]]
2133+
21162134
<hr>
21172135

21182136
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
@@ -4712,6 +4730,11 @@ steps:
47124730
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
47134731
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
47144732
<var>bodyInfo</var>, and <var>responseStatus</var>.
4733+
4734+
<li><p>If <var>response</var> is a <a>network error</a>, run
4735+
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
4736+
run the <a>WebDriver BiDi response completed</a> steps with
4737+
<var>request</var> and <var>response</var>.
47154738
</ol>
47164739

47174740
<li>
@@ -4967,6 +4990,13 @@ these steps:
49674990
<a>filtered response</a>, and to <var>response</var>'s
49684991
<a for="filtered response">internal response</a> otherwise.
49694992

4993+
<!-- the serviceworker spec is responsible for emmitting the WebDriver BiDi
4994+
request events in this case. That's necessary to ensure that the events are
4995+
only generated if the serviceworker will handle the fetch, and to get the
4996+
correct event ordering in the case of network fallback -->
4997+
<li><p>Run the [=WebDriver BiDi response started=] steps with
4998+
<var>request</var> and <var>response</var>.
4999+
49705000
<li>
49715001
<p>If one of the following is true
49725002

@@ -5483,6 +5513,10 @@ run these steps:
54835513
<p class=note>This intentionally does not depend on <var>httpRequest</var>'s
54845514
<a for=request>credentials mode</a>.
54855515

5516+
<!-- After this point the request is not further modified before being either
5517+
retrieved from the cache or sent -->
5518+
<li><p>Run the <a>WebDriver BiDi before request sent</a> steps with <a>request</a>.
5519+
54865520
<li><p>Set <var>httpCache</var> to the result of <a>determining the HTTP cache partition</a>,
54875521
given <var>httpRequest</var>.
54885522

@@ -5578,6 +5612,8 @@ run these steps:
55785612
<li><p><a>If aborted</a>, then return the <a for=/>appropriate network error</a> for
55795613
<var>fetchParams</var>.
55805614

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

55825618
<!-- If response is still null, we require a forwarded request. -->
55835619
<li>
@@ -5842,6 +5878,9 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
58425878

58435879
<li><p>Wait until all the HTTP response headers are transmitted.
58445880

5881+
<li><p>Run the [=WebDriver BiDi response started=] steps with
5882+
|request| and |response|.
5883+
58455884
<li><p>Let <var>status</var> be the HTTP response's status code.
58465885

58475886
<li>

0 commit comments

Comments
 (0)