From 9e96ee3404039c7c931815a500e8bdf0d218d500 Mon Sep 17 00:00:00 2001 From: Yad Smood Date: Sun, 5 May 2024 14:41:27 +0800 Subject: [PATCH] update chromium version --- lib/launcher/revision.go | 4 +- lib/proto/animation.go | 11 ++ lib/proto/audits.go | 95 +++++++++++++++ lib/proto/definitions.go | 26 ++++ lib/proto/definitions_test.go | 52 ++++++++ lib/proto/dom.go | 38 ++++++ lib/proto/emulation.go | 36 +++++- lib/proto/extensions.go | 36 ++++++ lib/proto/network.go | 37 +++++- lib/proto/page.go | 218 +++++++++++++++++++++++++++++++++- lib/proto/pwa.go | 101 ++++++++++++++++ lib/proto/storage.go | 3 + 12 files changed, 643 insertions(+), 14 deletions(-) create mode 100644 lib/proto/extensions.go create mode 100644 lib/proto/pwa.go diff --git a/lib/launcher/revision.go b/lib/launcher/revision.go index 47f7da27..ff80f02d 100644 --- a/lib/launcher/revision.go +++ b/lib/launcher/revision.go @@ -3,7 +3,7 @@ package launcher // RevisionDefault for chromium. -const RevisionDefault = 1278087 +const RevisionDefault = 1294824 // RevisionPlaywright for arm linux. -const RevisionPlaywright = 1105 +const RevisionPlaywright = 1112 diff --git a/lib/proto/animation.go b/lib/proto/animation.go index 114d81bc..17de2d78 100644 --- a/lib/proto/animation.go +++ b/lib/proto/animation.go @@ -334,3 +334,14 @@ type AnimationAnimationStarted struct { func (evt AnimationAnimationStarted) ProtoEvent() string { return "Animation.animationStarted" } + +// AnimationAnimationUpdated Event for animation that has been updated. +type AnimationAnimationUpdated struct { + // Animation that was updated. + Animation *AnimationAnimation `json:"animation"` +} + +// ProtoEvent name. +func (evt AnimationAnimationUpdated) ProtoEvent() string { + return "Animation.animationUpdated" +} diff --git a/lib/proto/audits.go b/lib/proto/audits.go index ed1534a0..5c7d21a4 100644 --- a/lib/proto/audits.go +++ b/lib/proto/audits.go @@ -560,6 +560,80 @@ const ( AuditsAttributionReportingIssueTypeNoRegisterOsTriggerHeader AuditsAttributionReportingIssueType = "NoRegisterOsTriggerHeader" ) +// AuditsSharedDictionaryError ... +type AuditsSharedDictionaryError string + +const ( + // AuditsSharedDictionaryErrorUseErrorCrossOriginNoCorsRequest enum const. + AuditsSharedDictionaryErrorUseErrorCrossOriginNoCorsRequest AuditsSharedDictionaryError = "UseErrorCrossOriginNoCorsRequest" + + // AuditsSharedDictionaryErrorUseErrorDictionaryLoadFailure enum const. + AuditsSharedDictionaryErrorUseErrorDictionaryLoadFailure AuditsSharedDictionaryError = "UseErrorDictionaryLoadFailure" + + // AuditsSharedDictionaryErrorUseErrorMatchingDictionaryNotUsed enum const. + AuditsSharedDictionaryErrorUseErrorMatchingDictionaryNotUsed AuditsSharedDictionaryError = "UseErrorMatchingDictionaryNotUsed" + + // AuditsSharedDictionaryErrorUseErrorUnexpectedContentDictionaryHeader enum const. + AuditsSharedDictionaryErrorUseErrorUnexpectedContentDictionaryHeader AuditsSharedDictionaryError = "UseErrorUnexpectedContentDictionaryHeader" + + // AuditsSharedDictionaryErrorWriteErrorCossOriginNoCorsRequest enum const. + AuditsSharedDictionaryErrorWriteErrorCossOriginNoCorsRequest AuditsSharedDictionaryError = "WriteErrorCossOriginNoCorsRequest" + + // AuditsSharedDictionaryErrorWriteErrorDisallowedBySettings enum const. + AuditsSharedDictionaryErrorWriteErrorDisallowedBySettings AuditsSharedDictionaryError = "WriteErrorDisallowedBySettings" + + // AuditsSharedDictionaryErrorWriteErrorExpiredResponse enum const. + AuditsSharedDictionaryErrorWriteErrorExpiredResponse AuditsSharedDictionaryError = "WriteErrorExpiredResponse" + + // AuditsSharedDictionaryErrorWriteErrorFeatureDisabled enum const. + AuditsSharedDictionaryErrorWriteErrorFeatureDisabled AuditsSharedDictionaryError = "WriteErrorFeatureDisabled" + + // AuditsSharedDictionaryErrorWriteErrorInsufficientResources enum const. + AuditsSharedDictionaryErrorWriteErrorInsufficientResources AuditsSharedDictionaryError = "WriteErrorInsufficientResources" + + // AuditsSharedDictionaryErrorWriteErrorInvalidMatchField enum const. + AuditsSharedDictionaryErrorWriteErrorInvalidMatchField AuditsSharedDictionaryError = "WriteErrorInvalidMatchField" + + // AuditsSharedDictionaryErrorWriteErrorInvalidStructuredHeader enum const. + AuditsSharedDictionaryErrorWriteErrorInvalidStructuredHeader AuditsSharedDictionaryError = "WriteErrorInvalidStructuredHeader" + + // AuditsSharedDictionaryErrorWriteErrorNavigationRequest enum const. + AuditsSharedDictionaryErrorWriteErrorNavigationRequest AuditsSharedDictionaryError = "WriteErrorNavigationRequest" + + // AuditsSharedDictionaryErrorWriteErrorNoMatchField enum const. + AuditsSharedDictionaryErrorWriteErrorNoMatchField AuditsSharedDictionaryError = "WriteErrorNoMatchField" + + // AuditsSharedDictionaryErrorWriteErrorNonListMatchDestField enum const. + AuditsSharedDictionaryErrorWriteErrorNonListMatchDestField AuditsSharedDictionaryError = "WriteErrorNonListMatchDestField" + + // AuditsSharedDictionaryErrorWriteErrorNonSecureContext enum const. + AuditsSharedDictionaryErrorWriteErrorNonSecureContext AuditsSharedDictionaryError = "WriteErrorNonSecureContext" + + // AuditsSharedDictionaryErrorWriteErrorNonStringIDField enum const. + AuditsSharedDictionaryErrorWriteErrorNonStringIDField AuditsSharedDictionaryError = "WriteErrorNonStringIdField" + + // AuditsSharedDictionaryErrorWriteErrorNonStringInMatchDestList enum const. + AuditsSharedDictionaryErrorWriteErrorNonStringInMatchDestList AuditsSharedDictionaryError = "WriteErrorNonStringInMatchDestList" + + // AuditsSharedDictionaryErrorWriteErrorNonStringMatchField enum const. + AuditsSharedDictionaryErrorWriteErrorNonStringMatchField AuditsSharedDictionaryError = "WriteErrorNonStringMatchField" + + // AuditsSharedDictionaryErrorWriteErrorNonTokenTypeField enum const. + AuditsSharedDictionaryErrorWriteErrorNonTokenTypeField AuditsSharedDictionaryError = "WriteErrorNonTokenTypeField" + + // AuditsSharedDictionaryErrorWriteErrorRequestAborted enum const. + AuditsSharedDictionaryErrorWriteErrorRequestAborted AuditsSharedDictionaryError = "WriteErrorRequestAborted" + + // AuditsSharedDictionaryErrorWriteErrorShuttingDown enum const. + AuditsSharedDictionaryErrorWriteErrorShuttingDown AuditsSharedDictionaryError = "WriteErrorShuttingDown" + + // AuditsSharedDictionaryErrorWriteErrorTooLongIDField enum const. + AuditsSharedDictionaryErrorWriteErrorTooLongIDField AuditsSharedDictionaryError = "WriteErrorTooLongIdField" + + // AuditsSharedDictionaryErrorWriteErrorUnsupportedType enum const. + AuditsSharedDictionaryErrorWriteErrorUnsupportedType AuditsSharedDictionaryError = "WriteErrorUnsupportedType" +) + // AuditsAttributionReportingIssueDetails Details for issues around "Attribution Reporting API" usage. // Explainer: https://github.com/WICG/attribution-reporting-api type AuditsAttributionReportingIssueDetails struct { @@ -605,6 +679,15 @@ type AuditsNavigatorUserAgentIssueDetails struct { Location *AuditsSourceCodeLocation `json:"location,omitempty"` } +// AuditsSharedDictionaryIssueDetails ... +type AuditsSharedDictionaryIssueDetails struct { + // SharedDictionaryError ... + SharedDictionaryError AuditsSharedDictionaryError `json:"sharedDictionaryError"` + + // Request ... + Request *AuditsAffectedRequest `json:"request"` +} + // AuditsGenericIssueErrorType ... type AuditsGenericIssueErrorType string @@ -834,6 +917,12 @@ const ( // AuditsFederatedAuthRequestIssueReasonNotSignedInWithIdp enum const. AuditsFederatedAuthRequestIssueReasonNotSignedInWithIdp AuditsFederatedAuthRequestIssueReason = "NotSignedInWithIdp" + + // AuditsFederatedAuthRequestIssueReasonMissingTransientUserActivation enum const. + AuditsFederatedAuthRequestIssueReasonMissingTransientUserActivation AuditsFederatedAuthRequestIssueReason = "MissingTransientUserActivation" + + // AuditsFederatedAuthRequestIssueReasonReplacedByButtonMode enum const. + AuditsFederatedAuthRequestIssueReasonReplacedByButtonMode AuditsFederatedAuthRequestIssueReason = "ReplacedByButtonMode" ) // AuditsFederatedAuthUserInfoRequestIssueDetails ... @@ -1016,6 +1105,9 @@ const ( // AuditsInspectorIssueCodePropertyRuleIssue enum const. AuditsInspectorIssueCodePropertyRuleIssue AuditsInspectorIssueCode = "PropertyRuleIssue" + + // AuditsInspectorIssueCodeSharedDictionaryIssue enum const. + AuditsInspectorIssueCodeSharedDictionaryIssue AuditsInspectorIssueCode = "SharedDictionaryIssue" ) // AuditsInspectorIssueDetails This struct holds a list of optional fields with additional information @@ -1081,6 +1173,9 @@ type AuditsInspectorIssueDetails struct { // FederatedAuthUserInfoRequestIssueDetails (optional) ... FederatedAuthUserInfoRequestIssueDetails *AuditsFederatedAuthUserInfoRequestIssueDetails `json:"federatedAuthUserInfoRequestIssueDetails,omitempty"` + + // SharedDictionaryIssueDetails (optional) ... + SharedDictionaryIssueDetails *AuditsSharedDictionaryIssueDetails `json:"sharedDictionaryIssueDetails,omitempty"` } // AuditsIssueID A unique id for a DevTools inspector issue. Allows other entities (e.g. diff --git a/lib/proto/definitions.go b/lib/proto/definitions.go index e056c40e..0da8222d 100644 --- a/lib/proto/definitions.go +++ b/lib/proto/definitions.go @@ -52,6 +52,7 @@ var types = map[string]reflect.Type{ "Animation.animationCanceled": reflect.TypeOf(AnimationAnimationCanceled{}), "Animation.animationCreated": reflect.TypeOf(AnimationAnimationCreated{}), "Animation.animationStarted": reflect.TypeOf(AnimationAnimationStarted{}), + "Animation.animationUpdated": reflect.TypeOf(AnimationAnimationUpdated{}), "Audits.AffectedCookie": reflect.TypeOf(AuditsAffectedCookie{}), "Audits.AffectedRequest": reflect.TypeOf(AuditsAffectedRequest{}), "Audits.AffectedFrame": reflect.TypeOf(AuditsAffectedFrame{}), @@ -67,6 +68,7 @@ var types = map[string]reflect.Type{ "Audits.AttributionReportingIssueDetails": reflect.TypeOf(AuditsAttributionReportingIssueDetails{}), "Audits.QuirksModeIssueDetails": reflect.TypeOf(AuditsQuirksModeIssueDetails{}), "Audits.NavigatorUserAgentIssueDetails": reflect.TypeOf(AuditsNavigatorUserAgentIssueDetails{}), + "Audits.SharedDictionaryIssueDetails": reflect.TypeOf(AuditsSharedDictionaryIssueDetails{}), "Audits.GenericIssueDetails": reflect.TypeOf(AuditsGenericIssueDetails{}), "Audits.DeprecationIssueDetails": reflect.TypeOf(AuditsDeprecationIssueDetails{}), "Audits.BounceTrackingIssueDetails": reflect.TypeOf(AuditsBounceTrackingIssueDetails{}), @@ -87,6 +89,8 @@ var types = map[string]reflect.Type{ "Audits.checkFormsIssues": reflect.TypeOf(AuditsCheckFormsIssues{}), "Audits.checkFormsIssuesResult": reflect.TypeOf(AuditsCheckFormsIssuesResult{}), "Audits.issueAdded": reflect.TypeOf(AuditsIssueAdded{}), + "Extensions.loadUnpacked": reflect.TypeOf(ExtensionsLoadUnpacked{}), + "Extensions.loadUnpackedResult": reflect.TypeOf(ExtensionsLoadUnpackedResult{}), "Autofill.CreditCard": reflect.TypeOf(AutofillCreditCard{}), "Autofill.AddressField": reflect.TypeOf(AutofillAddressField{}), "Autofill.AddressFields": reflect.TypeOf(AutofillAddressFields{}), @@ -308,6 +312,8 @@ var types = map[string]reflect.Type{ "DOM.querySelectorAllResult": reflect.TypeOf(DOMQuerySelectorAllResult{}), "DOM.getTopLayerElements": reflect.TypeOf(DOMGetTopLayerElements{}), "DOM.getTopLayerElementsResult": reflect.TypeOf(DOMGetTopLayerElementsResult{}), + "DOM.getElementByRelation": reflect.TypeOf(DOMGetElementByRelation{}), + "DOM.getElementByRelationResult": reflect.TypeOf(DOMGetElementByRelationResult{}), "DOM.redo": reflect.TypeOf(DOMRedo{}), "DOM.removeAttribute": reflect.TypeOf(DOMRemoveAttribute{}), "DOM.removeNode": reflect.TypeOf(DOMRemoveNode{}), @@ -428,6 +434,8 @@ var types = map[string]reflect.Type{ "Emulation.setCPUThrottlingRate": reflect.TypeOf(EmulationSetCPUThrottlingRate{}), "Emulation.setDefaultBackgroundColorOverride": reflect.TypeOf(EmulationSetDefaultBackgroundColorOverride{}), "Emulation.setDeviceMetricsOverride": reflect.TypeOf(EmulationSetDeviceMetricsOverride{}), + "Emulation.setDevicePostureOverride": reflect.TypeOf(EmulationSetDevicePostureOverride{}), + "Emulation.clearDevicePostureOverride": reflect.TypeOf(EmulationClearDevicePostureOverride{}), "Emulation.setScrollbarsHidden": reflect.TypeOf(EmulationSetScrollbarsHidden{}), "Emulation.setDocumentCookieDisabled": reflect.TypeOf(EmulationSetDocumentCookieDisabled{}), "Emulation.setEmitTouchEventsForMouse": reflect.TypeOf(EmulationSetEmitTouchEventsForMouse{}), @@ -659,6 +667,7 @@ var types = map[string]reflect.Type{ "Network.webTransportClosed": reflect.TypeOf(NetworkWebTransportClosed{}), "Network.requestWillBeSentExtraInfo": reflect.TypeOf(NetworkRequestWillBeSentExtraInfo{}), "Network.responseReceivedExtraInfo": reflect.TypeOf(NetworkResponseReceivedExtraInfo{}), + "Network.responseReceivedEarlyHints": reflect.TypeOf(NetworkResponseReceivedEarlyHints{}), "Network.trustTokenOperationDone": reflect.TypeOf(NetworkTrustTokenOperationDone{}), "Network.subresourceWebBundleMetadataReceived": reflect.TypeOf(NetworkSubresourceWebBundleMetadataReceived{}), "Network.subresourceWebBundleMetadataError": reflect.TypeOf(NetworkSubresourceWebBundleMetadataError{}), @@ -744,6 +753,17 @@ var types = map[string]reflect.Type{ "Page.InstallabilityErrorArgument": reflect.TypeOf(PageInstallabilityErrorArgument{}), "Page.InstallabilityError": reflect.TypeOf(PageInstallabilityError{}), "Page.CompilationCacheParams": reflect.TypeOf(PageCompilationCacheParams{}), + "Page.FileFilter": reflect.TypeOf(PageFileFilter{}), + "Page.FileHandler": reflect.TypeOf(PageFileHandler{}), + "Page.ImageResource": reflect.TypeOf(PageImageResource{}), + "Page.LaunchHandler": reflect.TypeOf(PageLaunchHandler{}), + "Page.ProtocolHandler": reflect.TypeOf(PageProtocolHandler{}), + "Page.RelatedApplication": reflect.TypeOf(PageRelatedApplication{}), + "Page.ScopeExtension": reflect.TypeOf(PageScopeExtension{}), + "Page.Screenshot": reflect.TypeOf(PageScreenshot{}), + "Page.ShareTarget": reflect.TypeOf(PageShareTarget{}), + "Page.Shortcut": reflect.TypeOf(PageShortcut{}), + "Page.WebAppManifest": reflect.TypeOf(PageWebAppManifest{}), "Page.BackForwardCacheBlockingDetails": reflect.TypeOf(PageBackForwardCacheBlockingDetails{}), "Page.BackForwardCacheNotRestoredExplanation": reflect.TypeOf(PageBackForwardCacheNotRestoredExplanation{}), "Page.BackForwardCacheNotRestoredExplanationTree": reflect.TypeOf(PageBackForwardCacheNotRestoredExplanationTree{}), @@ -1140,6 +1160,12 @@ var types = map[string]reflect.Type{ "FedCm.resetCooldown": reflect.TypeOf(FedCmResetCooldown{}), "FedCm.dialogShown": reflect.TypeOf(FedCmDialogShown{}), "FedCm.dialogClosed": reflect.TypeOf(FedCmDialogClosed{}), + "PWA.FileHandlerAccept": reflect.TypeOf(PWAFileHandlerAccept{}), + "PWA.FileHandler": reflect.TypeOf(PWAFileHandler{}), + "PWA.getOsAppState": reflect.TypeOf(PWAGetOsAppState{}), + "PWA.getOsAppStateResult": reflect.TypeOf(PWAGetOsAppStateResult{}), + "PWA.install": reflect.TypeOf(PWAInstall{}), + "PWA.uninstall": reflect.TypeOf(PWAUninstall{}), "Console.ConsoleMessage": reflect.TypeOf(ConsoleConsoleMessage{}), "Console.clearMessages": reflect.TypeOf(ConsoleClearMessages{}), "Console.disable": reflect.TypeOf(ConsoleDisable{}), diff --git a/lib/proto/definitions_test.go b/lib/proto/definitions_test.go index 521c4c22..62212c07 100644 --- a/lib/proto/definitions_test.go +++ b/lib/proto/definitions_test.go @@ -139,6 +139,11 @@ func (t T) AnimationAnimationStarted() { t.Regex("", e.ProtoEvent()) } +func (t T) AnimationAnimationUpdated() { + e := proto.AnimationAnimationUpdated{} + t.Regex("", e.ProtoEvent()) +} + func (t T) AuditsGetEncodedResponse() { c := &Client{} _, err := proto.AuditsGetEncodedResponse{}.Call(c) @@ -174,6 +179,12 @@ func (t T) AuditsIssueAdded() { t.Regex("", e.ProtoEvent()) } +func (t T) ExtensionsLoadUnpacked() { + c := &Client{} + _, err := proto.ExtensionsLoadUnpacked{}.Call(c) + t.Nil(err) +} + func (t T) AutofillTrigger() { c := &Client{} err := proto.AutofillTrigger{}.Call(c) @@ -816,6 +827,12 @@ func (t T) DOMGetTopLayerElements() { t.Nil(err) } +func (t T) DOMGetElementByRelation() { + c := &Client{} + _, err := proto.DOMGetElementByRelation{}.Call(c) + t.Nil(err) +} + func (t T) DOMRedo() { c := &Client{} err := proto.DOMRedo{}.Call(c) @@ -1264,6 +1281,18 @@ func (t T) EmulationSetDeviceMetricsOverride() { t.Nil(err) } +func (t T) EmulationSetDevicePostureOverride() { + c := &Client{} + err := proto.EmulationSetDevicePostureOverride{}.Call(c) + t.Nil(err) +} + +func (t T) EmulationClearDevicePostureOverride() { + c := &Client{} + err := proto.EmulationClearDevicePostureOverride{}.Call(c) + t.Nil(err) +} + func (t T) EmulationSetScrollbarsHidden() { c := &Client{} err := proto.EmulationSetScrollbarsHidden{}.Call(c) @@ -2080,6 +2109,11 @@ func (t T) NetworkResponseReceivedExtraInfo() { t.Regex("", e.ProtoEvent()) } +func (t T) NetworkResponseReceivedEarlyHints() { + e := proto.NetworkResponseReceivedEarlyHints{} + t.Regex("", e.ProtoEvent()) +} + func (t T) NetworkTrustTokenOperationDone() { e := proto.NetworkTrustTokenOperationDone{} t.Regex("", e.ProtoEvent()) @@ -3864,6 +3898,24 @@ func (t T) FedCmDialogClosed() { t.Regex("", e.ProtoEvent()) } +func (t T) PWAGetOsAppState() { + c := &Client{} + _, err := proto.PWAGetOsAppState{}.Call(c) + t.Nil(err) +} + +func (t T) PWAInstall() { + c := &Client{} + err := proto.PWAInstall{}.Call(c) + t.Nil(err) +} + +func (t T) PWAUninstall() { + c := &Client{} + err := proto.PWAUninstall{}.Call(c) + t.Nil(err) +} + func (t T) ConsoleClearMessages() { c := &Client{} err := proto.ConsoleClearMessages{}.Call(c) diff --git a/lib/proto/dom.go b/lib/proto/dom.go index a1675725..ba5b981e 100644 --- a/lib/proto/dom.go +++ b/lib/proto/dom.go @@ -79,6 +79,12 @@ const ( // DOMPseudoTypeFirstLineInherited enum const. DOMPseudoTypeFirstLineInherited DOMPseudoType = "first-line-inherited" + // DOMPseudoTypeScrollMarker enum const. + DOMPseudoTypeScrollMarker DOMPseudoType = "scroll-marker" + + // DOMPseudoTypeScrollMarkers enum const. + DOMPseudoTypeScrollMarkers DOMPseudoType = "scroll-markers" + // DOMPseudoTypeScrollbar enum const. DOMPseudoTypeScrollbar DOMPseudoType = "scrollbar" @@ -1034,6 +1040,38 @@ type DOMGetTopLayerElementsResult struct { NodeIDs []DOMNodeID `json:"nodeIds"` } +// DOMGetElementByRelationRelation enum. +type DOMGetElementByRelationRelation string + +const ( + // DOMGetElementByRelationRelationPopoverTarget enum const. + DOMGetElementByRelationRelationPopoverTarget DOMGetElementByRelationRelation = "PopoverTarget" +) + +// DOMGetElementByRelation (experimental) Returns the NodeId of the matched element according to certain relations. +type DOMGetElementByRelation struct { + // NodeID Id of the node from which to query the relation. + NodeID DOMNodeID `json:"nodeId"` + + // Relation Type of relation to get. + Relation DOMGetElementByRelationRelation `json:"relation"` +} + +// ProtoReq name. +func (m DOMGetElementByRelation) ProtoReq() string { return "DOM.getElementByRelation" } + +// Call the request. +func (m DOMGetElementByRelation) Call(c Client) (*DOMGetElementByRelationResult, error) { + var res DOMGetElementByRelationResult + return &res, call(m.ProtoReq(), m, &res, c) +} + +// DOMGetElementByRelationResult (experimental) ... +type DOMGetElementByRelationResult struct { + // NodeID NodeId of the element matching the queried relation. + NodeID DOMNodeID `json:"nodeId"` +} + // DOMRedo (experimental) Re-does the last undone action. type DOMRedo struct{} diff --git a/lib/proto/emulation.go b/lib/proto/emulation.go index 3fa894e6..453ad1d0 100644 --- a/lib/proto/emulation.go +++ b/lib/proto/emulation.go @@ -415,8 +415,9 @@ type EmulationSetDeviceMetricsOverride struct { // is turned-off. DisplayFeature *EmulationDisplayFeature `json:"displayFeature,omitempty"` - // DevicePosture (experimental) (optional) If set, the posture of a foldable device. If not set the posture is set + // DevicePosture (deprecated) (experimental) (optional) If set, the posture of a foldable device. If not set the posture is set // to continuous. + // Deprecated, use Emulation.setDevicePostureOverride. DevicePosture *EmulationDevicePosture `json:"devicePosture,omitempty"` } @@ -430,6 +431,39 @@ func (m EmulationSetDeviceMetricsOverride) Call(c Client) error { return call(m.ProtoReq(), m, nil, c) } +// EmulationSetDevicePostureOverride (experimental) Start reporting the given posture value to the Device Posture API. +// This override can also be set in setDeviceMetricsOverride(). +type EmulationSetDevicePostureOverride struct { + // Posture ... + Posture *EmulationDevicePosture `json:"posture"` +} + +// ProtoReq name. +func (m EmulationSetDevicePostureOverride) ProtoReq() string { + return "Emulation.setDevicePostureOverride" +} + +// Call sends the request. +func (m EmulationSetDevicePostureOverride) Call(c Client) error { + return call(m.ProtoReq(), m, nil, c) +} + +// EmulationClearDevicePostureOverride (experimental) Clears a device posture override set with either setDeviceMetricsOverride() +// or setDevicePostureOverride() and starts using posture information from the +// platform again. +// Does nothing if no override is set. +type EmulationClearDevicePostureOverride struct{} + +// ProtoReq name. +func (m EmulationClearDevicePostureOverride) ProtoReq() string { + return "Emulation.clearDevicePostureOverride" +} + +// Call sends the request. +func (m EmulationClearDevicePostureOverride) Call(c Client) error { + return call(m.ProtoReq(), m, nil, c) +} + // EmulationSetScrollbarsHidden (experimental) ... type EmulationSetScrollbarsHidden struct { // Hidden Whether scrollbars should be always hidden. diff --git a/lib/proto/extensions.go b/lib/proto/extensions.go new file mode 100644 index 00000000..290a52b8 --- /dev/null +++ b/lib/proto/extensions.go @@ -0,0 +1,36 @@ +// This file is generated by "./lib/proto/generate" + +package proto + +/* + +Extensions + +Defines commands and events for browser extensions. Available if the client +is connected using the --remote-debugging-pipe flag and +the --enable-unsafe-extension-debugging flag is set. + +*/ + +// ExtensionsLoadUnpacked Installs an unpacked extension from the filesystem similar to +// --load-extension CLI flags. Returns extension ID once the extension +// has been installed. +type ExtensionsLoadUnpacked struct { + // Path Absolute file path. + Path string `json:"path"` +} + +// ProtoReq name. +func (m ExtensionsLoadUnpacked) ProtoReq() string { return "Extensions.loadUnpacked" } + +// Call the request. +func (m ExtensionsLoadUnpacked) Call(c Client) (*ExtensionsLoadUnpackedResult, error) { + var res ExtensionsLoadUnpackedResult + return &res, call(m.ProtoReq(), m, &res, c) +} + +// ExtensionsLoadUnpackedResult ... +type ExtensionsLoadUnpackedResult struct { + // ID Extension id. + ID string `json:"id"` +} diff --git a/lib/proto/network.go b/lib/proto/network.go index c36d48ba..6eb8bc95 100644 --- a/lib/proto/network.go +++ b/lib/proto/network.go @@ -727,11 +727,13 @@ const ( // NetworkServiceWorkerRouterInfo (experimental) ... type NetworkServiceWorkerRouterInfo struct { - // RuleIDMatched ... - RuleIDMatched int `json:"ruleIdMatched"` + // RuleIDMatched (optional) ID of the rule matched. If there is a matched rule, this field will + // be set, otherwiser no value will be set. + RuleIDMatched *int `json:"ruleIdMatched,omitempty"` - // MatchedSourceType ... - MatchedSourceType NetworkServiceWorkerRouterSource `json:"matchedSourceType"` + // MatchedSourceType (optional) The router source of the matched rule. If there is a matched rule, this + // field will be set, otherwise no value will be set. + MatchedSourceType NetworkServiceWorkerRouterSource `json:"matchedSourceType,omitempty"` } // NetworkResponse HTTP response data. @@ -784,7 +786,13 @@ type NetworkResponse struct { // FromPrefetchCache (optional) Specifies that the request was served from the prefetch cache. FromPrefetchCache bool `json:"fromPrefetchCache,omitempty"` - // ServiceWorkerRouterInfo (experimental) (optional) Information about how Service Worker Static Router was used. + // FromEarlyHints (optional) Specifies that the request was served from the prefetch cache. + FromEarlyHints bool `json:"fromEarlyHints,omitempty"` + + // ServiceWorkerRouterInfo (experimental) (optional) Information about how ServiceWorker Static Router API was used. If this + // field is set with `matchedSourceType` field, a matching rule is found. + // If this field is set without `matchedSource`, no matching rule is found. + // Otherwise, the API is not used. ServiceWorkerRouterInfo *NetworkServiceWorkerRouterInfo `json:"serviceWorkerRouterInfo,omitempty"` // EncodedDataLength Total number of bytes received for this request so far. @@ -1148,6 +1156,9 @@ type NetworkExemptedSetCookieWithReason struct { // ExemptionReason The reason the cookie was exempted. ExemptionReason NetworkCookieExemptionReason `json:"exemptionReason"` + // CookieLine The string representing this individual cookie as it would appear in the header. + CookieLine string `json:"cookieLine"` + // Cookie The cookie object representing the cookie. Cookie *NetworkCookie `json:"cookie"` } @@ -2899,6 +2910,22 @@ func (evt NetworkResponseReceivedExtraInfo) ProtoEvent() string { return "Network.responseReceivedExtraInfo" } +// NetworkResponseReceivedEarlyHints (experimental) Fired when 103 Early Hints headers is received in addition to the common response. +// Not every responseReceived event will have an responseReceivedEarlyHints fired. +// Only one responseReceivedEarlyHints may be fired for eached responseReceived event. +type NetworkResponseReceivedEarlyHints struct { + // RequestID Request identifier. Used to match this information to another responseReceived event. + RequestID NetworkRequestID `json:"requestId"` + + // Headers Raw response headers as they were received over the wire. + Headers NetworkHeaders `json:"headers"` +} + +// ProtoEvent name. +func (evt NetworkResponseReceivedEarlyHints) ProtoEvent() string { + return "Network.responseReceivedEarlyHints" +} + // NetworkTrustTokenOperationDoneStatus enum. type NetworkTrustTokenOperationDoneStatus string diff --git a/lib/proto/page.go b/lib/proto/page.go index b69ae83c..366d70a2 100644 --- a/lib/proto/page.go +++ b/lib/proto/page.go @@ -363,9 +363,6 @@ const ( // PagePermissionsPolicyFeatureWindowManagement enum const. PagePermissionsPolicyFeatureWindowManagement PagePermissionsPolicyFeature = "window-management" - // PagePermissionsPolicyFeatureWindowPlacement enum const. - PagePermissionsPolicyFeatureWindowPlacement PagePermissionsPolicyFeature = "window-placement" - // PagePermissionsPolicyFeatureXrSpatialTracking enum const. PagePermissionsPolicyFeatureXrSpatialTracking PagePermissionsPolicyFeature = "xr-spatial-tracking" ) @@ -949,6 +946,201 @@ type PageCompilationCacheParams struct { Eager bool `json:"eager,omitempty"` } +// PageFileFilter (experimental) ... +type PageFileFilter struct { + // Name (optional) ... + Name string `json:"name,omitempty"` + + // Accepts (optional) ... + Accepts []string `json:"accepts,omitempty"` +} + +// PageFileHandler (experimental) ... +type PageFileHandler struct { + // Action ... + Action string `json:"action"` + + // Name ... + Name string `json:"name"` + + // Icons (optional) ... + Icons []*PageImageResource `json:"icons,omitempty"` + + // Accepts (optional) Mimic a map, name is the key, accepts is the value. + Accepts []*PageFileFilter `json:"accepts,omitempty"` + + // LaunchType Won't repeat the enums, using string for easy comparison. Same as the + // other enums below. + LaunchType string `json:"launchType"` +} + +// PageImageResource (experimental) The image definition used in both icon and screenshot. +type PageImageResource struct { + // URL The src field in the definition, but changing to url in favor of + // consistency. + URL string `json:"url"` + + // Sizes (optional) ... + Sizes string `json:"sizes,omitempty"` + + // Type (optional) ... + Type string `json:"type,omitempty"` +} + +// PageLaunchHandler (experimental) ... +type PageLaunchHandler struct { + // ClientMode ... + ClientMode string `json:"clientMode"` +} + +// PageProtocolHandler (experimental) ... +type PageProtocolHandler struct { + // Protocol ... + Protocol string `json:"protocol"` + + // URL ... + URL string `json:"url"` +} + +// PageRelatedApplication (experimental) ... +type PageRelatedApplication struct { + // ID (optional) ... + ID string `json:"id,omitempty"` + + // URL ... + URL string `json:"url"` +} + +// PageScopeExtension (experimental) ... +type PageScopeExtension struct { + // Origin Instead of using tuple, this field always returns the serialized string + // for easy understanding and comparison. + Origin string `json:"origin"` + + // HasOriginWildcard ... + HasOriginWildcard bool `json:"hasOriginWildcard"` +} + +// PageScreenshot (experimental) ... +type PageScreenshot struct { + // Image ... + Image *PageImageResource `json:"image"` + + // FormFactor ... + FormFactor string `json:"formFactor"` + + // Label (optional) ... + Label string `json:"label,omitempty"` +} + +// PageShareTarget (experimental) ... +type PageShareTarget struct { + // Action ... + Action string `json:"action"` + + // Method ... + Method string `json:"method"` + + // Enctype ... + Enctype string `json:"enctype"` + + // Title (optional) Embed the ShareTargetParams + Title string `json:"title,omitempty"` + + // Text (optional) ... + Text string `json:"text,omitempty"` + + // URL (optional) ... + URL string `json:"url,omitempty"` + + // Files (optional) ... + Files []*PageFileFilter `json:"files,omitempty"` +} + +// PageShortcut (experimental) ... +type PageShortcut struct { + // Name ... + Name string `json:"name"` + + // URL ... + URL string `json:"url"` +} + +// PageWebAppManifest (experimental) ... +type PageWebAppManifest struct { + // BackgroundColor (optional) ... + BackgroundColor string `json:"backgroundColor,omitempty"` + + // Description (optional) The extra description provided by the manifest. + Description string `json:"description,omitempty"` + + // Dir (optional) ... + Dir string `json:"dir,omitempty"` + + // Display (optional) ... + Display string `json:"display,omitempty"` + + // DisplayOverrides (optional) The overrided display mode controlled by the user. + DisplayOverrides []string `json:"displayOverrides,omitempty"` + + // FileHandlers (optional) The handlers to open files. + FileHandlers []*PageFileHandler `json:"fileHandlers,omitempty"` + + // Icons (optional) ... + Icons []*PageImageResource `json:"icons,omitempty"` + + // ID (optional) ... + ID string `json:"id,omitempty"` + + // Lang (optional) ... + Lang string `json:"lang,omitempty"` + + // LaunchHandler (optional) TODO(crbug.com/1231886): This field is non-standard and part of a Chrome + // experiment. See: + // https://github.com/WICG/web-app-launch/blob/main/launch_handler.md + LaunchHandler *PageLaunchHandler `json:"launchHandler,omitempty"` + + // Name (optional) ... + Name string `json:"name,omitempty"` + + // Orientation (optional) ... + Orientation string `json:"orientation,omitempty"` + + // PreferRelatedApplications (optional) ... + PreferRelatedApplications bool `json:"preferRelatedApplications,omitempty"` + + // ProtocolHandlers (optional) The handlers to open protocols. + ProtocolHandlers []*PageProtocolHandler `json:"protocolHandlers,omitempty"` + + // RelatedApplications (optional) ... + RelatedApplications []*PageRelatedApplication `json:"relatedApplications,omitempty"` + + // Scope (optional) ... + Scope string `json:"scope,omitempty"` + + // ScopeExtensions (optional) Non-standard, see + // https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md + ScopeExtensions []*PageScopeExtension `json:"scopeExtensions,omitempty"` + + // Screenshots (optional) The screenshots used by chromium. + Screenshots []*PageScreenshot `json:"screenshots,omitempty"` + + // ShareTarget (optional) ... + ShareTarget *PageShareTarget `json:"shareTarget,omitempty"` + + // ShortName (optional) ... + ShortName string `json:"shortName,omitempty"` + + // Shortcuts (optional) ... + Shortcuts []*PageShortcut `json:"shortcuts,omitempty"` + + // StartURL (optional) ... + StartURL string `json:"startUrl,omitempty"` + + // ThemeColor (optional) ... + ThemeColor string `json:"themeColor,omitempty"` +} + // PageAutoResponseMode (experimental) Enum of possible auto-response for permission / prompt dialogs. type PageAutoResponseMode string @@ -1376,6 +1568,9 @@ const ( // PageBackForwardCacheNotRestoredReasonEmbedderExtensionSentMessageToCachedFrame enum const. PageBackForwardCacheNotRestoredReasonEmbedderExtensionSentMessageToCachedFrame PageBackForwardCacheNotRestoredReason = "EmbedderExtensionSentMessageToCachedFrame" + + // PageBackForwardCacheNotRestoredReasonRequestedByWebViewClient enum const. + PageBackForwardCacheNotRestoredReasonRequestedByWebViewClient PageBackForwardCacheNotRestoredReason = "RequestedByWebViewClient" ) // PageBackForwardCacheNotRestoredReasonType (experimental) Types of not restored reasons for back-forward cache. @@ -1686,8 +1881,16 @@ func (m PageEnable) Call(c Client) error { return call(m.ProtoReq(), m, nil, c) } -// PageGetAppManifest ... -type PageGetAppManifest struct{} +// PageGetAppManifest Gets the processed manifest for this current document. +// +// This API always waits for the manifest to be loaded. +// If manifestId is provided, and it does not match the manifest of the +// current document, this API errors out. +// If there is not a loaded page, this API errors out immediately. +type PageGetAppManifest struct { + // ManifestID (optional) ... + ManifestID string `json:"manifestId,omitempty"` +} // ProtoReq name. func (m PageGetAppManifest) ProtoReq() string { return "Page.getAppManifest" } @@ -1709,8 +1912,11 @@ type PageGetAppManifestResult struct { // Data (optional) Manifest content. Data string `json:"data,omitempty"` - // Parsed (experimental) (optional) Parsed manifest properties + // Parsed (deprecated) (experimental) (optional) Parsed manifest properties. Deprecated, use manifest instead. Parsed *PageAppManifestParsedProperties `json:"parsed,omitempty"` + + // Manifest (experimental) ... + Manifest *PageWebAppManifest `json:"manifest"` } // PageGetInstallabilityErrors (experimental) ... diff --git a/lib/proto/pwa.go b/lib/proto/pwa.go new file mode 100644 index 00000000..51249ff8 --- /dev/null +++ b/lib/proto/pwa.go @@ -0,0 +1,101 @@ +// This file is generated by "./lib/proto/generate" + +package proto + +/* + +PWA + +This domain allows interacting with the browser to control PWAs. + +*/ + +// PWAFileHandlerAccept The following types are the replica of +// https://crsrc.org/c/chrome/browser/web_applications/proto/web_app_os_integration_state.proto;drc=9910d3be894c8f142c977ba1023f30a656bc13fc;l=67 +type PWAFileHandlerAccept struct { + // MediaType New name of the mimetype according to + // https://www.iana.org/assignments/media-types/media-types.xhtml + MediaType string `json:"mediaType"` + + // FileExtensions ... + FileExtensions []string `json:"fileExtensions"` +} + +// PWAFileHandler ... +type PWAFileHandler struct { + // Action ... + Action string `json:"action"` + + // Accepts ... + Accepts []*PWAFileHandlerAccept `json:"accepts"` + + // DisplayName ... + DisplayName string `json:"displayName"` +} + +// PWAGetOsAppState Returns the following OS state for the given manifest id. +type PWAGetOsAppState struct { + // ManifestID The id from the webapp's manifest file, commonly it's the url of the + // site installing the webapp. See + // https://web.dev/learn/pwa/web-app-manifest. + ManifestID string `json:"manifestId"` +} + +// ProtoReq name. +func (m PWAGetOsAppState) ProtoReq() string { return "PWA.getOsAppState" } + +// Call the request. +func (m PWAGetOsAppState) Call(c Client) (*PWAGetOsAppStateResult, error) { + var res PWAGetOsAppStateResult + return &res, call(m.ProtoReq(), m, &res, c) +} + +// PWAGetOsAppStateResult ... +type PWAGetOsAppStateResult struct { + // BadgeCount ... + BadgeCount int `json:"badgeCount"` + + // FileHandlers ... + FileHandlers []*PWAFileHandler `json:"fileHandlers"` +} + +// PWAInstall Installs the given manifest identity, optionally using the given install_url +// or IWA bundle location. +// +// TODO(crbug.com/337872319) Support IWA to meet the following specific +// requirement. +// IWA-specific install description: If the manifest_id is isolated-app://, +// install_url_or_bundle_url is required, and can be either an http(s) URL or +// file:// URL pointing to a signed web bundle (.swbn). The .swbn file's +// signing key must correspond to manifest_id. If Chrome is not in IWA dev +// mode, the installation will fail, regardless of the state of the allowlist. +type PWAInstall struct { + // ManifestID ... + ManifestID string `json:"manifestId"` + + // InstallURLOrBundleURL (optional) The location of the app or bundle overriding the one derived from the + // manifestId. + InstallURLOrBundleURL string `json:"installUrlOrBundleUrl,omitempty"` +} + +// ProtoReq name. +func (m PWAInstall) ProtoReq() string { return "PWA.install" } + +// Call sends the request. +func (m PWAInstall) Call(c Client) error { + return call(m.ProtoReq(), m, nil, c) +} + +// PWAUninstall Uninstals the given manifest_id and closes any opened app windows. +type PWAUninstall struct { + // ManifestID ... + ManifestID string `json:"manifestId"` +} + +// ProtoReq name. +func (m PWAUninstall) ProtoReq() string { return "PWA.uninstall" } + +// Call sends the request. +func (m PWAUninstall) Call(c Client) error { + return call(m.ProtoReq(), m, nil, c) +} diff --git a/lib/proto/storage.go b/lib/proto/storage.go index b2f87eaa..9ff0b7c2 100644 --- a/lib/proto/storage.go +++ b/lib/proto/storage.go @@ -525,6 +525,9 @@ const ( // StorageAttributionReportingSourceRegistrationResultExceedsMaxChannelCapacity enum const. StorageAttributionReportingSourceRegistrationResultExceedsMaxChannelCapacity StorageAttributionReportingSourceRegistrationResult = "exceedsMaxChannelCapacity" + + // StorageAttributionReportingSourceRegistrationResultExceedsMaxTriggerStateCardinality enum const. + StorageAttributionReportingSourceRegistrationResultExceedsMaxTriggerStateCardinality StorageAttributionReportingSourceRegistrationResult = "exceedsMaxTriggerStateCardinality" ) // StorageAttributionReportingSourceRegistrationTimeConfig (experimental) ...