Skip to content

Commit

Permalink
Add WebDriver BiDi network request logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Nov 18, 2022
1 parent 3cafbdf commit fff0efb
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,11 @@ Unless stated otherwise, it is false.

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

<p>A <a for=/>request</a> has an associated <dfn export for=request>navigation id</dfn>.
Unless stated otherwise, it is null.

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

<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>render-blocking</dfn>.
Unless stated otherwise, it is false.

Expand Down Expand Up @@ -2005,6 +2010,13 @@ otherwise, it is unset.
<a for=request>done flag</a>, and <a for=request>timing allow failed flag</a> are used as
bookkeeping details by the <a for=/>fetch</a> algorithm.

<p>A <a for=/>request</a> has an associated
<dfn export for=request id=concept-request-id>request id</dfn> which is a unique
string automatically set when the <a for=/>request</a> is created.

Note: the [=request id=] is used by WebDriver-BiDi. When a request is [=cloned=],
the created request gets a unique [=request id=]. [[!WEBDRIVER-BIDI]]

<hr>

<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
Expand Down Expand Up @@ -4522,8 +4534,13 @@ steps:
<a for=request>initiator type</a> is not null, then
<a for=/>mark resource timing</a> given <var>timingInfo</var>, <var>request</var>'s
<a for=request>URL</a>, <a for="fetch params">request</a>'s
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
<var>bodyInfo</var>, and <var>responseStatus</var>.
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>, and
<var>bodyInfo</var>.

<li><p>If <var>response</var> is a <a>network error</a>, run
the <a>WebDriver BiDi fetch error</a> steps with <var>request</var>. Otherwise
run the <a>WebDriver BiDi response completed</a> steps with
<var>request</a> and <var>response</var>.
</ol>

<li>
Expand Down Expand Up @@ -4776,6 +4793,13 @@ these steps:
<a>filtered response</a>, and to <var>response</var>'s
<a for="filtered response">internal response</a> otherwise.

<!-- the serviceworker spec is responsible for emmitting the WebDriver BiDi
request events in this case. That's necessary to ensure that the events are
only generated if the serviceworker will handle the fetch, and to get the
correct event ordering in the case of network fallback -->
<li><p>Run the [=WebDriver BiDi response started=] steps with
<var>request</var> and <var>response</var>.

<li>
<p>If one of the following is true

Expand Down Expand Up @@ -5171,6 +5195,10 @@ run these steps:
<a for="header list">append</a> (`<code>Cache-Control</code>`, `<code>max-age=0</code>`) to
<var>httpRequest</var>'s <a for=request>header list</a>.

<!-- After this point the request is not further modified before being either
retrieved from the cache or sent -->
<li><p>Run the <a>WebDriver BiDi before request sent</a> steps with <a>request</a>.

<li>
<p>If <var>httpRequest</var>'s <a for=request>cache mode</a> is "<code>no-store</code>" or
"<code>reload</code>", then:
Expand Down Expand Up @@ -5366,7 +5394,12 @@ run these steps:
chapter of <cite>HTTP Caching</cite> [[!HTTP-CACHING]].

<li><p>Otherwise, set <var>response</var> to <var>storedResponse</var> and set
<var>response</var>'s <a for=response>cache state</a> to "<code>local</code>".
<var>response</var>'s <a for=response>cache state</a> to
"<code>local</code>".

<!-- Once BiDi has request interception this will allow changing the response-->
<li><p>Run the <a>WebDriver BiDi response started</a> with
<var>request</var> and <var>response</var>.
</ol>
</ol>
</ol>
Expand Down Expand Up @@ -5638,6 +5671,11 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:

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

<li><p>Run the [=WebDriver BiDi response started=] steps with
|request| and |response|.

<li><p>Let <var>status</var> be the HTTP response's status code.

<li><p>Let <var>status</var> be the HTTP response's status code.

<li>
Expand Down

0 comments on commit fff0efb

Please sign in to comment.