From 3ed7c525ec8b6de74f8a3786ae9eb63a82c2e946 Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Sun, 16 Jul 2023 07:17:48 +0700 Subject: [PATCH] Updating to 117.0.5891.1_11.7.203 definitions --- fetch/events.go | 7 ++++++- fetch/fetch.go | 10 ++++++++-- network/easyjson.go | 7 ------- network/events.go | 7 +++---- preload/types.go | 3 +++ 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/fetch/events.go b/fetch/events.go index 1b16fd4..f940b94 100644 --- a/fetch/events.go +++ b/fetch/events.go @@ -12,7 +12,12 @@ import ( // with one of continueRequest, failRequest or fulfillRequest. The stage of the // request can be determined by presence of responseErrorReason and // responseStatusCode -- the request is at the response stage if either of these -// fields is present and in the request stage otherwise. +// fields is present and in the request stage otherwise. Redirect responses and +// subsequent requests are reported similarly to regular responses and requests. +// Redirect responses may be distinguished by the value of responseStatusCode +// (which is one of 301, 302, 303, 307, 308) along with presence of the location +// header. Requests resulting from a redirect will have redirectedRequestId +// field set. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#event-requestPaused type EventRequestPaused struct { diff --git a/fetch/fetch.go b/fetch/fetch.go index dac13ee..87e4b79 100644 --- a/fetch/fetch.go +++ b/fetch/fetch.go @@ -316,7 +316,10 @@ func (p *ContinueResponseParams) Do(ctx context.Context) (err error) { // that is paused in the Response stage and is mutually exclusive with // takeResponseBodyForInterceptionAsStream. Calling other methods that affect // the request or disabling fetch domain before body is received results in an -// undefined behavior. +// undefined behavior. Note that the response body is not available for +// redirects. Requests paused in the _redirect received_ state may be +// differentiated by responseCode and presence of location response header, see +// comments to requestPaused for details. type GetResponseBodyParams struct { RequestID RequestID `json:"requestId"` // Identifier for the intercepted request to get body for. } @@ -326,7 +329,10 @@ type GetResponseBodyParams struct { // is paused in the Response stage and is mutually exclusive with // takeResponseBodyForInterceptionAsStream. Calling other methods that affect // the request or disabling fetch domain before body is received results in an -// undefined behavior. +// undefined behavior. Note that the response body is not available for +// redirects. Requests paused in the _redirect received_ state may be +// differentiated by responseCode and presence of location response header, see +// comments to requestPaused for details. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-getResponseBody // diff --git a/network/easyjson.go b/network/easyjson.go index 3362a30..9f2a5a3 100644 --- a/network/easyjson.go +++ b/network/easyjson.go @@ -8043,8 +8043,6 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork73(in *jlexer.Lexer, o } case "encodedDataLength": out.EncodedDataLength = float64(in.Float64()) - case "shouldReportCorbBlocking": - out.ShouldReportCorbBlocking = bool(in.Bool()) default: in.SkipRecursive() } @@ -8078,11 +8076,6 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork73(out *jwriter.Writer out.RawString(prefix) out.Float64(float64(in.EncodedDataLength)) } - if in.ShouldReportCorbBlocking { - const prefix string = ",\"shouldReportCorbBlocking\":" - out.RawString(prefix) - out.Bool(bool(in.ShouldReportCorbBlocking)) - } out.RawByte('}') } diff --git a/network/events.go b/network/events.go index 0a60994..9255992 100644 --- a/network/events.go +++ b/network/events.go @@ -45,10 +45,9 @@ type EventLoadingFailed struct { // // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-loadingFinished type EventLoadingFinished struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - EncodedDataLength float64 `json:"encodedDataLength"` // Total number of bytes received for this request. - ShouldReportCorbBlocking bool `json:"shouldReportCorbBlocking,omitempty"` // Set when 1) response was blocked by Cross-Origin Read Blocking and also 2) this needs to be reported to the DevTools console. + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + EncodedDataLength float64 `json:"encodedDataLength"` // Total number of bytes received for this request. } // EventRequestServedFromCache fired if request ended up loading from cache. diff --git a/preload/types.go b/preload/types.go index 486dd77..b664eed 100644 --- a/preload/types.go +++ b/preload/types.go @@ -274,6 +274,7 @@ const ( PrerenderFinalStatusMemoryPressureAfterTriggered PrerenderFinalStatus = "MemoryPressureAfterTriggered" PrerenderFinalStatusPrerenderingDisabledByDevTools PrerenderFinalStatus = "PrerenderingDisabledByDevTools" PrerenderFinalStatusResourceLoadBlockedByClient PrerenderFinalStatus = "ResourceLoadBlockedByClient" + PrerenderFinalStatusSpeculationRuleRemoved PrerenderFinalStatus = "SpeculationRuleRemoved" ) // MarshalEasyJSON satisfies easyjson.Marshaler. @@ -414,6 +415,8 @@ func (t *PrerenderFinalStatus) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = PrerenderFinalStatusPrerenderingDisabledByDevTools case PrerenderFinalStatusResourceLoadBlockedByClient: *t = PrerenderFinalStatusResourceLoadBlockedByClient + case PrerenderFinalStatusSpeculationRuleRemoved: + *t = PrerenderFinalStatusSpeculationRuleRemoved default: in.AddError(fmt.Errorf("unknown PrerenderFinalStatus value: %v", v))