From 9d2f46c44324f45a2d1666f55e44fd01a40e5373 Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 6 Nov 2024 13:26:10 +0000 Subject: [PATCH 1/2] Expose initiatorType and destination on network.Request Currently we have network.Initiator, which exposes some detailed information about the stack trace that generated the request on network.beforeRequestSent, plus a `type` field that's not well defined. Fetch exposes `initiatorType` and `destination` and these are already used by other standards e.g. performanceTiming. Having data that directly corresponds to those other specs makes a good deal of sense so that e.g. performance measurements using WebDriver have the same fields with the same information as the DOM measurement APIs. With this change we could remove `Network.Initiator.type` since that's redundant with this data, but keep the field for extra information about the stack that generated a request. --- index.bs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 420bd001..d93e51cc 100644 --- a/index.bs +++ b/index.bs @@ -5829,6 +5829,8 @@ network.RequestData = { cookies: [*network.Cookie], headersSize: js-uint, bodySize: js-uint / null, + destination: text, + initiatorType: text, timings: network.FetchTimingInfo, }; @@ -5879,15 +5881,20 @@ To get the request data given |request|: 1. Append the result of [=serialize cookie=] given |cookie| to |cookies|. +1. Let |destination| be |request|'s [=request/destination=]. + +1. Let |initiator type| be |request|'s [=request/initiator type=]. + 1. Let |timings| be [=get the fetch timings=] with |request|. 1. Return a map matching the network.RequestData production, with the request field set to |request id|, url field set to |url|, the method field set to |method|, the headers field set to |headers|, the |cookies| field set to - |cookies|, and the headersSize field set to |headers size|, - the bodySize field set to |body size|, and the - timings field set to |timings|. + |cookies|, the headersSize field set to |headers size|, the + bodySize field set to |body size|, the destination + field set to |destination|, the initiatorType field set to + |initiator type|, and the timings field set to |timings|. From f39db139415dbdd35c37e898230bf13e17aa405b Mon Sep 17 00:00:00 2001 From: jgraham Date: Fri, 8 Nov 2024 14:01:38 +0000 Subject: [PATCH 2/2] Update index.bs Co-authored-by: Alex Rudenko --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index d93e51cc..a901980d 100644 --- a/index.bs +++ b/index.bs @@ -5830,7 +5830,7 @@ network.RequestData = { headersSize: js-uint, bodySize: js-uint / null, destination: text, - initiatorType: text, + initiatorType: text / null, timings: network.FetchTimingInfo, };