From 66462be74baac0eb497ad5b8261eaf4e187a13b4 Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Mon, 20 May 2024 05:44:52 +0700 Subject: [PATCH] Updating to 127.0.6489.1_12.7.81 definitions --- audits/easyjson.go | 14 ++++++++++++++ audits/types.go | 4 +++- cdp/types.go | 9 ++++++--- network/types.go | 3 +++ page/easyjson.go | 12 ++++++++++++ page/page.go | 13 +++++++++++-- 6 files changed, 49 insertions(+), 6 deletions(-) diff --git a/audits/easyjson.go b/audits/easyjson.go index 2b68be8..db16529 100644 --- a/audits/easyjson.go +++ b/audits/easyjson.go @@ -2636,6 +2636,10 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAudits23(in *jlexer.Lexer, ou } in.Delim(']') } + case "optOutPercentage": + out.OptOutPercentage = float64(in.Float64()) + case "isOptOutTopLevel": + out.IsOptOutTopLevel = bool(in.Bool()) default: in.SkipRecursive() } @@ -2666,6 +2670,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAudits23(out *jwriter.Writer, out.RawByte(']') } } + { + const prefix string = ",\"optOutPercentage\":" + out.RawString(prefix) + out.Float64(float64(in.OptOutPercentage)) + } + { + const prefix string = ",\"isOptOutTopLevel\":" + out.RawString(prefix) + out.Bool(bool(in.IsOptOutTopLevel)) + } out.RawByte('}') } diff --git a/audits/types.go b/audits/types.go index f09e295..b384c23 100644 --- a/audits/types.go +++ b/audits/types.go @@ -1116,7 +1116,9 @@ type BounceTrackingIssueDetails struct { // // See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CookieDeprecationMetadataIssueDetails type CookieDeprecationMetadataIssueDetails struct { - AllowedSites []string `json:"allowedSites"` + AllowedSites []string `json:"allowedSites"` + OptOutPercentage float64 `json:"optOutPercentage"` + IsOptOutTopLevel bool `json:"isOptOutTopLevel"` } // ClientHintIssueReason [no description]. diff --git a/cdp/types.go b/cdp/types.go index e9ee49b..6816e8e 100644 --- a/cdp/types.go +++ b/cdp/types.go @@ -175,13 +175,14 @@ const ( PseudoTypeMarker PseudoType = "marker" PseudoTypeBackdrop PseudoType = "backdrop" PseudoTypeSelection PseudoType = "selection" + PseudoTypeSearchText PseudoType = "search-text" PseudoTypeTargetText PseudoType = "target-text" PseudoTypeSpellingError PseudoType = "spelling-error" PseudoTypeGrammarError PseudoType = "grammar-error" PseudoTypeHighlight PseudoType = "highlight" PseudoTypeFirstLineInherited PseudoType = "first-line-inherited" PseudoTypeScrollMarker PseudoType = "scroll-marker" - PseudoTypeScrollMarkers PseudoType = "scroll-markers" + PseudoTypeScrollMarkerGroup PseudoType = "scroll-marker-group" PseudoTypeScrollbar PseudoType = "scrollbar" PseudoTypeScrollbarThumb PseudoType = "scrollbar-thumb" PseudoTypeScrollbarButton PseudoType = "scrollbar-button" @@ -225,6 +226,8 @@ func (t *PseudoType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = PseudoTypeBackdrop case PseudoTypeSelection: *t = PseudoTypeSelection + case PseudoTypeSearchText: + *t = PseudoTypeSearchText case PseudoTypeTargetText: *t = PseudoTypeTargetText case PseudoTypeSpellingError: @@ -237,8 +240,8 @@ func (t *PseudoType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = PseudoTypeFirstLineInherited case PseudoTypeScrollMarker: *t = PseudoTypeScrollMarker - case PseudoTypeScrollMarkers: - *t = PseudoTypeScrollMarkers + case PseudoTypeScrollMarkerGroup: + *t = PseudoTypeScrollMarkerGroup case PseudoTypeScrollbar: *t = PseudoTypeScrollbar case PseudoTypeScrollbarThumb: diff --git a/network/types.go b/network/types.go index 8a1462c..da9c61c 100644 --- a/network/types.go +++ b/network/types.go @@ -1394,6 +1394,7 @@ const ( CookieExemptionReasonStorageAccess CookieExemptionReason = "StorageAccess" CookieExemptionReasonTopLevelStorageAccess CookieExemptionReason = "TopLevelStorageAccess" CookieExemptionReasonCorsOptIn CookieExemptionReason = "CorsOptIn" + CookieExemptionReasonScheme CookieExemptionReason = "Scheme" ) // MarshalEasyJSON satisfies easyjson.Marshaler. @@ -1428,6 +1429,8 @@ func (t *CookieExemptionReason) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = CookieExemptionReasonTopLevelStorageAccess case CookieExemptionReasonCorsOptIn: *t = CookieExemptionReasonCorsOptIn + case CookieExemptionReasonScheme: + *t = CookieExemptionReasonScheme default: in.AddError(fmt.Errorf("unknown CookieExemptionReason value: %v", v)) diff --git a/page/easyjson.go b/page/easyjson.go index 15008ee..bc52d37 100644 --- a/page/easyjson.go +++ b/page/easyjson.go @@ -3006,6 +3006,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage29(in *jlexer.Lexer, out out.IgnoreCache = bool(in.Bool()) case "scriptToEvaluateOnLoad": out.ScriptToEvaluateOnLoad = string(in.String()) + case "loaderId": + out.LoaderID = cdp.LoaderID(in.String()) default: in.SkipRecursive() } @@ -3036,6 +3038,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage29(out *jwriter.Writer, i } out.String(string(in.ScriptToEvaluateOnLoad)) } + if in.LoaderID != "" { + const prefix string = ",\"loaderId\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.LoaderID)) + } out.RawByte('}') } diff --git a/page/page.go b/page/page.go index 6a6bbe9..a4c9bc9 100644 --- a/page/page.go +++ b/page/page.go @@ -990,8 +990,9 @@ func (p *PrintToPDFParams) Do(ctx context.Context) (data []byte, stream io.Strea // ReloadParams reloads given page optionally ignoring the cache. type ReloadParams struct { - IgnoreCache bool `json:"ignoreCache,omitempty"` // If true, browser cache is ignored (as if the user pressed Shift+refresh). - ScriptToEvaluateOnLoad string `json:"scriptToEvaluateOnLoad,omitempty"` // If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin. + IgnoreCache bool `json:"ignoreCache,omitempty"` // If true, browser cache is ignored (as if the user pressed Shift+refresh). + ScriptToEvaluateOnLoad string `json:"scriptToEvaluateOnLoad,omitempty"` // If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin. + LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // If set, an error will be thrown if the target page's main frame's loader id does not match the provided id. This prevents accidentally reloading an unintended target in case there's a racing navigation. } // Reload reloads given page optionally ignoring the cache. @@ -1018,6 +1019,14 @@ func (p ReloadParams) WithScriptToEvaluateOnLoad(scriptToEvaluateOnLoad string) return &p } +// WithLoaderID if set, an error will be thrown if the target page's main +// frame's loader id does not match the provided id. This prevents accidentally +// reloading an unintended target in case there's a racing navigation. +func (p ReloadParams) WithLoaderID(loaderID cdp.LoaderID) *ReloadParams { + p.LoaderID = loaderID + return &p +} + // Do executes Page.reload against the provided context. func (p *ReloadParams) Do(ctx context.Context) (err error) { return cdp.Execute(ctx, CommandReload, p, nil)