From 39a25b41c95120e666d4ab64bd17ef78a4bfaef9 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Sat, 17 Jul 2021 13:40:08 +0300 Subject: [PATCH] Update to latest protocol definitions --- cdp.go | 142 +++- cmd/cdpgen/protodef/js_protocol.json | 1156 ++++++++++++++++++++++++-- protocol/audits/types.go | 129 ++- protocol/browser/command.go | 8 + protocol/browser/domain.go | 42 + protocol/browser/event.go | 45 + protocol/css/command.go | 21 + protocol/css/domain.go | 15 + protocol/css/types.go | 20 +- protocol/debugger/command.go | 14 +- protocol/debugger/domain.go | 8 +- protocol/dom/command.go | 24 + protocol/dom/domain.go | 17 + protocol/dom/types.go | 90 +- protocol/domsnapshot/command.go | 39 + protocol/domsnapshot/types.go | 10 + protocol/emulation/types.go | 3 +- protocol/fetch/types.go | 4 +- protocol/input/command.go | 42 + protocol/input/domain.go | 50 ++ protocol/input/event.go | 22 + protocol/input/types.go | 18 + protocol/network/command.go | 26 +- protocol/network/domain.go | 121 ++- protocol/network/event.go | 65 ++ protocol/network/types.go | 46 +- protocol/overlay/command.go | 24 + protocol/overlay/domain.go | 30 +- protocol/overlay/types.go | 62 +- protocol/page/command.go | 19 +- protocol/page/domain.go | 21 + protocol/page/event.go | 29 +- protocol/page/types.go | 352 +++++++- protocol/webauthn/types.go | 1 + 34 files changed, 2517 insertions(+), 198 deletions(-) create mode 100644 protocol/browser/event.go create mode 100644 protocol/input/event.go diff --git a/cdp.go b/cdp.go index 2dbf2f4..20850da 100644 --- a/cdp.go +++ b/cdp.go @@ -399,6 +399,20 @@ type Browser interface { // // Note: This command is experimental. ExecuteBrowserCommand(context.Context, *browser.ExecuteBrowserCommandArgs) error + + // Event DownloadWillBegin + // + // Fired when page is about to start a download. + // + // Note: This event is experimental. + DownloadWillBegin(context.Context) (browser.DownloadWillBeginClient, error) + + // Event DownloadProgress + // + // Fired when download makes progress. Last call has |done| == true. + // + // Note: This event is experimental. + DownloadProgress(context.Context) (browser.DownloadProgressClient, error) } // The CSS domain. This domain exposes CSS read/write operations. All CSS @@ -520,6 +534,13 @@ type CSS interface { // Modifies the rule selector. SetMediaText(context.Context, *css.SetMediaTextArgs) (*css.SetMediaTextReply, error) + // Command SetContainerQueryText + // + // Modifies the expression of a container query. + // + // Note: This command is experimental. + SetContainerQueryText(context.Context, *css.SetContainerQueryTextArgs) (*css.SetContainerQueryTextReply, error) + // Command SetRuleSelector // // Modifies the rule selector. @@ -990,6 +1011,16 @@ type DOM interface { // Note: This command is experimental. GetFrameOwner(context.Context, *dom.GetFrameOwnerArgs) (*dom.GetFrameOwnerReply, error) + // Command GetContainerForNode + // + // Returns the container of the given node based on container query + // conditions. If containerName is given, it will find the nearest + // container with a matching name; otherwise it will find the nearest + // container regardless of its container name. + // + // Note: This command is experimental. + GetContainerForNode(context.Context, *dom.GetContainerForNodeArgs) (*dom.GetContainerForNodeReply, error) + // Event AttributeModified // // Fired when `Element`'s attribute is modified. @@ -1275,11 +1306,11 @@ type Debugger interface { // Returns source for the script with given id. GetScriptSource(context.Context, *debugger.GetScriptSourceArgs) (*debugger.GetScriptSourceReply, error) - // Command GetWasmBytecode + // Command GetWASMBytecode // // Deprecated: This command is deprecated. Use getScriptSource // instead. - GetWasmBytecode(context.Context, *debugger.GetWasmBytecodeArgs) (*debugger.GetWasmBytecodeReply, error) + GetWASMBytecode(context.Context, *debugger.GetWASMBytecodeArgs) (*debugger.GetWASMBytecodeReply, error) // Command GetStackTrace // @@ -1897,6 +1928,13 @@ type IndexedDB interface { // The Input domain. type Input interface { + // Command DispatchDragEvent + // + // Dispatches a drag event into the page. + // + // Note: This command is experimental. + DispatchDragEvent(context.Context, *input.DispatchDragEventArgs) error + // Command DispatchKeyEvent // // Dispatches a key event to the page. @@ -1932,6 +1970,15 @@ type Input interface { // Ignores input events (useful while auditing page). SetIgnoreInputEvents(context.Context, *input.SetIgnoreInputEventsArgs) error + // Command SetInterceptDrags + // + // Prevents default drag and drop behavior and instead emits + // `Input.dragIntercepted` events. Drag and drop behavior can be + // directly controlled via `Input.dispatchDragEvent`. + // + // Note: This command is experimental. + SetInterceptDrags(context.Context, *input.SetInterceptDragsArgs) error + // Command SynthesizePinchGesture // // Synthesizes a pinch gesture over a time period by issuing @@ -1955,6 +2002,15 @@ type Input interface { // // Note: This command is experimental. SynthesizeTapGesture(context.Context, *input.SynthesizeTapGestureArgs) error + + // Event DragIntercepted + // + // Emitted only when `Input.setInterceptDrags` is enabled. Use this + // data with `Input.dispatchDragEvent` to restore normal drag and drop + // behavior. + // + // Note: This event is experimental. + DragIntercepted(context.Context) (input.DragInterceptedClient, error) } // The Inspector domain. @@ -2182,6 +2238,21 @@ type Memory interface { // the page. It exposes information about http, file, data and other requests // and responses, their headers, bodies, timing, etc. type Network interface { + // Command SetAcceptedEncodings + // + // Sets a list of content encodings that will be accepted. Empty list + // means no encoding is accepted. + // + // Note: This command is experimental. + SetAcceptedEncodings(context.Context, *network.SetAcceptedEncodingsArgs) error + + // Command ClearAcceptedEncodingsOverride + // + // Clears accepted encodings set by setAcceptedEncodings + // + // Note: This command is experimental. + ClearAcceptedEncodingsOverride(context.Context) error + // Command CanClearBrowserCache // // Deprecated: Tells whether clearing browser cache is supported. @@ -2341,13 +2412,6 @@ type Network interface { // Sets given cookies. SetCookies(context.Context, *network.SetCookiesArgs) error - // Command SetDataSizeLimitsForTest - // - // For testing. - // - // Note: This command is experimental. - SetDataSizeLimitsForTest(context.Context, *network.SetDataSizeLimitsForTestArgs) error - // Command SetExtraHTTPHeaders // // Specifies whether to always send extra HTTP headers with the @@ -2523,6 +2587,37 @@ type Network interface { // // Note: This event is experimental. TrustTokenOperationDone(context.Context) (network.TrustTokenOperationDoneClient, error) + + // Event SubresourceWebBundleMetadataReceived + // + // Fired once when parsing the .wbn file has succeeded. The event + // contains the information about the web bundle contents. + // + // Note: This event is experimental. + SubresourceWebBundleMetadataReceived(context.Context) (network.SubresourceWebBundleMetadataReceivedClient, error) + + // Event SubresourceWebBundleMetadataError + // + // Fired once when parsing the .wbn file has failed. + // + // Note: This event is experimental. + SubresourceWebBundleMetadataError(context.Context) (network.SubresourceWebBundleMetadataErrorClient, error) + + // Event SubresourceWebBundleInnerResponseParsed + // + // Fired when handling requests for resources within a .wbn file. + // Note: this will only be fired for resources that are requested by + // the webpage. + // + // Note: This event is experimental. + SubresourceWebBundleInnerResponseParsed(context.Context) (network.SubresourceWebBundleInnerResponseParsedClient, error) + + // Event SubresourceWebBundleInnerResponseError + // + // Fired when request for resources within a .wbn file failed. + // + // Note: This event is experimental. + SubresourceWebBundleInnerResponseError(context.Context) (network.SubresourceWebBundleInnerResponseErrorClient, error) } // The Overlay domain. This domain provides various functionality related to @@ -2562,7 +2657,11 @@ type Overlay interface { // Command HighlightFrame // - // Highlights owner element of the frame with given id. + // Deprecated: Highlights owner element of the frame with given id. + // Deprecated: Doesn't work reliablity and cannot be fixed due to + // process separatation (the owner node might be in a different + // process). Determine the owner node in the client and use + // highlightNode. HighlightFrame(context.Context, *overlay.HighlightFrameArgs) error // Command HighlightNode @@ -2623,6 +2722,12 @@ type Overlay interface { // Command SetShowFlexOverlays SetShowFlexOverlays(context.Context, *overlay.SetShowFlexOverlaysArgs) error + // Command SetShowScrollSnapOverlays + SetShowScrollSnapOverlays(context.Context, *overlay.SetShowScrollSnapOverlaysArgs) error + + // Command SetShowContainerQueryOverlays + SetShowContainerQueryOverlays(context.Context, *overlay.SetShowContainerQueryOverlaysArgs) error + // Command SetShowPaintRects // // Requests that backend shows paint rectangles @@ -3064,14 +3169,16 @@ type Page interface { // Event DownloadWillBegin // - // Fired when page is about to start a download. + // Deprecated: Fired when page is about to start a download. + // Deprecated. Use Browser.downloadWillBegin instead. // // Note: This event is experimental. DownloadWillBegin(context.Context) (page.DownloadWillBeginClient, error) // Event DownloadProgress // - // Fired when download makes progress. Last call has |done| == true. + // Deprecated: Fired when download makes progress. Last call has + // |done| == true. Deprecated. Use Browser.downloadProgress instead. // // Note: This event is experimental. DownloadProgress(context.Context) (page.DownloadProgressClient, error) @@ -3104,6 +3211,17 @@ type Page interface { // paint, etc. LifecycleEvent(context.Context) (page.LifecycleEventClient, error) + // Event BackForwardCacheNotUsed + // + // Fired for failed bfcache history navigations if BackForwardCache + // feature is enabled. Do not assume any ordering with the + // Page.frameNavigated event. This event is fired only for main-frame + // history navigation where the document changes (non-same-document + // navigations), when bfcache navigation fails. + // + // Note: This event is experimental. + BackForwardCacheNotUsed(context.Context) (page.BackForwardCacheNotUsedClient, error) + // Event LoadEventFired LoadEventFired(context.Context) (page.LoadEventFiredClient, error) diff --git a/cmd/cdpgen/protodef/js_protocol.json b/cmd/cdpgen/protodef/js_protocol.json index a54fd2a..a2a9592 100644 --- a/cmd/cdpgen/protodef/js_protocol.json +++ b/cmd/cdpgen/protodef/js_protocol.json @@ -1051,7 +1051,8 @@ "ExcludeSameSiteUnspecifiedTreatedAsLax", "ExcludeSameSiteNoneInsecure", "ExcludeSameSiteLax", - "ExcludeSameSiteStrict" + "ExcludeSameSiteStrict", + "ExcludeInvalidSameParty" ] }, { @@ -1083,8 +1084,15 @@ "properties": [ { "name": "cookie", + "description": "If AffectedCookie is not set then rawCookieLine contains the raw\nSet-Cookie header string. This hints at a problem where the\ncookie line is syntactically or semantically malformed in a way\nthat no valid cookie could be created.", + "optional": true, "$ref": "AffectedCookie" }, + { + "name": "rawCookieLine", + "optional": true, + "type": "string" + }, { "name": "cookieWarningReasons", "type": "array", @@ -1360,7 +1368,7 @@ }, { "id": "SharedArrayBufferIssueDetails", - "description": "Details for a issue arising from an SAB being instantiated in, or\ntransfered to a context that is not cross-origin isolated.", + "description": "Details for a issue arising from an SAB being instantiated in, or\ntransferred to a context that is not cross-origin isolated.", "type": "object", "properties": [ { @@ -1469,6 +1477,16 @@ "name": "request", "$ref": "AffectedRequest" }, + { + "name": "location", + "optional": true, + "$ref": "SourceCodeLocation" + }, + { + "name": "initiatorOrigin", + "optional": true, + "type": "string" + }, { "name": "resourceIPAddressSpace", "optional": true, @@ -1481,6 +1499,113 @@ } ] }, + { + "id": "AttributionReportingIssueType", + "type": "string", + "enum": [ + "PermissionPolicyDisabled", + "InvalidAttributionSourceEventId", + "InvalidAttributionData", + "AttributionSourceUntrustworthyOrigin", + "AttributionUntrustworthyOrigin" + ] + }, + { + "id": "AttributionReportingIssueDetails", + "description": "Details for issues around \"Attribution Reporting API\" usage.\nExplainer: https://github.com/WICG/conversion-measurement-api", + "type": "object", + "properties": [ + { + "name": "violationType", + "$ref": "AttributionReportingIssueType" + }, + { + "name": "frame", + "optional": true, + "$ref": "AffectedFrame" + }, + { + "name": "request", + "optional": true, + "$ref": "AffectedRequest" + }, + { + "name": "violatingNodeId", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "invalidParameter", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "QuirksModeIssueDetails", + "description": "Details for issues about documents in Quirks Mode\nor Limited Quirks Mode that affects page layouting.", + "type": "object", + "properties": [ + { + "name": "isLimitedQuirksMode", + "description": "If false, it means the document's mode is \"quirks\"\ninstead of \"limited-quirks\".", + "type": "boolean" + }, + { + "name": "documentNodeId", + "$ref": "DOM.BackendNodeId" + }, + { + "name": "url", + "type": "string" + }, + { + "name": "frameId", + "$ref": "Page.FrameId" + }, + { + "name": "loaderId", + "$ref": "Network.LoaderId" + } + ] + }, + { + "id": "NavigatorUserAgentIssueDetails", + "type": "object", + "properties": [ + { + "name": "url", + "type": "string" + }, + { + "name": "location", + "optional": true, + "$ref": "SourceCodeLocation" + } + ] + }, + { + "id": "WasmCrossOriginModuleSharingIssueDetails", + "type": "object", + "properties": [ + { + "name": "wasmModuleUrl", + "type": "string" + }, + { + "name": "sourceOrigin", + "type": "string" + }, + { + "name": "targetOrigin", + "type": "string" + }, + { + "name": "isWarning", + "type": "boolean" + } + ] + }, { "id": "InspectorIssueCode", "description": "A unique identifier for the type of issue. Each type may use one of the\noptional fields in InspectorIssueDetails to convey more specific\ninformation about the kind of issue.", @@ -1494,7 +1619,11 @@ "SharedArrayBufferIssue", "TrustedWebActivityIssue", "LowTextContrastIssue", - "CorsIssue" + "CorsIssue", + "AttributionReportingIssue", + "QuirksModeIssue", + "NavigatorUserAgentIssue", + "WasmCrossOriginModuleSharingIssue" ] }, { @@ -1546,9 +1675,34 @@ "name": "corsIssueDetails", "optional": true, "$ref": "CorsIssueDetails" + }, + { + "name": "attributionReportingIssueDetails", + "optional": true, + "$ref": "AttributionReportingIssueDetails" + }, + { + "name": "quirksModeIssueDetails", + "optional": true, + "$ref": "QuirksModeIssueDetails" + }, + { + "name": "navigatorUserAgentIssueDetails", + "optional": true, + "$ref": "NavigatorUserAgentIssueDetails" + }, + { + "name": "wasmCrossOriginModuleSharingIssue", + "optional": true, + "$ref": "WasmCrossOriginModuleSharingIssueDetails" } ] }, + { + "id": "IssueId", + "description": "A unique id for a DevTools inspector issue. Allows other entities (e.g.\nexceptions, CDP message, console messages, etc.) to reference an issue.", + "type": "string" + }, { "id": "InspectorIssue", "description": "An inspector issue reported from the back-end.", @@ -1561,6 +1715,12 @@ { "name": "details", "$ref": "InspectorIssueDetails" + }, + { + "name": "issueId", + "description": "A unique id for this issue. May be omitted if no other entity (e.g.\nexception, CDP message, etc.) is referencing this issue.", + "optional": true, + "$ref": "IssueId" } ] } @@ -2100,9 +2260,15 @@ }, { "name": "downloadPath", - "description": "The default path to save downloaded files to. This is requred if behavior is set to 'allow'\nor 'allowAndName'.", + "description": "The default path to save downloaded files to. This is required if behavior is set to 'allow'\nor 'allowAndName'.", "optional": true, "type": "string" + }, + { + "name": "eventsEnabled", + "description": "Whether to emit download events (defaults to false).", + "optional": true, + "type": "boolean" } ] }, @@ -2328,6 +2494,67 @@ } ] } + ], + "events": [ + { + "name": "downloadWillBegin", + "description": "Fired when page is about to start a download.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame that caused the download to begin.", + "$ref": "Page.FrameId" + }, + { + "name": "guid", + "description": "Global unique identifier of the download.", + "type": "string" + }, + { + "name": "url", + "description": "URL of the resource being downloaded.", + "type": "string" + }, + { + "name": "suggestedFilename", + "description": "Suggested file name of the resource (the actual name of the file saved on disk may differ).", + "type": "string" + } + ] + }, + { + "name": "downloadProgress", + "description": "Fired when download makes progress. Last call has |done| == true.", + "experimental": true, + "parameters": [ + { + "name": "guid", + "description": "Global unique identifier of the download.", + "type": "string" + }, + { + "name": "totalBytes", + "description": "Total expected bytes to download.", + "type": "number" + }, + { + "name": "receivedBytes", + "description": "Total bytes received.", + "type": "number" + }, + { + "name": "state", + "description": "Download status.", + "type": "string", + "enum": [ + "inProgress", + "completed", + "canceled" + ] + } + ] + } ] }, { @@ -2470,7 +2697,7 @@ }, { "name": "sourceURL", - "description": "Stylesheet resource URL.", + "description": "Stylesheet resource URL. Empty if this is a constructed stylesheet created using\nnew CSSStyleSheet() (but non-empty if this is a constructed sylesheet imported\nas a CSS module script).", "type": "string" }, { @@ -2518,7 +2745,7 @@ }, { "name": "isConstructed", - "description": "Whether this stylesheet is a constructed stylesheet (created using new CSSStyleSheet()).", + "description": "True if this stylesheet is created through new CSSStyleSheet() or imported as a\nCSS module script.", "type": "boolean" }, { @@ -2582,6 +2809,16 @@ "items": { "$ref": "CSSMedia" } + }, + { + "name": "containerQueries", + "description": "Container query list array (for rules involving container queries).\nThe array enumerates container queries starting with the innermost one, going outwards.", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "$ref": "CSSContainerQuery" + } } ] }, @@ -2875,6 +3112,37 @@ } ] }, + { + "id": "CSSContainerQuery", + "description": "CSS container query rule descriptor.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "text", + "description": "Container query text.", + "type": "string" + }, + { + "name": "range", + "description": "The associated rule header range in the enclosing stylesheet (if\navailable).", + "optional": true, + "$ref": "SourceRange" + }, + { + "name": "styleSheetId", + "description": "Identifier of the stylesheet containing this object (if exists).", + "optional": true, + "$ref": "StyleSheetId" + }, + { + "name": "name", + "description": "Optional name for the container.", + "optional": true, + "type": "string" + } + ] + }, { "id": "PlatformFontUsage", "description": "Information about amount of glyphs that were rendered with given font.", @@ -3435,6 +3703,32 @@ } ] }, + { + "name": "setContainerQueryText", + "description": "Modifies the expression of a container query.", + "experimental": true, + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + }, + { + "name": "range", + "$ref": "SourceRange" + }, + { + "name": "text", + "type": "string" + } + ], + "returns": [ + { + "name": "containerQuery", + "description": "The resulting CSS container query rule after modification.", + "$ref": "CSSContainerQuery" + } + ] + }, { "name": "setRuleSelector", "description": "Modifies the rule selector.", @@ -4006,6 +4300,7 @@ "target-text", "spelling-error", "grammar-error", + "highlight", "first-line-inherited", "scrollbar", "scrollbar-thumb", @@ -4027,6 +4322,16 @@ "closed" ] }, + { + "id": "CompatibilityMode", + "description": "Document compatibility mode.", + "type": "string", + "enum": [ + "QuirksMode", + "LimitedQuirksMode", + "NoQuirksMode" + ] + }, { "id": "Node", "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.\nDOMNode is a base node mirror type.", @@ -4190,7 +4495,8 @@ }, { "name": "importedDocument", - "description": "Import document for the HTMLImport links.", + "description": "Deprecated, as the HTML Imports API has been removed (crbug.com/937746).\nThis property used to return the imported document for the HTMLImport links.\nThe property is always undefined now.", + "deprecated": true, "optional": true, "$ref": "Node" }, @@ -4208,6 +4514,11 @@ "description": "Whether the node is SVG.", "optional": true, "type": "boolean" + }, + { + "name": "compatibilityMode", + "optional": true, + "$ref": "CompatibilityMode" } ] }, @@ -5340,6 +5651,30 @@ "$ref": "NodeId" } ] + }, + { + "name": "getContainerForNode", + "description": "Returns the container of the given node based on container query conditions.\nIf containerName is given, it will find the nearest container with a matching name;\notherwise it will find the nearest container regardless of its container name.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "$ref": "NodeId" + }, + { + "name": "containerName", + "optional": true, + "type": "string" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "The container node for the given node, or null if not found.", + "optional": true, + "$ref": "NodeId" + } + ] } ], "events": [ @@ -5451,12 +5786,12 @@ }, { "name": "distributedNodesUpdated", - "description": "Called when distrubution is changed.", + "description": "Called when distribution is changed.", "experimental": true, "parameters": [ { "name": "insertionPointId", - "description": "Insertion point where distrubuted nodes were updated.", + "description": "Insertion point where distributed nodes were updated.", "$ref": "NodeId" }, { @@ -6312,6 +6647,12 @@ "type": "integer" } }, + { + "name": "shadowRootType", + "description": "Type of the shadow root the `Node` is in. String values are equal to the `ShadowRootType` enum.", + "optional": true, + "$ref": "RareStringData" + }, { "name": "nodeName", "description": "`Node`'s nodeName.", @@ -6481,6 +6822,26 @@ "items": { "$ref": "Rectangle" } + }, + { + "name": "blendedBackgroundColors", + "description": "The list of background colors that are blended with colors of overlapping elements.", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "$ref": "StringIndex" + } + }, + { + "name": "textColorOpacities", + "description": "The list of computed text opacities.", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "type": "number" + } } ] }, @@ -6615,6 +6976,20 @@ "description": "Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot", "optional": true, "type": "boolean" + }, + { + "name": "includeBlendedBackgroundColors", + "description": "Whether to include blended background colors in the snapshot (default: false).\nBlended background color is achieved by blending background colors of all elements\nthat overlap with the current element.", + "experimental": true, + "optional": true, + "type": "boolean" + }, + { + "name": "includeTextColorOpacities", + "description": "Whether to include text color opacity in the snapshot (default: false).\nAn element might have the opacity property set that affects the text color of the element.\nThe final text color opacity is computed based on the opacity of all overlapping elements.", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ @@ -7106,6 +7481,7 @@ "type": "string", "enum": [ "avif", + "jxl", "webp" ] } @@ -7124,11 +7500,11 @@ }, { "name": "clearDeviceMetricsOverride", - "description": "Clears the overriden device metrics." + "description": "Clears the overridden device metrics." }, { "name": "clearGeolocationOverride", - "description": "Clears the overriden Geolocation Position and Error." + "description": "Clears the overridden Geolocation Position and Error." }, { "name": "resetPageScaleFactor", @@ -7471,7 +7847,7 @@ }, { "name": "initialVirtualTime", - "description": "If set, base::Time::Now will be overriden to initially return this value.", + "description": "If set, base::Time::Now will be overridden to initially return this value.", "optional": true, "$ref": "Network.TimeSinceEpoch" } @@ -7687,7 +8063,7 @@ "types": [ { "id": "StreamHandle", - "description": "This is either obtained from another method or specifed as `blob:<uuid>` where\n`<uuid>` is an UUID of a Blob.", + "description": "This is either obtained from another method or specified as `blob:<uuid>` where\n`<uuid>` is an UUID of a Blob.", "type": "string" } ], @@ -7739,7 +8115,7 @@ }, { "name": "eof", - "description": "Set if the end-of-file condition occured while reading.", + "description": "Set if the end-of-file condition occurred while reading.", "type": "boolean" } ] @@ -8290,9 +8666,95 @@ "id": "TimeSinceEpoch", "description": "UTC time in seconds, counted from January 1, 1970.", "type": "number" + }, + { + "id": "DragDataItem", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "mimeType", + "description": "Mime type of the dragged data.", + "type": "string" + }, + { + "name": "data", + "description": "Depending of the value of `mimeType`, it contains the dragged link,\ntext, HTML markup or any other data.", + "type": "string" + }, + { + "name": "title", + "description": "Title associated with a link. Only valid when `mimeType` == \"text/uri-list\".", + "optional": true, + "type": "string" + }, + { + "name": "baseURL", + "description": "Stores the base URL for the contained markup. Only valid when `mimeType`\n== \"text/html\".", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "DragData", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "items", + "type": "array", + "items": { + "$ref": "DragDataItem" + } + }, + { + "name": "dragOperationsMask", + "description": "Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16", + "type": "integer" + } + ] } ], "commands": [ + { + "name": "dispatchDragEvent", + "description": "Dispatches a drag event into the page.", + "experimental": true, + "parameters": [ + { + "name": "type", + "description": "Type of the drag event.", + "type": "string", + "enum": [ + "dragEnter", + "dragOver", + "drop", + "dragCancel" + ] + }, + { + "name": "x", + "description": "X coordinate of the event relative to the main frame's viewport in CSS pixels.", + "type": "number" + }, + { + "name": "y", + "description": "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\nthe top of the viewport and Y increases as it proceeds towards the bottom of the viewport.", + "type": "number" + }, + { + "name": "data", + "$ref": "DragData" + }, + { + "name": "modifiers", + "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0).", + "optional": true, + "type": "integer" + } + ] + }, { "name": "dispatchKeyEvent", "description": "Dispatches a key event to the page.", @@ -8635,6 +9097,17 @@ } ] }, + { + "name": "setInterceptDrags", + "description": "Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events.\nDrag and drop behavior can be directly controlled via `Input.dispatchDragEvent`.", + "experimental": true, + "parameters": [ + { + "name": "enabled", + "type": "boolean" + } + ] + }, { "name": "synthesizePinchGesture", "description": "Synthesizes a pinch gesture over a time period by issuing appropriate touch events.", @@ -8781,6 +9254,19 @@ } ] } + ], + "events": [ + { + "name": "dragIntercepted", + "description": "Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to\nrestore normal drag and drop behavior.", + "experimental": true, + "parameters": [ + { + "name": "data", + "$ref": "DragData" + } + ] + } ] }, { @@ -9937,6 +10423,13 @@ "experimental": true, "optional": true, "$ref": "TrustTokenParams" + }, + { + "name": "isSameSite", + "description": "True if this resource request is considered to be the 'same site' as the\nrequest correspondinfg to the main frame.", + "experimental": true, + "optional": true, + "type": "boolean" } ] }, @@ -10125,7 +10618,8 @@ "MethodDisallowedByPreflightResponse", "HeaderDisallowedByPreflightResponse", "RedirectContainsCredentials", - "InsecurePrivateNetwork" + "InsecurePrivateNetwork", + "NoCorsRedirectModeNotFollow" ] }, { @@ -10825,7 +11319,7 @@ "properties": [ { "name": "urlPattern", - "description": "Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is\nbackslash. Omitting is equivalent to \"*\".", + "description": "Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is\nbackslash. Omitting is equivalent to `\"*\"`.", "optional": true, "type": "string" }, @@ -10837,7 +11331,7 @@ }, { "name": "interceptionStage", - "description": "Stage at wich to begin intercepting requests. Default is Request.", + "description": "Stage at which to begin intercepting requests. Default is Request.", "optional": true, "$ref": "InterceptionStage" } @@ -11011,6 +11505,17 @@ } ] }, + { + "id": "ContentEncoding", + "description": "List of content encodings supported by the backend.", + "experimental": true, + "type": "string", + "enum": [ + "deflate", + "gzip", + "br" + ] + }, { "id": "PrivateNetworkRequestPolicy", "experimental": true, @@ -11093,7 +11598,7 @@ "type": "string", "enum": [ "None", - "CorsOrCredentialless", + "Credentialless", "RequireCorp" ] }, @@ -11197,6 +11702,26 @@ } ], "commands": [ + { + "name": "setAcceptedEncodings", + "description": "Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.", + "experimental": true, + "parameters": [ + { + "name": "encodings", + "description": "List of accepted content encodings.", + "type": "array", + "items": { + "$ref": "ContentEncoding" + } + } + ] + }, + { + "name": "clearAcceptedEncodingsOverride", + "description": "Clears accepted encodings set by setAcceptedEncodings", + "experimental": true + }, { "name": "canClearBrowserCache", "description": "Tells whether clearing browser cache is supported.", @@ -11725,23 +12250,6 @@ } ] }, - { - "name": "setDataSizeLimitsForTest", - "description": "For testing.", - "experimental": true, - "parameters": [ - { - "name": "maxTotalSize", - "description": "Maximum total buffer size.", - "type": "integer" - }, - { - "name": "maxResourceSize", - "description": "Maximum per-resource size.", - "type": "integer" - } - ] - }, { "name": "setExtraHTTPHeaders", "description": "Specifies whether to always send extra HTTP headers with the requests from this page.", @@ -12535,7 +13043,95 @@ "name": "issuedTokenCount", "description": "The number of obtained Trust Tokens on a successful \"Issuance\" operation.", "optional": true, - "type": "integer" + "type": "integer" + } + ] + }, + { + "name": "subresourceWebBundleMetadataReceived", + "description": "Fired once when parsing the .wbn file has succeeded.\nThe event contains the information about the web bundle contents.", + "experimental": true, + "parameters": [ + { + "name": "requestId", + "description": "Request identifier. Used to match this information to another event.", + "$ref": "RequestId" + }, + { + "name": "urls", + "description": "A list of URLs of resources in the subresource Web Bundle.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "subresourceWebBundleMetadataError", + "description": "Fired once when parsing the .wbn file has failed.", + "experimental": true, + "parameters": [ + { + "name": "requestId", + "description": "Request identifier. Used to match this information to another event.", + "$ref": "RequestId" + }, + { + "name": "errorMessage", + "description": "Error message", + "type": "string" + } + ] + }, + { + "name": "subresourceWebBundleInnerResponseParsed", + "description": "Fired when handling requests for resources within a .wbn file.\nNote: this will only be fired for resources that are requested by the webpage.", + "experimental": true, + "parameters": [ + { + "name": "innerRequestId", + "description": "Request identifier of the subresource request", + "$ref": "RequestId" + }, + { + "name": "innerRequestURL", + "description": "URL of the subresource resource.", + "type": "string" + }, + { + "name": "bundleRequestId", + "description": "Bundle request identifier. Used to match this information to another event.\nThis made be absent in case when the instrumentation was enabled only\nafter webbundle was parsed.", + "optional": true, + "$ref": "RequestId" + } + ] + }, + { + "name": "subresourceWebBundleInnerResponseError", + "description": "Fired when request for resources within a .wbn file failed.", + "experimental": true, + "parameters": [ + { + "name": "innerRequestId", + "description": "Request identifier of the subresource request", + "$ref": "RequestId" + }, + { + "name": "innerRequestURL", + "description": "URL of the subresource resource.", + "type": "string" + }, + { + "name": "errorMessage", + "description": "Error message", + "type": "string" + }, + { + "name": "bundleRequestId", + "description": "Bundle request identifier. Used to match this information to another event.\nThis made be absent in case when the instrumentation was enabled only\nafter webbundle was parsed.", + "optional": true, + "$ref": "RequestId" } ] } @@ -12940,6 +13536,12 @@ "description": "The contrast algorithm to use for the contrast ratio (default: aa).", "optional": true, "$ref": "ContrastAlgorithm" + }, + { + "name": "containerQueryContainerHighlightConfig", + "description": "The container query container highlight configuration (default: all transparent).", + "optional": true, + "$ref": "ContainerQueryContainerHighlightConfig" } ] }, @@ -12985,6 +13587,52 @@ } ] }, + { + "id": "ScrollSnapContainerHighlightConfig", + "type": "object", + "properties": [ + { + "name": "snapportBorder", + "description": "The style of the snapport border (default: transparent)", + "optional": true, + "$ref": "LineStyle" + }, + { + "name": "snapAreaBorder", + "description": "The style of the snap area border (default: transparent)", + "optional": true, + "$ref": "LineStyle" + }, + { + "name": "scrollMarginColor", + "description": "The margin highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "scrollPaddingColor", + "description": "The padding highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + } + ] + }, + { + "id": "ScrollSnapHighlightConfig", + "type": "object", + "properties": [ + { + "name": "scrollSnapContainerHighlightConfig", + "description": "A descriptor for the highlight appearance of scroll snap containers.", + "$ref": "ScrollSnapContainerHighlightConfig" + }, + { + "name": "nodeId", + "description": "Identifier of the node to highlight.", + "$ref": "DOM.NodeId" + } + ] + }, { "id": "HingeConfig", "description": "Configuration for dual screen hinge", @@ -13009,6 +13657,34 @@ } ] }, + { + "id": "ContainerQueryHighlightConfig", + "type": "object", + "properties": [ + { + "name": "containerQueryContainerHighlightConfig", + "description": "A descriptor for the highlight appearance of container query containers.", + "$ref": "ContainerQueryContainerHighlightConfig" + }, + { + "name": "nodeId", + "description": "Identifier of the container node to highlight.", + "$ref": "DOM.NodeId" + } + ] + }, + { + "id": "ContainerQueryContainerHighlightConfig", + "type": "object", + "properties": [ + { + "name": "containerBorder", + "description": "The style of the container border", + "optional": true, + "$ref": "LineStyle" + } + ] + }, { "id": "InspectMode", "type": "string", @@ -13117,7 +13793,8 @@ }, { "name": "highlightFrame", - "description": "Highlights owner element of the frame with given id.", + "description": "Highlights owner element of the frame with given id.\nDeprecated: Doesn't work reliablity and cannot be fixed due to process\nseparatation (the owner node might be in a different process). Determine\nthe owner node in the client and use highlightNode.", + "deprecated": true, "parameters": [ { "name": "frameId", @@ -13351,6 +14028,32 @@ } ] }, + { + "name": "setShowScrollSnapOverlays", + "parameters": [ + { + "name": "scrollSnapHighlightConfigs", + "description": "An array of node identifiers and descriptors for the highlight appearance.", + "type": "array", + "items": { + "$ref": "ScrollSnapHighlightConfig" + } + } + ] + }, + { + "name": "setShowContainerQueryOverlays", + "parameters": [ + { + "name": "containerQueryHighlightConfigs", + "description": "An array of node identifiers and descriptors for the highlight appearance.", + "type": "array", + "items": { + "$ref": "ContainerQueryHighlightConfig" + } + } + ] + }, { "name": "setShowPaintRects", "description": "Requests that backend shows paint rectangles", @@ -13495,6 +14198,36 @@ "root" ] }, + { + "id": "AdFrameExplanation", + "experimental": true, + "type": "string", + "enum": [ + "ParentIsAd", + "CreatedByAdScript", + "MatchedBlockingRule" + ] + }, + { + "id": "AdFrameStatus", + "description": "Indicates whether a frame has been identified as an ad and why.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "adFrameType", + "$ref": "AdFrameType" + }, + { + "name": "explanations", + "optional": true, + "type": "array", + "items": { + "$ref": "AdFrameExplanation" + } + } + ] + }, { "id": "SecureContextType", "description": "Indicates whether the frame is a secure context and why it is the case.", @@ -13531,12 +14264,13 @@ }, { "id": "PermissionsPolicyFeature", - "description": "All Permissions Policy features. This enum should match the one defined\nin renderer/core/feature_policy/feature_policy_features.json5.", + "description": "All Permissions Policy features. This enum should match the one defined\nin third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5.", "experimental": true, "type": "string", "enum": [ "accelerometer", "ambient-light-sensor", + "attribution-reporting", "autoplay", "camera", "ch-dpr", @@ -13544,9 +14278,11 @@ "ch-downlink", "ch-ect", "ch-lang", + "ch-prefers-color-scheme", "ch-rtt", "ch-ua", "ch-ua-arch", + "ch-ua-bitness", "ch-ua-platform", "ch-ua-model", "ch-ua-mobile", @@ -13556,8 +14292,8 @@ "ch-width", "clipboard-read", "clipboard-write", - "conversion-measurement", "cross-origin-isolated", + "direct-sockets", "display-capture", "document-domain", "encrypted-media", @@ -13581,12 +14317,14 @@ "publickey-credentials-get", "screen-wake-lock", "serial", + "shared-autofill", "storage-access-api", "sync-xhr", "trust-token-redemption", "usb", "vertical-scroll", "web-share", + "window-placement", "xr-spatial-tracking" ] }, @@ -13635,6 +14373,120 @@ } ] }, + { + "id": "OriginTrialTokenStatus", + "description": "Origin Trial(https://www.chromium.org/blink/origin-trials) support.\nStatus for an Origin Trial token.", + "experimental": true, + "type": "string", + "enum": [ + "Success", + "NotSupported", + "Insecure", + "Expired", + "WrongOrigin", + "InvalidSignature", + "Malformed", + "WrongVersion", + "FeatureDisabled", + "TokenDisabled", + "FeatureDisabledForUser" + ] + }, + { + "id": "OriginTrialStatus", + "description": "Status for an Origin Trial.", + "experimental": true, + "type": "string", + "enum": [ + "Enabled", + "ValidTokenNotProvided", + "OSNotSupported", + "TrialNotAllowed" + ] + }, + { + "id": "OriginTrialUsageRestriction", + "experimental": true, + "type": "string", + "enum": [ + "None", + "Subset" + ] + }, + { + "id": "OriginTrialToken", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "origin", + "type": "string" + }, + { + "name": "matchSubDomains", + "type": "boolean" + }, + { + "name": "trialName", + "type": "string" + }, + { + "name": "expiryTime", + "$ref": "Network.TimeSinceEpoch" + }, + { + "name": "isThirdParty", + "type": "boolean" + }, + { + "name": "usageRestriction", + "$ref": "OriginTrialUsageRestriction" + } + ] + }, + { + "id": "OriginTrialTokenWithStatus", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "rawTokenText", + "type": "string" + }, + { + "name": "parsedToken", + "description": "`parsedToken` is present only when the token is extractable and\nparsable.", + "optional": true, + "$ref": "OriginTrialToken" + }, + { + "name": "status", + "$ref": "OriginTrialTokenStatus" + } + ] + }, + { + "id": "OriginTrial", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "trialName", + "type": "string" + }, + { + "name": "status", + "$ref": "OriginTrialStatus" + }, + { + "name": "tokensWithStatus", + "type": "array", + "items": { + "$ref": "OriginTrialTokenWithStatus" + } + } + ] + }, { "id": "Frame", "description": "Information about the Frame on the page.", @@ -13698,11 +14550,11 @@ "type": "string" }, { - "name": "adFrameType", - "description": "Indicates whether this frame was tagged as an ad.", + "name": "adFrameStatus", + "description": "Indicates whether this frame was tagged as an ad and why.", "experimental": true, "optional": true, - "$ref": "AdFrameType" + "$ref": "AdFrameStatus" }, { "name": "secureContextType", @@ -13724,6 +14576,16 @@ "items": { "$ref": "GatedAPIFeatures" } + }, + { + "name": "originTrials", + "description": "Frame document's origin trials with at least one token present.", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "$ref": "OriginTrial" + } } ] }, @@ -14252,6 +15114,146 @@ "type": "boolean" } ] + }, + { + "id": "NavigationType", + "description": "The type of a frameNavigated event.", + "experimental": true, + "type": "string", + "enum": [ + "Navigation", + "BackForwardCacheRestore" + ] + }, + { + "id": "BackForwardCacheNotRestoredReason", + "description": "List of not restored reasons for back-forward cache.", + "experimental": true, + "type": "string", + "enum": [ + "NotMainFrame", + "BackForwardCacheDisabled", + "RelatedActiveContentsExist", + "HTTPStatusNotOK", + "SchemeNotHTTPOrHTTPS", + "Loading", + "WasGrantedMediaAccess", + "DisableForRenderFrameHostCalled", + "DomainNotAllowed", + "HTTPMethodNotGET", + "SubframeIsNavigating", + "Timeout", + "CacheLimit", + "JavaScriptExecution", + "RendererProcessKilled", + "RendererProcessCrashed", + "GrantedMediaStreamAccess", + "SchedulerTrackedFeatureUsed", + "ConflictingBrowsingInstance", + "CacheFlushed", + "ServiceWorkerVersionActivation", + "SessionRestored", + "ServiceWorkerPostMessage", + "EnteredBackForwardCacheBeforeServiceWorkerHostAdded", + "RenderFrameHostReused_SameSite", + "RenderFrameHostReused_CrossSite", + "ServiceWorkerClaim", + "IgnoreEventAndEvict", + "HaveInnerContents", + "TimeoutPuttingInCache", + "BackForwardCacheDisabledByLowMemory", + "BackForwardCacheDisabledByCommandLine", + "NetworkRequestDatapipeDrainedAsBytesConsumer", + "NetworkRequestRedirected", + "NetworkRequestTimeout", + "NetworkExceedsBufferLimit", + "NavigationCancelledWhileRestoring", + "NotMostRecentNavigationEntry", + "BackForwardCacheDisabledForPrerender", + "UserAgentOverrideDiffers", + "ForegroundCacheLimit", + "BrowsingInstanceNotSwapped", + "BackForwardCacheDisabledForDelegate", + "OptInUnloadHeaderNotPresent", + "UnloadHandlerExistsInSubFrame", + "ServiceWorkerUnregistration", + "CacheControlNoStore", + "CacheControlNoStoreCookieModified", + "CacheControlNoStoreHTTPOnlyCookieModified", + "WebSocket", + "WebRTC", + "MainResourceHasCacheControlNoStore", + "MainResourceHasCacheControlNoCache", + "SubresourceHasCacheControlNoStore", + "SubresourceHasCacheControlNoCache", + "ContainsPlugins", + "DocumentLoaded", + "DedicatedWorkerOrWorklet", + "OutstandingNetworkRequestOthers", + "OutstandingIndexedDBTransaction", + "RequestedNotificationsPermission", + "RequestedMIDIPermission", + "RequestedAudioCapturePermission", + "RequestedVideoCapturePermission", + "RequestedBackForwardCacheBlockedSensors", + "RequestedBackgroundWorkPermission", + "BroadcastChannel", + "IndexedDBConnection", + "WebXR", + "SharedWorker", + "WebLocks", + "WebHID", + "WebShare", + "RequestedStorageAccessGrant", + "WebNfc", + "WebFileSystem", + "OutstandingNetworkRequestFetch", + "OutstandingNetworkRequestXHR", + "AppBanner", + "Printing", + "WebDatabase", + "PictureInPicture", + "Portal", + "SpeechRecognizer", + "IdleManager", + "PaymentManager", + "SpeechSynthesis", + "KeyboardLock", + "WebOTPService", + "OutstandingNetworkRequestDirectSocket", + "IsolatedWorldScript", + "InjectedStyleSheet", + "MediaSessionImplOnServiceCreated", + "Unknown" + ] + }, + { + "id": "BackForwardCacheNotRestoredReasonType", + "description": "Types of not restored reasons for back-forward cache.", + "experimental": true, + "type": "string", + "enum": [ + "SupportPending", + "PageSupportNeeded", + "Circumstantial" + ] + }, + { + "id": "BackForwardCacheNotRestoredExplanation", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "type", + "description": "Type of the reason", + "$ref": "BackForwardCacheNotRestoredReasonType" + }, + { + "name": "reason", + "description": "Not restored reason", + "$ref": "BackForwardCacheNotRestoredReason" + } + ] } ], "commands": [ @@ -14288,6 +15290,13 @@ "experimental": true, "optional": true, "type": "string" + }, + { + "name": "includeCommandLineAPI", + "description": "Specifies whether command line API should be available to the script, defaults\nto false.", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ @@ -14313,7 +15322,8 @@ "type": "string", "enum": [ "jpeg", - "png" + "png", + "webp" ] }, { @@ -14376,7 +15386,7 @@ }, { "name": "clearDeviceMetricsOverride", - "description": "Clears the overriden device metrics.", + "description": "Clears the overridden device metrics.", "experimental": true, "deprecated": true, "redirect": "Emulation" @@ -14390,7 +15400,7 @@ }, { "name": "clearGeolocationOverride", - "description": "Clears the overriden Geolocation Position and Error.", + "description": "Clears the overridden Geolocation Position and Error.", "deprecated": true, "redirect": "Emulation" }, @@ -15139,7 +16149,7 @@ }, { "name": "downloadPath", - "description": "The default path to save downloaded files to. This is requred if behavior is set to 'allow'", + "description": "The default path to save downloaded files to. This is required if behavior is set to 'allow'", "optional": true, "type": "string" } @@ -15463,6 +16473,11 @@ "name": "frame", "description": "Frame object.", "$ref": "Frame" + }, + { + "name": "type", + "experimental": true, + "$ref": "NavigationType" } ] }, @@ -15562,8 +16577,9 @@ }, { "name": "downloadWillBegin", - "description": "Fired when page is about to start a download.", + "description": "Fired when page is about to start a download.\nDeprecated. Use Browser.downloadWillBegin instead.", "experimental": true, + "deprecated": true, "parameters": [ { "name": "frameId", @@ -15589,8 +16605,9 @@ }, { "name": "downloadProgress", - "description": "Fired when download makes progress. Last call has |done| == true.", + "description": "Fired when download makes progress. Last call has |done| == true.\nDeprecated. Use Browser.downloadProgress instead.", "experimental": true, + "deprecated": true, "parameters": [ { "name": "guid", @@ -15699,6 +16716,31 @@ } ] }, + { + "name": "backForwardCacheNotUsed", + "description": "Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do\nnot assume any ordering with the Page.frameNavigated event. This event is fired only for\nmain-frame history navigation where the document changes (non-same-document navigations),\nwhen bfcache navigation fails.", + "experimental": true, + "parameters": [ + { + "name": "loaderId", + "description": "The loader id for the associated navgation.", + "$ref": "Network.LoaderId" + }, + { + "name": "frameId", + "description": "The frame id of the associated frame.", + "$ref": "FrameId" + }, + { + "name": "notRestoredExplanations", + "description": "Array of reasons why the page could not be cached. This must not be empty.", + "type": "array", + "items": { + "$ref": "BackForwardCacheNotRestoredExplanation" + } + } + ] + }, { "name": "loadEventFired", "parameters": [ @@ -16969,7 +18011,7 @@ }, { "name": "quotaSize", - "description": "The quota size (in bytes) to override the original quota with.\nIf this is called multiple times, the overriden quota will be equal to\nthe quotaSize provided in the final call. If this is called without\nspecifying a quotaSize, the quota will be reset to the default value for\nthe specified origin. If this is called multiple times with different\norigins, the override will be maintained for each origin until it is\ndisabled (called without a quotaSize).", + "description": "The quota size (in bytes) to override the original quota with.\nIf this is called multiple times, the overridden quota will be equal to\nthe quotaSize provided in the final call. If this is called without\nspecifying a quotaSize, the quota will be reset to the default value for\nthe specified origin. If this is called multiple times with different\norigins, the override will be maintained for each origin until it is\ndisabled (called without a quotaSize).", "optional": true, "type": "number" } @@ -18299,7 +19341,7 @@ }, { "id": "RequestStage", - "description": "Stages of the request to handle. Request will intercept before the request is\nsent. Response will intercept after the response is received (but before response\nbody is received.", + "description": "Stages of the request to handle. Request will intercept before the request is\nsent. Response will intercept after the response is received (but before response\nbody is received).", "type": "string", "enum": [ "Request", @@ -18312,7 +19354,7 @@ "properties": [ { "name": "urlPattern", - "description": "Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is\nbackslash. Omitting is equivalent to \"*\".", + "description": "Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is\nbackslash. Omitting is equivalent to `\"*\"`.", "optional": true, "type": "string" }, @@ -18324,7 +19366,7 @@ }, { "name": "requestStage", - "description": "Stage at wich to begin intercepting requests. Default is Request.", + "description": "Stage at which to begin intercepting requests. Default is Request.", "optional": true, "$ref": "RequestStage" } @@ -18752,7 +19794,7 @@ }, { "name": "renderCapacity", - "description": "The time spent on rendering graph divided by render qunatum duration,\nand multiplied by 100. 100 means the audio renderer reached the full\ncapacity and glitch may occur.", + "description": "The time spent on rendering graph divided by render quantum duration,\nand multiplied by 100. 100 means the audio renderer reached the full\ncapacity and glitch may occur.", "type": "number" }, { @@ -19209,6 +20251,12 @@ "optional": true, "type": "boolean" }, + { + "name": "hasCredBlob", + "description": "If set to true, the authenticator will support the credBlob extension.\nhttps://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension\nDefaults to false.", + "optional": true, + "type": "boolean" + }, { "name": "automaticPresenceSimulation", "description": "If set to true, tests of user presence will succeed immediately.\nOtherwise, they will not be resolved. Defaults to true.", @@ -19566,7 +20614,7 @@ }, { "name": "playersCreated", - "description": "Called whenever a player is created, or when a new agent joins and recieves\na list of active players. If an agent is restored, it will recieve the full\nlist of player ids and all events again.", + "description": "Called whenever a player is created, or when a new agent joins and receives\na list of active players. If an agent is restored, it will receive the full\nlist of player ids and all events again.", "parameters": [ { "name": "players", diff --git a/protocol/audits/types.go b/protocol/audits/types.go index 4157b1b..46bc38f 100644 --- a/protocol/audits/types.go +++ b/protocol/audits/types.go @@ -39,11 +39,12 @@ const ( SameSiteCookieExclusionReasonExcludeSameSiteNoneInsecure SameSiteCookieExclusionReason = "ExcludeSameSiteNoneInsecure" SameSiteCookieExclusionReasonExcludeSameSiteLax SameSiteCookieExclusionReason = "ExcludeSameSiteLax" SameSiteCookieExclusionReasonExcludeSameSiteStrict SameSiteCookieExclusionReason = "ExcludeSameSiteStrict" + SameSiteCookieExclusionReasonExcludeInvalidSameParty SameSiteCookieExclusionReason = "ExcludeInvalidSameParty" ) func (e SameSiteCookieExclusionReason) Valid() bool { switch e { - case "ExcludeSameSiteUnspecifiedTreatedAsLax", "ExcludeSameSiteNoneInsecure", "ExcludeSameSiteLax", "ExcludeSameSiteStrict": + case "ExcludeSameSiteUnspecifiedTreatedAsLax", "ExcludeSameSiteNoneInsecure", "ExcludeSameSiteLax", "ExcludeSameSiteStrict", "ExcludeInvalidSameParty": return true default: return false @@ -110,7 +111,8 @@ func (e SameSiteCookieOperation) String() string { // front-end has a difficult time finding a specific cookie. With this, we can // convey specific error information without the cookie. type SameSiteCookieIssueDetails struct { - Cookie AffectedCookie `json:"cookie"` // No description. + Cookie *AffectedCookie `json:"cookie,omitempty"` // If AffectedCookie is not set then rawCookieLine contains the raw Set-Cookie header string. This hints at a problem where the cookie line is syntactically or semantically malformed in a way that no valid cookie could be created. + RawCookieLine *string `json:"rawCookieLine,omitempty"` // No description. CookieWarningReasons []SameSiteCookieWarningReason `json:"cookieWarningReasons"` // No description. CookieExclusionReasons []SameSiteCookieExclusionReason `json:"cookieExclusionReasons"` // No description. Operation SameSiteCookieOperation `json:"operation"` // Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context. @@ -418,10 +420,73 @@ type CORSIssueDetails struct { CORSErrorStatus network.CORSErrorStatus `json:"corsErrorStatus"` // No description. IsWarning bool `json:"isWarning"` // No description. Request AffectedRequest `json:"request"` // No description. + Location *SourceCodeLocation `json:"location,omitempty"` // No description. + InitiatorOrigin *string `json:"initiatorOrigin,omitempty"` // No description. ResourceIPAddressSpace *network.IPAddressSpace `json:"resourceIPAddressSpace,omitempty"` // No description. ClientSecurityState *network.ClientSecurityState `json:"clientSecurityState,omitempty"` // No description. } +// AttributionReportingIssueType +type AttributionReportingIssueType string + +// AttributionReportingIssueType as enums. +const ( + AttributionReportingIssueTypeNotSet AttributionReportingIssueType = "" + AttributionReportingIssueTypePermissionPolicyDisabled AttributionReportingIssueType = "PermissionPolicyDisabled" + AttributionReportingIssueTypeInvalidAttributionSourceEventID AttributionReportingIssueType = "InvalidAttributionSourceEventId" + AttributionReportingIssueTypeInvalidAttributionData AttributionReportingIssueType = "InvalidAttributionData" + AttributionReportingIssueTypeAttributionSourceUntrustworthyOrigin AttributionReportingIssueType = "AttributionSourceUntrustworthyOrigin" + AttributionReportingIssueTypeAttributionUntrustworthyOrigin AttributionReportingIssueType = "AttributionUntrustworthyOrigin" +) + +func (e AttributionReportingIssueType) Valid() bool { + switch e { + case "PermissionPolicyDisabled", "InvalidAttributionSourceEventId", "InvalidAttributionData", "AttributionSourceUntrustworthyOrigin", "AttributionUntrustworthyOrigin": + return true + default: + return false + } +} + +func (e AttributionReportingIssueType) String() string { + return string(e) +} + +// AttributionReportingIssueDetails Details for issues around "Attribution +// Reporting API" usage. Explainer: +// https://github.com/WICG/conversion-measurement-api +type AttributionReportingIssueDetails struct { + ViolationType AttributionReportingIssueType `json:"violationType"` // No description. + Frame *AffectedFrame `json:"frame,omitempty"` // No description. + Request *AffectedRequest `json:"request,omitempty"` // No description. + ViolatingNodeID *dom.BackendNodeID `json:"violatingNodeId,omitempty"` // No description. + InvalidParameter *string `json:"invalidParameter,omitempty"` // No description. +} + +// QuirksModeIssueDetails Details for issues about documents in Quirks Mode or +// Limited Quirks Mode that affects page layouting. +type QuirksModeIssueDetails struct { + IsLimitedQuirksMode bool `json:"isLimitedQuirksMode"` // If false, it means the document's mode is "quirks" instead of "limited-quirks". + DocumentNodeID dom.BackendNodeID `json:"documentNodeId"` // No description. + URL string `json:"url"` // No description. + FrameID page.FrameID `json:"frameId"` // No description. + LoaderID network.LoaderID `json:"loaderId"` // No description. +} + +// NavigatorUserAgentIssueDetails +type NavigatorUserAgentIssueDetails struct { + URL string `json:"url"` // No description. + Location *SourceCodeLocation `json:"location,omitempty"` // No description. +} + +// WASMCrossOriginModuleSharingIssueDetails +type WASMCrossOriginModuleSharingIssueDetails struct { + WASMModuleURL string `json:"wasmModuleUrl"` // No description. + SourceOrigin string `json:"sourceOrigin"` // No description. + TargetOrigin string `json:"targetOrigin"` // No description. + IsWarning bool `json:"isWarning"` // No description. +} + // InspectorIssueCode A unique identifier for the type of issue. Each type may // use one of the optional fields in InspectorIssueDetails to convey more // specific information about the kind of issue. @@ -429,21 +494,25 @@ type InspectorIssueCode string // InspectorIssueCode as enums. const ( - InspectorIssueCodeNotSet InspectorIssueCode = "" - InspectorIssueCodeSameSiteCookieIssue InspectorIssueCode = "SameSiteCookieIssue" - InspectorIssueCodeMixedContentIssue InspectorIssueCode = "MixedContentIssue" - InspectorIssueCodeBlockedByResponseIssue InspectorIssueCode = "BlockedByResponseIssue" - InspectorIssueCodeHeavyAdIssue InspectorIssueCode = "HeavyAdIssue" - InspectorIssueCodeContentSecurityPolicyIssue InspectorIssueCode = "ContentSecurityPolicyIssue" - InspectorIssueCodeSharedArrayBufferIssue InspectorIssueCode = "SharedArrayBufferIssue" - InspectorIssueCodeTrustedWebActivityIssue InspectorIssueCode = "TrustedWebActivityIssue" - InspectorIssueCodeLowTextContrastIssue InspectorIssueCode = "LowTextContrastIssue" - InspectorIssueCodeCORSIssue InspectorIssueCode = "CorsIssue" + InspectorIssueCodeNotSet InspectorIssueCode = "" + InspectorIssueCodeSameSiteCookieIssue InspectorIssueCode = "SameSiteCookieIssue" + InspectorIssueCodeMixedContentIssue InspectorIssueCode = "MixedContentIssue" + InspectorIssueCodeBlockedByResponseIssue InspectorIssueCode = "BlockedByResponseIssue" + InspectorIssueCodeHeavyAdIssue InspectorIssueCode = "HeavyAdIssue" + InspectorIssueCodeContentSecurityPolicyIssue InspectorIssueCode = "ContentSecurityPolicyIssue" + InspectorIssueCodeSharedArrayBufferIssue InspectorIssueCode = "SharedArrayBufferIssue" + InspectorIssueCodeTrustedWebActivityIssue InspectorIssueCode = "TrustedWebActivityIssue" + InspectorIssueCodeLowTextContrastIssue InspectorIssueCode = "LowTextContrastIssue" + InspectorIssueCodeCORSIssue InspectorIssueCode = "CorsIssue" + InspectorIssueCodeAttributionReportingIssue InspectorIssueCode = "AttributionReportingIssue" + InspectorIssueCodeQuirksModeIssue InspectorIssueCode = "QuirksModeIssue" + InspectorIssueCodeNavigatorUserAgentIssue InspectorIssueCode = "NavigatorUserAgentIssue" + InspectorIssueCodeWASMCrossOriginModuleSharingIssue InspectorIssueCode = "WasmCrossOriginModuleSharingIssue" ) func (e InspectorIssueCode) Valid() bool { switch e { - case "SameSiteCookieIssue", "MixedContentIssue", "BlockedByResponseIssue", "HeavyAdIssue", "ContentSecurityPolicyIssue", "SharedArrayBufferIssue", "TrustedWebActivityIssue", "LowTextContrastIssue", "CorsIssue": + case "SameSiteCookieIssue", "MixedContentIssue", "BlockedByResponseIssue", "HeavyAdIssue", "ContentSecurityPolicyIssue", "SharedArrayBufferIssue", "TrustedWebActivityIssue", "LowTextContrastIssue", "CorsIssue", "AttributionReportingIssue", "QuirksModeIssue", "NavigatorUserAgentIssue", "WasmCrossOriginModuleSharingIssue": return true default: return false @@ -458,19 +527,29 @@ func (e InspectorIssueCode) String() string { // additional information specific to the kind of issue. When adding a new // issue code, please also add a new optional field to this type. type InspectorIssueDetails struct { - SameSiteCookieIssueDetails *SameSiteCookieIssueDetails `json:"sameSiteCookieIssueDetails,omitempty"` // No description. - MixedContentIssueDetails *MixedContentIssueDetails `json:"mixedContentIssueDetails,omitempty"` // No description. - BlockedByResponseIssueDetails *BlockedByResponseIssueDetails `json:"blockedByResponseIssueDetails,omitempty"` // No description. - HeavyAdIssueDetails *HeavyAdIssueDetails `json:"heavyAdIssueDetails,omitempty"` // No description. - ContentSecurityPolicyIssueDetails *ContentSecurityPolicyIssueDetails `json:"contentSecurityPolicyIssueDetails,omitempty"` // No description. - SharedArrayBufferIssueDetails *SharedArrayBufferIssueDetails `json:"sharedArrayBufferIssueDetails,omitempty"` // No description. - TwaQualityEnforcementDetails *TrustedWebActivityIssueDetails `json:"twaQualityEnforcementDetails,omitempty"` // No description. - LowTextContrastIssueDetails *LowTextContrastIssueDetails `json:"lowTextContrastIssueDetails,omitempty"` // No description. - CORSIssueDetails *CORSIssueDetails `json:"corsIssueDetails,omitempty"` // No description. -} + SameSiteCookieIssueDetails *SameSiteCookieIssueDetails `json:"sameSiteCookieIssueDetails,omitempty"` // No description. + MixedContentIssueDetails *MixedContentIssueDetails `json:"mixedContentIssueDetails,omitempty"` // No description. + BlockedByResponseIssueDetails *BlockedByResponseIssueDetails `json:"blockedByResponseIssueDetails,omitempty"` // No description. + HeavyAdIssueDetails *HeavyAdIssueDetails `json:"heavyAdIssueDetails,omitempty"` // No description. + ContentSecurityPolicyIssueDetails *ContentSecurityPolicyIssueDetails `json:"contentSecurityPolicyIssueDetails,omitempty"` // No description. + SharedArrayBufferIssueDetails *SharedArrayBufferIssueDetails `json:"sharedArrayBufferIssueDetails,omitempty"` // No description. + TwaQualityEnforcementDetails *TrustedWebActivityIssueDetails `json:"twaQualityEnforcementDetails,omitempty"` // No description. + LowTextContrastIssueDetails *LowTextContrastIssueDetails `json:"lowTextContrastIssueDetails,omitempty"` // No description. + CORSIssueDetails *CORSIssueDetails `json:"corsIssueDetails,omitempty"` // No description. + AttributionReportingIssueDetails *AttributionReportingIssueDetails `json:"attributionReportingIssueDetails,omitempty"` // No description. + QuirksModeIssueDetails *QuirksModeIssueDetails `json:"quirksModeIssueDetails,omitempty"` // No description. + NavigatorUserAgentIssueDetails *NavigatorUserAgentIssueDetails `json:"navigatorUserAgentIssueDetails,omitempty"` // No description. + WASMCrossOriginModuleSharingIssue *WASMCrossOriginModuleSharingIssueDetails `json:"wasmCrossOriginModuleSharingIssue,omitempty"` // No description. +} + +// IssueID A unique id for a DevTools inspector issue. Allows other entities +// (e.g. exceptions, CDP message, console messages, etc.) to reference an +// issue. +type IssueID string // InspectorIssue An inspector issue reported from the back-end. type InspectorIssue struct { - Code InspectorIssueCode `json:"code"` // No description. - Details InspectorIssueDetails `json:"details"` // No description. + Code InspectorIssueCode `json:"code"` // No description. + Details InspectorIssueDetails `json:"details"` // No description. + IssueID *IssueID `json:"issueId,omitempty"` // A unique id for this issue. May be omitted if no other entity (e.g. exception, CDP message, etc.) is referencing this issue. } diff --git a/protocol/browser/command.go b/protocol/browser/command.go index 777d58c..e58912e 100644 --- a/protocol/browser/command.go +++ b/protocol/browser/command.go @@ -96,6 +96,7 @@ type SetDownloadBehaviorArgs struct { Behavior string `json:"behavior"` BrowserContextID *ContextID `json:"browserContextId,omitempty"` // BrowserContext to set download behavior. When omitted, default browser context is used. DownloadPath *string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow' or 'allowAndName'. + EventsEnabled *bool `json:"eventsEnabled,omitempty"` // Whether to emit download events (defaults to false). } // NewSetDownloadBehaviorArgs initializes SetDownloadBehaviorArgs with the required arguments. @@ -121,6 +122,13 @@ func (a *SetDownloadBehaviorArgs) SetDownloadPath(downloadPath string) *SetDownl return a } +// SetEventsEnabled sets the EventsEnabled optional argument. Whether +// to emit download events (defaults to false). +func (a *SetDownloadBehaviorArgs) SetEventsEnabled(eventsEnabled bool) *SetDownloadBehaviorArgs { + a.EventsEnabled = &eventsEnabled + return a +} + // CancelDownloadArgs represents the arguments for CancelDownload in the Browser domain. type CancelDownloadArgs struct { GUID string `json:"guid"` // Global unique identifier of the download. diff --git a/protocol/browser/domain.go b/protocol/browser/domain.go index d513bd4..a815d29 100644 --- a/protocol/browser/domain.go +++ b/protocol/browser/domain.go @@ -237,3 +237,45 @@ func (d *domainClient) ExecuteBrowserCommand(ctx context.Context, args *ExecuteB } return } + +func (d *domainClient) DownloadWillBegin(ctx context.Context) (DownloadWillBeginClient, error) { + s, err := rpcc.NewStream(ctx, "Browser.downloadWillBegin", d.conn) + if err != nil { + return nil, err + } + return &downloadWillBeginClient{Stream: s}, nil +} + +type downloadWillBeginClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *downloadWillBeginClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *downloadWillBeginClient) Recv() (*DownloadWillBeginReply, error) { + event := new(DownloadWillBeginReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Browser", Op: "DownloadWillBegin Recv", Err: err} + } + return event, nil +} + +func (d *domainClient) DownloadProgress(ctx context.Context) (DownloadProgressClient, error) { + s, err := rpcc.NewStream(ctx, "Browser.downloadProgress", d.conn) + if err != nil { + return nil, err + } + return &downloadProgressClient{Stream: s}, nil +} + +type downloadProgressClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *downloadProgressClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *downloadProgressClient) Recv() (*DownloadProgressReply, error) { + event := new(DownloadProgressReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Browser", Op: "DownloadProgress Recv", Err: err} + } + return event, nil +} diff --git a/protocol/browser/event.go b/protocol/browser/event.go new file mode 100644 index 0000000..5074db8 --- /dev/null +++ b/protocol/browser/event.go @@ -0,0 +1,45 @@ +// Code generated by cdpgen. DO NOT EDIT. + +package browser + +import ( + "github.com/mafredri/cdp/protocol/page" + "github.com/mafredri/cdp/rpcc" +) + +// DownloadWillBeginClient is a client for DownloadWillBegin events. Fired +// when page is about to start a download. +type DownloadWillBeginClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*DownloadWillBeginReply, error) + rpcc.Stream +} + +// DownloadWillBeginReply is the reply for DownloadWillBegin events. +type DownloadWillBeginReply struct { + FrameID page.FrameID `json:"frameId"` // Id of the frame that caused the download to begin. + GUID string `json:"guid"` // Global unique identifier of the download. + URL string `json:"url"` // URL of the resource being downloaded. + SuggestedFilename string `json:"suggestedFilename"` // Suggested file name of the resource (the actual name of the file saved on disk may differ). +} + +// DownloadProgressClient is a client for DownloadProgress events. Fired when +// download makes progress. Last call has |done| == true. +type DownloadProgressClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*DownloadProgressReply, error) + rpcc.Stream +} + +// DownloadProgressReply is the reply for DownloadProgress events. +type DownloadProgressReply struct { + GUID string `json:"guid"` // Global unique identifier of the download. + TotalBytes float64 `json:"totalBytes"` // Total expected bytes to download. + ReceivedBytes float64 `json:"receivedBytes"` // Total bytes received. + // State Download status. + // + // Values: "inProgress", "completed", "canceled". + State string `json:"state"` +} diff --git a/protocol/css/command.go b/protocol/css/command.go index a5a975a..4a647bf 100644 --- a/protocol/css/command.go +++ b/protocol/css/command.go @@ -266,6 +266,27 @@ type SetMediaTextReply struct { Media Media `json:"media"` // The resulting CSS media rule after modification. } +// SetContainerQueryTextArgs represents the arguments for SetContainerQueryText in the CSS domain. +type SetContainerQueryTextArgs struct { + StyleSheetID StyleSheetID `json:"styleSheetId"` // No description. + Range SourceRange `json:"range"` // No description. + Text string `json:"text"` // No description. +} + +// NewSetContainerQueryTextArgs initializes SetContainerQueryTextArgs with the required arguments. +func NewSetContainerQueryTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetContainerQueryTextArgs { + args := new(SetContainerQueryTextArgs) + args.StyleSheetID = styleSheetID + args.Range = rang + args.Text = text + return args +} + +// SetContainerQueryTextReply represents the return values for SetContainerQueryText in the CSS domain. +type SetContainerQueryTextReply struct { + ContainerQuery ContainerQuery `json:"containerQuery"` // The resulting CSS container query rule after modification. +} + // SetRuleSelectorArgs represents the arguments for SetRuleSelector in the CSS domain. type SetRuleSelectorArgs struct { StyleSheetID StyleSheetID `json:"styleSheetId"` // No description. diff --git a/protocol/css/domain.go b/protocol/css/domain.go index 5f91613..440e114 100644 --- a/protocol/css/domain.go +++ b/protocol/css/domain.go @@ -289,6 +289,21 @@ func (d *domainClient) SetMediaText(ctx context.Context, args *SetMediaTextArgs) return } +// SetContainerQueryText invokes the CSS method. Modifies the expression of a +// container query. +func (d *domainClient) SetContainerQueryText(ctx context.Context, args *SetContainerQueryTextArgs) (reply *SetContainerQueryTextReply, err error) { + reply = new(SetContainerQueryTextReply) + if args != nil { + err = rpcc.Invoke(ctx, "CSS.setContainerQueryText", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "CSS.setContainerQueryText", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "CSS", Op: "SetContainerQueryText", Err: err} + } + return +} + // SetRuleSelector invokes the CSS method. Modifies the rule selector. func (d *domainClient) SetRuleSelector(ctx context.Context, args *SetRuleSelectorArgs) (reply *SetRuleSelectorReply, err error) { reply = new(SetRuleSelectorReply) diff --git a/protocol/css/types.go b/protocol/css/types.go index e71aa16..aabbc93 100644 --- a/protocol/css/types.go +++ b/protocol/css/types.go @@ -73,7 +73,7 @@ type SelectorList struct { type StyleSheetHeader struct { StyleSheetID StyleSheetID `json:"styleSheetId"` // The stylesheet identifier. FrameID page.FrameID `json:"frameId"` // Owner frame identifier. - SourceURL string `json:"sourceURL"` // Stylesheet resource URL. + SourceURL string `json:"sourceURL"` // Stylesheet resource URL. Empty if this is a constructed stylesheet created using new CSSStyleSheet() (but non-empty if this is a constructed sylesheet imported as a CSS module script). SourceMapURL *string `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any). Origin StyleSheetOrigin `json:"origin"` // Stylesheet origin. Title string `json:"title"` // Stylesheet title. @@ -82,7 +82,7 @@ type StyleSheetHeader struct { HasSourceURL *bool `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment. IsInline bool `json:"isInline"` // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags. IsMutable bool `json:"isMutable"` // Whether this stylesheet is mutable. Inline stylesheets become mutable after they have been modified via CSSOM API. element's stylesheets become mutable only if DevTools modifies them. Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation. - IsConstructed bool `json:"isConstructed"` // Whether this stylesheet is a constructed stylesheet (created using new CSSStyleSheet()). + IsConstructed bool `json:"isConstructed"` // True if this stylesheet is created through new CSSStyleSheet() or imported as a CSS module script. StartLine float64 `json:"startLine"` // Line offset of the stylesheet within the resource (zero based). StartColumn float64 `json:"startColumn"` // Column offset of the stylesheet within the resource (zero based). Length float64 `json:"length"` // Size of the content (in characters). @@ -97,6 +97,12 @@ type Rule struct { Origin StyleSheetOrigin `json:"origin"` // Parent stylesheet's origin. Style Style `json:"style"` // Associated style declaration. Media []Media `json:"media,omitempty"` // Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards. + // ContainerQueries Container query list array (for rules involving + // container queries). The array enumerates container queries starting + // with the innermost one, going outwards. + // + // Note: This property is experimental. + ContainerQueries []ContainerQuery `json:"containerQueries,omitempty"` } // RuleUsage CSS coverage information. @@ -181,6 +187,16 @@ type MediaQueryExpression struct { ComputedLength *float64 `json:"computedLength,omitempty"` // Computed length of media query expression (if applicable). } +// ContainerQuery CSS container query rule descriptor. +// +// Note: This type is experimental. +type ContainerQuery struct { + Text string `json:"text"` // Container query text. + Range *SourceRange `json:"range,omitempty"` // The associated rule header range in the enclosing stylesheet (if available). + StyleSheetID *StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the stylesheet containing this object (if exists). + Name *string `json:"name,omitempty"` // Optional name for the container. +} + // PlatformFontUsage Information about amount of glyphs that were rendered // with given font. type PlatformFontUsage struct { diff --git a/protocol/debugger/command.go b/protocol/debugger/command.go index e33c131..6531ee8 100644 --- a/protocol/debugger/command.go +++ b/protocol/debugger/command.go @@ -211,20 +211,20 @@ type GetScriptSourceReply struct { Bytecode []byte `json:"bytecode,omitempty"` // Wasm bytecode. (Encoded as a base64 string when passed over JSON) } -// GetWasmBytecodeArgs represents the arguments for GetWasmBytecode in the Debugger domain. -type GetWasmBytecodeArgs struct { +// GetWASMBytecodeArgs represents the arguments for GetWASMBytecode in the Debugger domain. +type GetWASMBytecodeArgs struct { ScriptID runtime.ScriptID `json:"scriptId"` // Id of the Wasm script to get source for. } -// NewGetWasmBytecodeArgs initializes GetWasmBytecodeArgs with the required arguments. -func NewGetWasmBytecodeArgs(scriptID runtime.ScriptID) *GetWasmBytecodeArgs { - args := new(GetWasmBytecodeArgs) +// NewGetWASMBytecodeArgs initializes GetWASMBytecodeArgs with the required arguments. +func NewGetWASMBytecodeArgs(scriptID runtime.ScriptID) *GetWASMBytecodeArgs { + args := new(GetWASMBytecodeArgs) args.ScriptID = scriptID return args } -// GetWasmBytecodeReply represents the return values for GetWasmBytecode in the Debugger domain. -type GetWasmBytecodeReply struct { +// GetWASMBytecodeReply represents the return values for GetWASMBytecode in the Debugger domain. +type GetWASMBytecodeReply struct { Bytecode []byte `json:"bytecode"` // Script source. (Encoded as a base64 string when passed over JSON) } diff --git a/protocol/debugger/domain.go b/protocol/debugger/domain.go index c8b9db7..cbf7fac 100644 --- a/protocol/debugger/domain.go +++ b/protocol/debugger/domain.go @@ -107,17 +107,17 @@ func (d *domainClient) GetScriptSource(ctx context.Context, args *GetScriptSourc return } -// GetWasmBytecode invokes the Debugger method. This command is deprecated. +// GetWASMBytecode invokes the Debugger method. This command is deprecated. // Use getScriptSource instead. -func (d *domainClient) GetWasmBytecode(ctx context.Context, args *GetWasmBytecodeArgs) (reply *GetWasmBytecodeReply, err error) { - reply = new(GetWasmBytecodeReply) +func (d *domainClient) GetWASMBytecode(ctx context.Context, args *GetWASMBytecodeArgs) (reply *GetWASMBytecodeReply, err error) { + reply = new(GetWASMBytecodeReply) if args != nil { err = rpcc.Invoke(ctx, "Debugger.getWasmBytecode", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Debugger.getWasmBytecode", nil, reply, d.conn) } if err != nil { - err = &internal.OpError{Domain: "Debugger", Op: "GetWasmBytecode", Err: err} + err = &internal.OpError{Domain: "Debugger", Op: "GetWASMBytecode", Err: err} } return } diff --git a/protocol/dom/command.go b/protocol/dom/command.go index 3b62a29..314a3b2 100644 --- a/protocol/dom/command.go +++ b/protocol/dom/command.go @@ -956,3 +956,27 @@ type GetFrameOwnerReply struct { BackendNodeID BackendNodeID `json:"backendNodeId"` // Resulting node. NodeID *NodeID `json:"nodeId,omitempty"` // Id of the node at given coordinates, only when enabled and requested document. } + +// GetContainerForNodeArgs represents the arguments for GetContainerForNode in the DOM domain. +type GetContainerForNodeArgs struct { + NodeID NodeID `json:"nodeId"` // No description. + ContainerName *string `json:"containerName,omitempty"` // No description. +} + +// NewGetContainerForNodeArgs initializes GetContainerForNodeArgs with the required arguments. +func NewGetContainerForNodeArgs(nodeID NodeID) *GetContainerForNodeArgs { + args := new(GetContainerForNodeArgs) + args.NodeID = nodeID + return args +} + +// SetContainerName sets the ContainerName optional argument. +func (a *GetContainerForNodeArgs) SetContainerName(containerName string) *GetContainerForNodeArgs { + a.ContainerName = &containerName + return a +} + +// GetContainerForNodeReply represents the return values for GetContainerForNode in the DOM domain. +type GetContainerForNodeReply struct { + NodeID *NodeID `json:"nodeId,omitempty"` // The container node for the given node, or null if not found. +} diff --git a/protocol/dom/domain.go b/protocol/dom/domain.go index aff4a59..4d51c32 100644 --- a/protocol/dom/domain.go +++ b/protocol/dom/domain.go @@ -652,6 +652,23 @@ func (d *domainClient) GetFrameOwner(ctx context.Context, args *GetFrameOwnerArg return } +// GetContainerForNode invokes the DOM method. Returns the container of the +// given node based on container query conditions. If containerName is given, +// it will find the nearest container with a matching name; otherwise it will +// find the nearest container regardless of its container name. +func (d *domainClient) GetContainerForNode(ctx context.Context, args *GetContainerForNodeArgs) (reply *GetContainerForNodeReply, err error) { + reply = new(GetContainerForNodeReply) + if args != nil { + err = rpcc.Invoke(ctx, "DOM.getContainerForNode", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "DOM.getContainerForNode", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "DOM", Op: "GetContainerForNode", Err: err} + } + return +} + func (d *domainClient) AttributeModified(ctx context.Context) (AttributeModifiedClient, error) { s, err := rpcc.NewStream(ctx, "DOM.attributeModified", d.conn) if err != nil { diff --git a/protocol/dom/types.go b/protocol/dom/types.go index fb5a9fa..0202f98 100644 --- a/protocol/dom/types.go +++ b/protocol/dom/types.go @@ -38,6 +38,7 @@ const ( PseudoTypeTargetText PseudoType = "target-text" PseudoTypeSpellingError PseudoType = "spelling-error" PseudoTypeGrammarError PseudoType = "grammar-error" + PseudoTypeHighlight PseudoType = "highlight" PseudoTypeFirstLineInherited PseudoType = "first-line-inherited" PseudoTypeScrollbar PseudoType = "scrollbar" PseudoTypeScrollbarThumb PseudoType = "scrollbar-thumb" @@ -51,7 +52,7 @@ const ( func (e PseudoType) Valid() bool { switch e { - case "first-line", "first-letter", "before", "after", "marker", "backdrop", "selection", "target-text", "spelling-error", "grammar-error", "first-line-inherited", "scrollbar", "scrollbar-thumb", "scrollbar-button", "scrollbar-track", "scrollbar-track-piece", "scrollbar-corner", "resizer", "input-list-button": + case "first-line", "first-letter", "before", "after", "marker", "backdrop", "selection", "target-text", "spelling-error", "grammar-error", "highlight", "first-line-inherited", "scrollbar", "scrollbar-thumb", "scrollbar-button", "scrollbar-track", "scrollbar-track-piece", "scrollbar-corner", "resizer", "input-list-button": return true default: return false @@ -86,37 +87,68 @@ func (e ShadowRootType) String() string { return string(e) } +// CompatibilityMode Document compatibility mode. +type CompatibilityMode string + +// CompatibilityMode as enums. +const ( + CompatibilityModeNotSet CompatibilityMode = "" + CompatibilityModeQuirksMode CompatibilityMode = "QuirksMode" + CompatibilityModeLimitedQuirksMode CompatibilityMode = "LimitedQuirksMode" + CompatibilityModeNoQuirksMode CompatibilityMode = "NoQuirksMode" +) + +func (e CompatibilityMode) Valid() bool { + switch e { + case "QuirksMode", "LimitedQuirksMode", "NoQuirksMode": + return true + default: + return false + } +} + +func (e CompatibilityMode) String() string { + return string(e) +} + // Node DOM interaction is implemented in terms of mirror objects that // represent the actual DOM nodes. DOMNode is a base node mirror type. type Node struct { - NodeID NodeID `json:"nodeId"` // Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client. - ParentID *NodeID `json:"parentId,omitempty"` // The id of the parent node if any. - BackendNodeID BackendNodeID `json:"backendNodeId"` // The BackendNodeId for this node. - NodeType int `json:"nodeType"` // `Node`'s nodeType. - NodeName string `json:"nodeName"` // `Node`'s nodeName. - LocalName string `json:"localName"` // `Node`'s localName. - NodeValue string `json:"nodeValue"` // `Node`'s nodeValue. - ChildNodeCount *int `json:"childNodeCount,omitempty"` // Child count for `Container` nodes. - Children []Node `json:"children,omitempty"` // Child nodes of this node when requested with children. - Attributes []string `json:"attributes,omitempty"` // Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`. - DocumentURL *string `json:"documentURL,omitempty"` // Document URL that `Document` or `FrameOwner` node points to. - BaseURL *string `json:"baseURL,omitempty"` // Base URL that `Document` or `FrameOwner` node uses for URL completion. - PublicID *string `json:"publicId,omitempty"` // `DocumentType`'s publicId. - SystemID *string `json:"systemId,omitempty"` // `DocumentType`'s systemId. - InternalSubset *string `json:"internalSubset,omitempty"` // `DocumentType`'s internalSubset. - XMLVersion *string `json:"xmlVersion,omitempty"` // `Document`'s XML version in case of XML documents. - Name *string `json:"name,omitempty"` // `Attr`'s name. - Value *string `json:"value,omitempty"` // `Attr`'s value. - PseudoType PseudoType `json:"pseudoType,omitempty"` // Pseudo element type for this node. - ShadowRootType ShadowRootType `json:"shadowRootType,omitempty"` // Shadow root type. - FrameID *internal.PageFrameID `json:"frameId,omitempty"` // Frame ID for frame owner elements. - ContentDocument *Node `json:"contentDocument,omitempty"` // Content document for frame owner elements. - ShadowRoots []Node `json:"shadowRoots,omitempty"` // Shadow root list for given element host. - TemplateContent *Node `json:"templateContent,omitempty"` // Content document fragment for template elements. - PseudoElements []Node `json:"pseudoElements,omitempty"` // Pseudo elements associated with this node. - ImportedDocument *Node `json:"importedDocument,omitempty"` // Import document for the HTMLImport links. - DistributedNodes []BackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point. - IsSVG *bool `json:"isSVG,omitempty"` // Whether the node is SVG. + NodeID NodeID `json:"nodeId"` // Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client. + ParentID *NodeID `json:"parentId,omitempty"` // The id of the parent node if any. + BackendNodeID BackendNodeID `json:"backendNodeId"` // The BackendNodeId for this node. + NodeType int `json:"nodeType"` // `Node`'s nodeType. + NodeName string `json:"nodeName"` // `Node`'s nodeName. + LocalName string `json:"localName"` // `Node`'s localName. + NodeValue string `json:"nodeValue"` // `Node`'s nodeValue. + ChildNodeCount *int `json:"childNodeCount,omitempty"` // Child count for `Container` nodes. + Children []Node `json:"children,omitempty"` // Child nodes of this node when requested with children. + Attributes []string `json:"attributes,omitempty"` // Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`. + DocumentURL *string `json:"documentURL,omitempty"` // Document URL that `Document` or `FrameOwner` node points to. + BaseURL *string `json:"baseURL,omitempty"` // Base URL that `Document` or `FrameOwner` node uses for URL completion. + PublicID *string `json:"publicId,omitempty"` // `DocumentType`'s publicId. + SystemID *string `json:"systemId,omitempty"` // `DocumentType`'s systemId. + InternalSubset *string `json:"internalSubset,omitempty"` // `DocumentType`'s internalSubset. + XMLVersion *string `json:"xmlVersion,omitempty"` // `Document`'s XML version in case of XML documents. + Name *string `json:"name,omitempty"` // `Attr`'s name. + Value *string `json:"value,omitempty"` // `Attr`'s value. + PseudoType PseudoType `json:"pseudoType,omitempty"` // Pseudo element type for this node. + ShadowRootType ShadowRootType `json:"shadowRootType,omitempty"` // Shadow root type. + FrameID *internal.PageFrameID `json:"frameId,omitempty"` // Frame ID for frame owner elements. + ContentDocument *Node `json:"contentDocument,omitempty"` // Content document for frame owner elements. + ShadowRoots []Node `json:"shadowRoots,omitempty"` // Shadow root list for given element host. + TemplateContent *Node `json:"templateContent,omitempty"` // Content document fragment for template elements. + PseudoElements []Node `json:"pseudoElements,omitempty"` // Pseudo elements associated with this node. + // ImportedDocument is deprecated. + // + // Deprecated: Deprecated, as the HTML Imports API has been removed + // (crbug.com/937746). This property used to return the imported + // document for the HTMLImport links. The property is always undefined + // now. + ImportedDocument *Node `json:"importedDocument,omitempty"` + DistributedNodes []BackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point. + IsSVG *bool `json:"isSVG,omitempty"` // Whether the node is SVG. + CompatibilityMode CompatibilityMode `json:"compatibilityMode,omitempty"` // No description. } // RGBA A structure holding an RGBA color. diff --git a/protocol/domsnapshot/command.go b/protocol/domsnapshot/command.go index a4cf2c4..e0236ca 100644 --- a/protocol/domsnapshot/command.go +++ b/protocol/domsnapshot/command.go @@ -51,6 +51,21 @@ type CaptureSnapshotArgs struct { ComputedStyles []string `json:"computedStyles"` // Whitelist of computed styles to return. IncludePaintOrder *bool `json:"includePaintOrder,omitempty"` // Whether to include layout object paint orders into the snapshot. IncludeDOMRects *bool `json:"includeDOMRects,omitempty"` // Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot + // IncludeBlendedBackgroundColors Whether to include blended + // background colors in the snapshot (default: false). Blended + // background color is achieved by blending background colors of all + // elements that overlap with the current element. + // + // Note: This property is experimental. + IncludeBlendedBackgroundColors *bool `json:"includeBlendedBackgroundColors,omitempty"` + // IncludeTextColorOpacities Whether to include text color opacity in + // the snapshot (default: false). An element might have the opacity + // property set that affects the text color of the element. The final + // text color opacity is computed based on the opacity of all + // overlapping elements. + // + // Note: This property is experimental. + IncludeTextColorOpacities *bool `json:"includeTextColorOpacities,omitempty"` } // NewCaptureSnapshotArgs initializes CaptureSnapshotArgs with the required arguments. @@ -75,6 +90,30 @@ func (a *CaptureSnapshotArgs) SetIncludeDOMRects(includeDOMRects bool) *CaptureS return a } +// SetIncludeBlendedBackgroundColors sets the IncludeBlendedBackgroundColors optional argument. +// Whether to include blended background colors in the snapshot +// (default: false). Blended background color is achieved by blending +// background colors of all elements that overlap with the current +// element. +// +// Note: This property is experimental. +func (a *CaptureSnapshotArgs) SetIncludeBlendedBackgroundColors(includeBlendedBackgroundColors bool) *CaptureSnapshotArgs { + a.IncludeBlendedBackgroundColors = &includeBlendedBackgroundColors + return a +} + +// SetIncludeTextColorOpacities sets the IncludeTextColorOpacities optional argument. +// Whether to include text color opacity in the snapshot (default: +// false). An element might have the opacity property set that affects +// the text color of the element. The final text color opacity is +// computed based on the opacity of all overlapping elements. +// +// Note: This property is experimental. +func (a *CaptureSnapshotArgs) SetIncludeTextColorOpacities(includeTextColorOpacities bool) *CaptureSnapshotArgs { + a.IncludeTextColorOpacities = &includeTextColorOpacities + return a +} + // CaptureSnapshotReply represents the return values for CaptureSnapshot in the DOMSnapshot domain. type CaptureSnapshotReply struct { Documents []DocumentSnapshot `json:"documents"` // The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. diff --git a/protocol/domsnapshot/types.go b/protocol/domsnapshot/types.go index fab0bcf..6a33946 100644 --- a/protocol/domsnapshot/types.go +++ b/protocol/domsnapshot/types.go @@ -120,6 +120,7 @@ type DocumentSnapshot struct { type NodeTreeSnapshot struct { ParentIndex []int `json:"parentIndex,omitempty"` // Parent node index. NodeType []int `json:"nodeType,omitempty"` // `Node`'s nodeType. + ShadowRootType *RareStringData `json:"shadowRootType,omitempty"` // Type of the shadow root the `Node` is in. String values are equal to the `ShadowRootType` enum. NodeName []StringIndex `json:"nodeName,omitempty"` // `Node`'s nodeName. NodeValue []StringIndex `json:"nodeValue,omitempty"` // `Node`'s nodeValue. BackendNodeID []dom.BackendNodeID `json:"backendNodeId,omitempty"` // `Node`'s id, corresponds to DOM.Node.backendNodeId. @@ -147,6 +148,15 @@ type LayoutTreeSnapshot struct { OffsetRects []Rectangle `json:"offsetRects,omitempty"` // The offset rect of nodes. Only available when includeDOMRects is set to true ScrollRects []Rectangle `json:"scrollRects,omitempty"` // The scroll rect of nodes. Only available when includeDOMRects is set to true ClientRects []Rectangle `json:"clientRects,omitempty"` // The client rect of nodes. Only available when includeDOMRects is set to true + // BlendedBackgroundColors The list of background colors that are + // blended with colors of overlapping elements. + // + // Note: This property is experimental. + BlendedBackgroundColors []StringIndex `json:"blendedBackgroundColors,omitempty"` + // TextColorOpacities The list of computed text opacities. + // + // Note: This property is experimental. + TextColorOpacities []float64 `json:"textColorOpacities,omitempty"` } // TextBoxSnapshot Table of details of the post layout rendered text diff --git a/protocol/emulation/types.go b/protocol/emulation/types.go index cb01938..bddb5d1 100644 --- a/protocol/emulation/types.go +++ b/protocol/emulation/types.go @@ -90,12 +90,13 @@ type DisabledImageType string const ( DisabledImageTypeNotSet DisabledImageType = "" DisabledImageTypeAVIF DisabledImageType = "avif" + DisabledImageTypeJXL DisabledImageType = "jxl" DisabledImageTypeWEBP DisabledImageType = "webp" ) func (e DisabledImageType) Valid() bool { switch e { - case "avif", "webp": + case "avif", "jxl", "webp": return true default: return false diff --git a/protocol/fetch/types.go b/protocol/fetch/types.go index 94f5925..b8d29b4 100644 --- a/protocol/fetch/types.go +++ b/protocol/fetch/types.go @@ -11,7 +11,7 @@ type RequestID string // RequestStage Stages of the request to handle. Request will intercept before // the request is sent. Response will intercept after the response is received -// (but before response body is received. +// (but before response body is received). type RequestStage string // RequestStage as enums. @@ -36,7 +36,7 @@ func (e RequestStage) String() string { // RequestPattern type RequestPattern struct { - URLPattern *string `json:"urlPattern,omitempty"` // Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*". + URLPattern *string `json:"urlPattern,omitempty"` // Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to `"*"`. ResourceType *network.ResourceType `json:"resourceType,omitempty"` // If set, only requests for matching resource types will be intercepted. RequestStage RequestStage `json:"requestStage,omitempty"` // Stage at which to begin intercepting requests. Default is Request. } diff --git a/protocol/input/command.go b/protocol/input/command.go index a10f371..b54fdbd 100644 --- a/protocol/input/command.go +++ b/protocol/input/command.go @@ -2,6 +2,36 @@ package input +// DispatchDragEventArgs represents the arguments for DispatchDragEvent in the Input domain. +type DispatchDragEventArgs struct { + // Type Type of the drag event. + // + // Values: "dragEnter", "dragOver", "drop", "dragCancel". + Type string `json:"type"` + X float64 `json:"x"` // X coordinate of the event relative to the main frame's viewport in CSS pixels. + Y float64 `json:"y"` // Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + Data DragData `json:"data"` // No description. + Modifiers *int `json:"modifiers,omitempty"` // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). +} + +// NewDispatchDragEventArgs initializes DispatchDragEventArgs with the required arguments. +func NewDispatchDragEventArgs(typ string, x float64, y float64, data DragData) *DispatchDragEventArgs { + args := new(DispatchDragEventArgs) + args.Type = typ + args.X = x + args.Y = y + args.Data = data + return args +} + +// SetModifiers sets the Modifiers optional argument. Bit field +// representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, +// Shift=8 (default: 0). +func (a *DispatchDragEventArgs) SetModifiers(modifiers int) *DispatchDragEventArgs { + a.Modifiers = &modifiers + return a +} + // DispatchKeyEventArgs represents the arguments for DispatchKeyEvent in the Input domain. type DispatchKeyEventArgs struct { // Type Type of the key event. @@ -439,6 +469,18 @@ func NewSetIgnoreInputEventsArgs(ignore bool) *SetIgnoreInputEventsArgs { return args } +// SetInterceptDragsArgs represents the arguments for SetInterceptDrags in the Input domain. +type SetInterceptDragsArgs struct { + Enabled bool `json:"enabled"` // No description. +} + +// NewSetInterceptDragsArgs initializes SetInterceptDragsArgs with the required arguments. +func NewSetInterceptDragsArgs(enabled bool) *SetInterceptDragsArgs { + args := new(SetInterceptDragsArgs) + args.Enabled = enabled + return args +} + // SynthesizePinchGestureArgs represents the arguments for SynthesizePinchGesture in the Input domain. type SynthesizePinchGestureArgs struct { X float64 `json:"x"` // X coordinate of the start of the gesture in CSS pixels. diff --git a/protocol/input/domain.go b/protocol/input/domain.go index 5e5aa38..362711d 100644 --- a/protocol/input/domain.go +++ b/protocol/input/domain.go @@ -18,6 +18,20 @@ func NewClient(conn *rpcc.Conn) *domainClient { return &domainClient{conn: conn} } +// DispatchDragEvent invokes the Input method. Dispatches a drag event into +// the page. +func (d *domainClient) DispatchDragEvent(ctx context.Context, args *DispatchDragEventArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Input.dispatchDragEvent", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Input.dispatchDragEvent", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Input", Op: "DispatchDragEvent", Err: err} + } + return +} + // DispatchKeyEvent invokes the Input method. Dispatches a key event to the // page. func (d *domainClient) DispatchKeyEvent(ctx context.Context, args *DispatchKeyEventArgs) (err error) { @@ -102,6 +116,21 @@ func (d *domainClient) SetIgnoreInputEvents(ctx context.Context, args *SetIgnore return } +// SetInterceptDrags invokes the Input method. Prevents default drag and drop +// behavior and instead emits `Input.dragIntercepted` events. Drag and drop +// behavior can be directly controlled via `Input.dispatchDragEvent`. +func (d *domainClient) SetInterceptDrags(ctx context.Context, args *SetInterceptDragsArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Input.setInterceptDrags", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Input.setInterceptDrags", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Input", Op: "SetInterceptDrags", Err: err} + } + return +} + // SynthesizePinchGesture invokes the Input method. Synthesizes a pinch // gesture over a time period by issuing appropriate touch events. func (d *domainClient) SynthesizePinchGesture(ctx context.Context, args *SynthesizePinchGestureArgs) (err error) { @@ -143,3 +172,24 @@ func (d *domainClient) SynthesizeTapGesture(ctx context.Context, args *Synthesiz } return } + +func (d *domainClient) DragIntercepted(ctx context.Context) (DragInterceptedClient, error) { + s, err := rpcc.NewStream(ctx, "Input.dragIntercepted", d.conn) + if err != nil { + return nil, err + } + return &dragInterceptedClient{Stream: s}, nil +} + +type dragInterceptedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *dragInterceptedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *dragInterceptedClient) Recv() (*DragInterceptedReply, error) { + event := new(DragInterceptedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Input", Op: "DragIntercepted Recv", Err: err} + } + return event, nil +} diff --git a/protocol/input/event.go b/protocol/input/event.go new file mode 100644 index 0000000..7262bb8 --- /dev/null +++ b/protocol/input/event.go @@ -0,0 +1,22 @@ +// Code generated by cdpgen. DO NOT EDIT. + +package input + +import ( + "github.com/mafredri/cdp/rpcc" +) + +// DragInterceptedClient is a client for DragIntercepted events. Emitted only +// when `Input.setInterceptDrags` is enabled. Use this data with +// `Input.dispatchDragEvent` to restore normal drag and drop behavior. +type DragInterceptedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*DragInterceptedReply, error) + rpcc.Stream +} + +// DragInterceptedReply is the reply for DragIntercepted events. +type DragInterceptedReply struct { + Data DragData `json:"data"` // No description. +} diff --git a/protocol/input/types.go b/protocol/input/types.go index d45db73..bc137b1 100644 --- a/protocol/input/types.go +++ b/protocol/input/types.go @@ -135,3 +135,21 @@ func (t *TimeSinceEpoch) UnmarshalJSON(data []byte) error { var _ json.Marshaler = (*TimeSinceEpoch)(nil) var _ json.Unmarshaler = (*TimeSinceEpoch)(nil) + +// DragDataItem +// +// Note: This type is experimental. +type DragDataItem struct { + MimeType string `json:"mimeType"` // Mime type of the dragged data. + Data string `json:"data"` // Depending of the value of `mimeType`, it contains the dragged link, text, HTML markup or any other data. + Title *string `json:"title,omitempty"` // Title associated with a link. Only valid when `mimeType` == "text/uri-list". + BaseURL *string `json:"baseURL,omitempty"` // Stores the base URL for the contained markup. Only valid when `mimeType` == "text/html". +} + +// DragData +// +// Note: This type is experimental. +type DragData struct { + Items []DragDataItem `json:"items"` // No description. + DragOperationsMask int `json:"dragOperationsMask"` // Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 +} diff --git a/protocol/network/command.go b/protocol/network/command.go index f881254..37f68dc 100644 --- a/protocol/network/command.go +++ b/protocol/network/command.go @@ -8,6 +8,18 @@ import ( "github.com/mafredri/cdp/protocol/io" ) +// SetAcceptedEncodingsArgs represents the arguments for SetAcceptedEncodings in the Network domain. +type SetAcceptedEncodingsArgs struct { + Encodings []ContentEncoding `json:"encodings"` // List of accepted content encodings. +} + +// NewSetAcceptedEncodingsArgs initializes SetAcceptedEncodingsArgs with the required arguments. +func NewSetAcceptedEncodingsArgs(encodings []ContentEncoding) *SetAcceptedEncodingsArgs { + args := new(SetAcceptedEncodingsArgs) + args.Encodings = encodings + return args +} + // CanClearBrowserCacheReply represents the return values for CanClearBrowserCache in the Network domain. type CanClearBrowserCacheReply struct { Result bool `json:"result"` // True if browser cache can be cleared. @@ -563,20 +575,6 @@ func NewSetCookiesArgs(cookies []CookieParam) *SetCookiesArgs { return args } -// SetDataSizeLimitsForTestArgs represents the arguments for SetDataSizeLimitsForTest in the Network domain. -type SetDataSizeLimitsForTestArgs struct { - MaxTotalSize int `json:"maxTotalSize"` // Maximum total buffer size. - MaxResourceSize int `json:"maxResourceSize"` // Maximum per-resource size. -} - -// NewSetDataSizeLimitsForTestArgs initializes SetDataSizeLimitsForTestArgs with the required arguments. -func NewSetDataSizeLimitsForTestArgs(maxTotalSize int, maxResourceSize int) *SetDataSizeLimitsForTestArgs { - args := new(SetDataSizeLimitsForTestArgs) - args.MaxTotalSize = maxTotalSize - args.MaxResourceSize = maxResourceSize - return args -} - // SetExtraHTTPHeadersArgs represents the arguments for SetExtraHTTPHeaders in the Network domain. type SetExtraHTTPHeadersArgs struct { Headers Headers `json:"headers"` // Map with extra HTTP headers. diff --git a/protocol/network/domain.go b/protocol/network/domain.go index eb889a8..8c2d2a0 100644 --- a/protocol/network/domain.go +++ b/protocol/network/domain.go @@ -24,6 +24,30 @@ func NewClient(conn *rpcc.Conn) *domainClient { return &domainClient{conn: conn} } +// SetAcceptedEncodings invokes the Network method. Sets a list of content +// encodings that will be accepted. Empty list means no encoding is accepted. +func (d *domainClient) SetAcceptedEncodings(ctx context.Context, args *SetAcceptedEncodingsArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Network.setAcceptedEncodings", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Network.setAcceptedEncodings", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Network", Op: "SetAcceptedEncodings", Err: err} + } + return +} + +// ClearAcceptedEncodingsOverride invokes the Network method. Clears accepted +// encodings set by setAcceptedEncodings +func (d *domainClient) ClearAcceptedEncodingsOverride(ctx context.Context) (err error) { + err = rpcc.Invoke(ctx, "Network.clearAcceptedEncodingsOverride", nil, nil, d.conn) + if err != nil { + err = &internal.OpError{Domain: "Network", Op: "ClearAcceptedEncodingsOverride", Err: err} + } + return +} + // CanClearBrowserCache invokes the Network method. Tells whether clearing // browser cache is supported. func (d *domainClient) CanClearBrowserCache(ctx context.Context) (reply *CanClearBrowserCacheReply, err error) { @@ -352,19 +376,6 @@ func (d *domainClient) SetCookies(ctx context.Context, args *SetCookiesArgs) (er return } -// SetDataSizeLimitsForTest invokes the Network method. For testing. -func (d *domainClient) SetDataSizeLimitsForTest(ctx context.Context, args *SetDataSizeLimitsForTestArgs) (err error) { - if args != nil { - err = rpcc.Invoke(ctx, "Network.setDataSizeLimitsForTest", args, nil, d.conn) - } else { - err = rpcc.Invoke(ctx, "Network.setDataSizeLimitsForTest", nil, nil, d.conn) - } - if err != nil { - err = &internal.OpError{Domain: "Network", Op: "SetDataSizeLimitsForTest", Err: err} - } - return -} - // SetExtraHTTPHeaders invokes the Network method. Specifies whether to always // send extra HTTP headers with the requests from this page. func (d *domainClient) SetExtraHTTPHeaders(ctx context.Context, args *SetExtraHTTPHeadersArgs) (err error) { @@ -920,3 +931,87 @@ func (c *trustTokenOperationDoneClient) Recv() (*TrustTokenOperationDoneReply, e } return event, nil } + +func (d *domainClient) SubresourceWebBundleMetadataReceived(ctx context.Context) (SubresourceWebBundleMetadataReceivedClient, error) { + s, err := rpcc.NewStream(ctx, "Network.subresourceWebBundleMetadataReceived", d.conn) + if err != nil { + return nil, err + } + return &subresourceWebBundleMetadataReceivedClient{Stream: s}, nil +} + +type subresourceWebBundleMetadataReceivedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *subresourceWebBundleMetadataReceivedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *subresourceWebBundleMetadataReceivedClient) Recv() (*SubresourceWebBundleMetadataReceivedReply, error) { + event := new(SubresourceWebBundleMetadataReceivedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Network", Op: "SubresourceWebBundleMetadataReceived Recv", Err: err} + } + return event, nil +} + +func (d *domainClient) SubresourceWebBundleMetadataError(ctx context.Context) (SubresourceWebBundleMetadataErrorClient, error) { + s, err := rpcc.NewStream(ctx, "Network.subresourceWebBundleMetadataError", d.conn) + if err != nil { + return nil, err + } + return &subresourceWebBundleMetadataErrorClient{Stream: s}, nil +} + +type subresourceWebBundleMetadataErrorClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *subresourceWebBundleMetadataErrorClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *subresourceWebBundleMetadataErrorClient) Recv() (*SubresourceWebBundleMetadataErrorReply, error) { + event := new(SubresourceWebBundleMetadataErrorReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Network", Op: "SubresourceWebBundleMetadataError Recv", Err: err} + } + return event, nil +} + +func (d *domainClient) SubresourceWebBundleInnerResponseParsed(ctx context.Context) (SubresourceWebBundleInnerResponseParsedClient, error) { + s, err := rpcc.NewStream(ctx, "Network.subresourceWebBundleInnerResponseParsed", d.conn) + if err != nil { + return nil, err + } + return &subresourceWebBundleInnerResponseParsedClient{Stream: s}, nil +} + +type subresourceWebBundleInnerResponseParsedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *subresourceWebBundleInnerResponseParsedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *subresourceWebBundleInnerResponseParsedClient) Recv() (*SubresourceWebBundleInnerResponseParsedReply, error) { + event := new(SubresourceWebBundleInnerResponseParsedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Network", Op: "SubresourceWebBundleInnerResponseParsed Recv", Err: err} + } + return event, nil +} + +func (d *domainClient) SubresourceWebBundleInnerResponseError(ctx context.Context) (SubresourceWebBundleInnerResponseErrorClient, error) { + s, err := rpcc.NewStream(ctx, "Network.subresourceWebBundleInnerResponseError", d.conn) + if err != nil { + return nil, err + } + return &subresourceWebBundleInnerResponseErrorClient{Stream: s}, nil +} + +type subresourceWebBundleInnerResponseErrorClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *subresourceWebBundleInnerResponseErrorClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *subresourceWebBundleInnerResponseErrorClient) Recv() (*SubresourceWebBundleInnerResponseErrorReply, error) { + event := new(SubresourceWebBundleInnerResponseErrorReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Network", Op: "SubresourceWebBundleInnerResponseError Recv", Err: err} + } + return event, nil +} diff --git a/protocol/network/event.go b/protocol/network/event.go index b2b5101..c99c23b 100644 --- a/protocol/network/event.go +++ b/protocol/network/event.go @@ -421,3 +421,68 @@ type TrustTokenOperationDoneReply struct { IssuerOrigin *string `json:"issuerOrigin,omitempty"` // Origin of the issuer in case of a "Issuance" or "Redemption" operation. IssuedTokenCount *int `json:"issuedTokenCount,omitempty"` // The number of obtained Trust Tokens on a successful "Issuance" operation. } + +// SubresourceWebBundleMetadataReceivedClient is a client for SubresourceWebBundleMetadataReceived events. +// Fired once when parsing the .wbn file has succeeded. The event contains the +// information about the web bundle contents. +type SubresourceWebBundleMetadataReceivedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*SubresourceWebBundleMetadataReceivedReply, error) + rpcc.Stream +} + +// SubresourceWebBundleMetadataReceivedReply is the reply for SubresourceWebBundleMetadataReceived events. +type SubresourceWebBundleMetadataReceivedReply struct { + RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another event. + URLs []string `json:"urls"` // A list of URLs of resources in the subresource Web Bundle. +} + +// SubresourceWebBundleMetadataErrorClient is a client for SubresourceWebBundleMetadataError events. +// Fired once when parsing the .wbn file has failed. +type SubresourceWebBundleMetadataErrorClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*SubresourceWebBundleMetadataErrorReply, error) + rpcc.Stream +} + +// SubresourceWebBundleMetadataErrorReply is the reply for SubresourceWebBundleMetadataError events. +type SubresourceWebBundleMetadataErrorReply struct { + RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another event. + ErrorMessage string `json:"errorMessage"` // Error message +} + +// SubresourceWebBundleInnerResponseParsedClient is a client for SubresourceWebBundleInnerResponseParsed events. +// Fired when handling requests for resources within a .wbn file. Note: this +// will only be fired for resources that are requested by the webpage. +type SubresourceWebBundleInnerResponseParsedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*SubresourceWebBundleInnerResponseParsedReply, error) + rpcc.Stream +} + +// SubresourceWebBundleInnerResponseParsedReply is the reply for SubresourceWebBundleInnerResponseParsed events. +type SubresourceWebBundleInnerResponseParsedReply struct { + InnerRequestID RequestID `json:"innerRequestId"` // Request identifier of the subresource request + InnerRequestURL string `json:"innerRequestURL"` // URL of the subresource resource. + BundleRequestID *RequestID `json:"bundleRequestId,omitempty"` // Bundle request identifier. Used to match this information to another event. This made be absent in case when the instrumentation was enabled only after webbundle was parsed. +} + +// SubresourceWebBundleInnerResponseErrorClient is a client for SubresourceWebBundleInnerResponseError events. +// Fired when request for resources within a .wbn file failed. +type SubresourceWebBundleInnerResponseErrorClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*SubresourceWebBundleInnerResponseErrorReply, error) + rpcc.Stream +} + +// SubresourceWebBundleInnerResponseErrorReply is the reply for SubresourceWebBundleInnerResponseError events. +type SubresourceWebBundleInnerResponseErrorReply struct { + InnerRequestID RequestID `json:"innerRequestId"` // Request identifier of the subresource request + InnerRequestURL string `json:"innerRequestURL"` // URL of the subresource resource. + ErrorMessage string `json:"errorMessage"` // Error message + BundleRequestID *RequestID `json:"bundleRequestId,omitempty"` // Bundle request identifier. Used to match this information to another event. This made be absent in case when the instrumentation was enabled only after webbundle was parsed. +} diff --git a/protocol/network/types.go b/protocol/network/types.go index a58a94c..71604ca 100644 --- a/protocol/network/types.go +++ b/protocol/network/types.go @@ -374,6 +374,11 @@ type Request struct { // // Note: This property is experimental. TrustTokenParams *TrustTokenParams `json:"trustTokenParams,omitempty"` + // IsSameSite True if this resource request is considered to be the + // 'same site' as the request correspondinfg to the main frame. + // + // Note: This property is experimental. + IsSameSite *bool `json:"isSameSite,omitempty"` } // SignedCertificateTimestamp Details of a signed certificate timestamp (SCT). @@ -494,11 +499,12 @@ const ( CORSErrorHeaderDisallowedByPreflightResponse CORSError = "HeaderDisallowedByPreflightResponse" CORSErrorRedirectContainsCredentials CORSError = "RedirectContainsCredentials" CORSErrorInsecurePrivateNetwork CORSError = "InsecurePrivateNetwork" + CORSErrorNoCORSRedirectModeNotFollow CORSError = "NoCorsRedirectModeNotFollow" ) func (e CORSError) Valid() bool { switch e { - case "DisallowedByMode", "InvalidResponse", "WildcardOriginNotAllowed", "MissingAllowOriginHeader", "MultipleAllowOriginValues", "InvalidAllowOriginValue", "AllowOriginMismatch", "InvalidAllowCredentials", "CorsDisabledScheme", "PreflightInvalidStatus", "PreflightDisallowedRedirect", "PreflightWildcardOriginNotAllowed", "PreflightMissingAllowOriginHeader", "PreflightMultipleAllowOriginValues", "PreflightInvalidAllowOriginValue", "PreflightAllowOriginMismatch", "PreflightInvalidAllowCredentials", "PreflightMissingAllowExternal", "PreflightInvalidAllowExternal", "InvalidAllowMethodsPreflightResponse", "InvalidAllowHeadersPreflightResponse", "MethodDisallowedByPreflightResponse", "HeaderDisallowedByPreflightResponse", "RedirectContainsCredentials", "InsecurePrivateNetwork": + case "DisallowedByMode", "InvalidResponse", "WildcardOriginNotAllowed", "MissingAllowOriginHeader", "MultipleAllowOriginValues", "InvalidAllowOriginValue", "AllowOriginMismatch", "InvalidAllowCredentials", "CorsDisabledScheme", "PreflightInvalidStatus", "PreflightDisallowedRedirect", "PreflightWildcardOriginNotAllowed", "PreflightMissingAllowOriginHeader", "PreflightMultipleAllowOriginValues", "PreflightInvalidAllowOriginValue", "PreflightAllowOriginMismatch", "PreflightInvalidAllowCredentials", "PreflightMissingAllowExternal", "PreflightInvalidAllowExternal", "InvalidAllowMethodsPreflightResponse", "InvalidAllowHeadersPreflightResponse", "MethodDisallowedByPreflightResponse", "HeaderDisallowedByPreflightResponse", "RedirectContainsCredentials", "InsecurePrivateNetwork", "NoCorsRedirectModeNotFollow": return true default: return false @@ -873,7 +879,7 @@ func (e InterceptionStage) String() string { // // Note: This type is experimental. type RequestPattern struct { - URLPattern *string `json:"urlPattern,omitempty"` // Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*". + URLPattern *string `json:"urlPattern,omitempty"` // Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to `"*"`. ResourceType ResourceType `json:"resourceType,omitempty"` // If set, only requests for matching resource types will be intercepted. InterceptionStage InterceptionStage `json:"interceptionStage,omitempty"` // Stage at which to begin intercepting requests. Default is Request. } @@ -954,6 +960,32 @@ type SignedExchangeInfo struct { Errors []SignedExchangeError `json:"errors,omitempty"` // Errors occurred while handling the signed exchagne. } +// ContentEncoding List of content encodings supported by the backend. +// +// Note: This type is experimental. +type ContentEncoding string + +// ContentEncoding as enums. +const ( + ContentEncodingNotSet ContentEncoding = "" + ContentEncodingDeflate ContentEncoding = "deflate" + ContentEncodingGzip ContentEncoding = "gzip" + ContentEncodingBR ContentEncoding = "br" +) + +func (e ContentEncoding) Valid() bool { + switch e { + case "deflate", "gzip", "br": + return true + default: + return false + } +} + +func (e ContentEncoding) String() string { + return string(e) +} + // PrivateNetworkRequestPolicy // // Note: This type is experimental. @@ -1060,15 +1092,15 @@ type CrossOriginEmbedderPolicyValue string // CrossOriginEmbedderPolicyValue as enums. const ( - CrossOriginEmbedderPolicyValueNotSet CrossOriginEmbedderPolicyValue = "" - CrossOriginEmbedderPolicyValueNone CrossOriginEmbedderPolicyValue = "None" - CrossOriginEmbedderPolicyValueCORSOrCredentialless CrossOriginEmbedderPolicyValue = "CorsOrCredentialless" - CrossOriginEmbedderPolicyValueRequireCorp CrossOriginEmbedderPolicyValue = "RequireCorp" + CrossOriginEmbedderPolicyValueNotSet CrossOriginEmbedderPolicyValue = "" + CrossOriginEmbedderPolicyValueNone CrossOriginEmbedderPolicyValue = "None" + CrossOriginEmbedderPolicyValueCredentialless CrossOriginEmbedderPolicyValue = "Credentialless" + CrossOriginEmbedderPolicyValueRequireCorp CrossOriginEmbedderPolicyValue = "RequireCorp" ) func (e CrossOriginEmbedderPolicyValue) Valid() bool { switch e { - case "None", "CorsOrCredentialless", "RequireCorp": + case "None", "Credentialless", "RequireCorp": return true default: return false diff --git a/protocol/overlay/command.go b/protocol/overlay/command.go index 9db03d8..d373570 100644 --- a/protocol/overlay/command.go +++ b/protocol/overlay/command.go @@ -363,6 +363,30 @@ func NewSetShowFlexOverlaysArgs(flexNodeHighlightConfigs []FlexNodeHighlightConf return args } +// SetShowScrollSnapOverlaysArgs represents the arguments for SetShowScrollSnapOverlays in the Overlay domain. +type SetShowScrollSnapOverlaysArgs struct { + ScrollSnapHighlightConfigs []ScrollSnapHighlightConfig `json:"scrollSnapHighlightConfigs"` // An array of node identifiers and descriptors for the highlight appearance. +} + +// NewSetShowScrollSnapOverlaysArgs initializes SetShowScrollSnapOverlaysArgs with the required arguments. +func NewSetShowScrollSnapOverlaysArgs(scrollSnapHighlightConfigs []ScrollSnapHighlightConfig) *SetShowScrollSnapOverlaysArgs { + args := new(SetShowScrollSnapOverlaysArgs) + args.ScrollSnapHighlightConfigs = scrollSnapHighlightConfigs + return args +} + +// SetShowContainerQueryOverlaysArgs represents the arguments for SetShowContainerQueryOverlays in the Overlay domain. +type SetShowContainerQueryOverlaysArgs struct { + ContainerQueryHighlightConfigs []ContainerQueryHighlightConfig `json:"containerQueryHighlightConfigs"` // An array of node identifiers and descriptors for the highlight appearance. +} + +// NewSetShowContainerQueryOverlaysArgs initializes SetShowContainerQueryOverlaysArgs with the required arguments. +func NewSetShowContainerQueryOverlaysArgs(containerQueryHighlightConfigs []ContainerQueryHighlightConfig) *SetShowContainerQueryOverlaysArgs { + args := new(SetShowContainerQueryOverlaysArgs) + args.ContainerQueryHighlightConfigs = containerQueryHighlightConfigs + return args +} + // SetShowPaintRectsArgs represents the arguments for SetShowPaintRects in the Overlay domain. type SetShowPaintRectsArgs struct { Result bool `json:"result"` // True for showing paint rectangles diff --git a/protocol/overlay/domain.go b/protocol/overlay/domain.go index 910793e..3891372 100644 --- a/protocol/overlay/domain.go +++ b/protocol/overlay/domain.go @@ -92,7 +92,9 @@ func (d *domainClient) HideHighlight(ctx context.Context) (err error) { } // HighlightFrame invokes the Overlay method. Highlights owner element of the -// frame with given id. +// frame with given id. Deprecated: Doesn't work reliablity and cannot be fixed +// due to process separatation (the owner node might be in a different +// process). Determine the owner node in the client and use highlightNode. func (d *domainClient) HighlightFrame(ctx context.Context, args *HighlightFrameArgs) (err error) { if args != nil { err = rpcc.Invoke(ctx, "Overlay.highlightFrame", args, nil, d.conn) @@ -260,6 +262,32 @@ func (d *domainClient) SetShowFlexOverlays(ctx context.Context, args *SetShowFle return } +// SetShowScrollSnapOverlays invokes the Overlay method. +func (d *domainClient) SetShowScrollSnapOverlays(ctx context.Context, args *SetShowScrollSnapOverlaysArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Overlay.setShowScrollSnapOverlays", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Overlay.setShowScrollSnapOverlays", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Overlay", Op: "SetShowScrollSnapOverlays", Err: err} + } + return +} + +// SetShowContainerQueryOverlays invokes the Overlay method. +func (d *domainClient) SetShowContainerQueryOverlays(ctx context.Context, args *SetShowContainerQueryOverlaysArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Overlay.setShowContainerQueryOverlays", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Overlay.setShowContainerQueryOverlays", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Overlay", Op: "SetShowContainerQueryOverlays", Err: err} + } + return +} + // SetShowPaintRects invokes the Overlay method. Requests that backend shows // paint rectangles func (d *domainClient) SetShowPaintRects(ctx context.Context, args *SetShowPaintRectsArgs) (err error) { diff --git a/protocol/overlay/types.go b/protocol/overlay/types.go index 0d836b0..79c31b3 100644 --- a/protocol/overlay/types.go +++ b/protocol/overlay/types.go @@ -108,24 +108,25 @@ func (e ContrastAlgorithm) String() string { // HighlightConfig Configuration data for the highlighting of page elements. type HighlightConfig struct { - ShowInfo *bool `json:"showInfo,omitempty"` // Whether the node info tooltip should be shown (default: false). - ShowStyles *bool `json:"showStyles,omitempty"` // Whether the node styles in the tooltip (default: false). - ShowRulers *bool `json:"showRulers,omitempty"` // Whether the rulers should be shown (default: false). - ShowAccessibilityInfo *bool `json:"showAccessibilityInfo,omitempty"` // Whether the a11y info should be shown (default: true). - ShowExtensionLines *bool `json:"showExtensionLines,omitempty"` // Whether the extension lines from node to the rulers should be shown (default: false). - ContentColor *dom.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent). - PaddingColor *dom.RGBA `json:"paddingColor,omitempty"` // The padding highlight fill color (default: transparent). - BorderColor *dom.RGBA `json:"borderColor,omitempty"` // The border highlight fill color (default: transparent). - MarginColor *dom.RGBA `json:"marginColor,omitempty"` // The margin highlight fill color (default: transparent). - EventTargetColor *dom.RGBA `json:"eventTargetColor,omitempty"` // The event target element highlight fill color (default: transparent). - ShapeColor *dom.RGBA `json:"shapeColor,omitempty"` // The shape outside fill color (default: transparent). - ShapeMarginColor *dom.RGBA `json:"shapeMarginColor,omitempty"` // The shape margin fill color (default: transparent). - CSSGridColor *dom.RGBA `json:"cssGridColor,omitempty"` // The grid layout color (default: transparent). - ColorFormat ColorFormat `json:"colorFormat,omitempty"` // The color format used to format color styles (default: hex). - GridHighlightConfig *GridHighlightConfig `json:"gridHighlightConfig,omitempty"` // The grid layout highlight configuration (default: all transparent). - FlexContainerHighlightConfig *FlexContainerHighlightConfig `json:"flexContainerHighlightConfig,omitempty"` // The flex container highlight configuration (default: all transparent). - FlexItemHighlightConfig *FlexItemHighlightConfig `json:"flexItemHighlightConfig,omitempty"` // The flex item highlight configuration (default: all transparent). - ContrastAlgorithm ContrastAlgorithm `json:"contrastAlgorithm,omitempty"` // The contrast algorithm to use for the contrast ratio (default: aa). + ShowInfo *bool `json:"showInfo,omitempty"` // Whether the node info tooltip should be shown (default: false). + ShowStyles *bool `json:"showStyles,omitempty"` // Whether the node styles in the tooltip (default: false). + ShowRulers *bool `json:"showRulers,omitempty"` // Whether the rulers should be shown (default: false). + ShowAccessibilityInfo *bool `json:"showAccessibilityInfo,omitempty"` // Whether the a11y info should be shown (default: true). + ShowExtensionLines *bool `json:"showExtensionLines,omitempty"` // Whether the extension lines from node to the rulers should be shown (default: false). + ContentColor *dom.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent). + PaddingColor *dom.RGBA `json:"paddingColor,omitempty"` // The padding highlight fill color (default: transparent). + BorderColor *dom.RGBA `json:"borderColor,omitempty"` // The border highlight fill color (default: transparent). + MarginColor *dom.RGBA `json:"marginColor,omitempty"` // The margin highlight fill color (default: transparent). + EventTargetColor *dom.RGBA `json:"eventTargetColor,omitempty"` // The event target element highlight fill color (default: transparent). + ShapeColor *dom.RGBA `json:"shapeColor,omitempty"` // The shape outside fill color (default: transparent). + ShapeMarginColor *dom.RGBA `json:"shapeMarginColor,omitempty"` // The shape margin fill color (default: transparent). + CSSGridColor *dom.RGBA `json:"cssGridColor,omitempty"` // The grid layout color (default: transparent). + ColorFormat ColorFormat `json:"colorFormat,omitempty"` // The color format used to format color styles (default: hex). + GridHighlightConfig *GridHighlightConfig `json:"gridHighlightConfig,omitempty"` // The grid layout highlight configuration (default: all transparent). + FlexContainerHighlightConfig *FlexContainerHighlightConfig `json:"flexContainerHighlightConfig,omitempty"` // The flex container highlight configuration (default: all transparent). + FlexItemHighlightConfig *FlexItemHighlightConfig `json:"flexItemHighlightConfig,omitempty"` // The flex item highlight configuration (default: all transparent). + ContrastAlgorithm ContrastAlgorithm `json:"contrastAlgorithm,omitempty"` // The contrast algorithm to use for the contrast ratio (default: aa). + ContainerQueryContainerHighlightConfig *ContainerQueryContainerHighlightConfig `json:"containerQueryContainerHighlightConfig,omitempty"` // The container query container highlight configuration (default: all transparent). } // ColorFormat @@ -164,6 +165,20 @@ type FlexNodeHighlightConfig struct { NodeID dom.NodeID `json:"nodeId"` // Identifier of the node to highlight. } +// ScrollSnapContainerHighlightConfig +type ScrollSnapContainerHighlightConfig struct { + SnapportBorder *LineStyle `json:"snapportBorder,omitempty"` // The style of the snapport border (default: transparent) + SnapAreaBorder *LineStyle `json:"snapAreaBorder,omitempty"` // The style of the snap area border (default: transparent) + ScrollMarginColor *dom.RGBA `json:"scrollMarginColor,omitempty"` // The margin highlight fill color (default: transparent). + ScrollPaddingColor *dom.RGBA `json:"scrollPaddingColor,omitempty"` // The padding highlight fill color (default: transparent). +} + +// ScrollSnapHighlightConfig +type ScrollSnapHighlightConfig struct { + ScrollSnapContainerHighlightConfig ScrollSnapContainerHighlightConfig `json:"scrollSnapContainerHighlightConfig"` // A descriptor for the highlight appearance of scroll snap containers. + NodeID dom.NodeID `json:"nodeId"` // Identifier of the node to highlight. +} + // HingeConfig Configuration for dual screen hinge type HingeConfig struct { Rect dom.Rect `json:"rect"` // A rectangle represent hinge @@ -171,6 +186,17 @@ type HingeConfig struct { OutlineColor *dom.RGBA `json:"outlineColor,omitempty"` // The content box highlight outline color (default: transparent). } +// ContainerQueryHighlightConfig +type ContainerQueryHighlightConfig struct { + ContainerQueryContainerHighlightConfig ContainerQueryContainerHighlightConfig `json:"containerQueryContainerHighlightConfig"` // A descriptor for the highlight appearance of container query containers. + NodeID dom.NodeID `json:"nodeId"` // Identifier of the container node to highlight. +} + +// ContainerQueryContainerHighlightConfig +type ContainerQueryContainerHighlightConfig struct { + ContainerBorder *LineStyle `json:"containerBorder,omitempty"` // The style of the container border +} + // InspectMode type InspectMode string diff --git a/protocol/page/command.go b/protocol/page/command.go index 4a25855..f0617e3 100644 --- a/protocol/page/command.go +++ b/protocol/page/command.go @@ -37,6 +37,11 @@ type AddScriptToEvaluateOnNewDocumentArgs struct { // // Note: This property is experimental. WorldName *string `json:"worldName,omitempty"` + // IncludeCommandLineAPI Specifies whether command line API should be + // available to the script, defaults to false. + // + // Note: This property is experimental. + IncludeCommandLineAPI *bool `json:"includeCommandLineAPI,omitempty"` } // NewAddScriptToEvaluateOnNewDocumentArgs initializes AddScriptToEvaluateOnNewDocumentArgs with the required arguments. @@ -58,6 +63,16 @@ func (a *AddScriptToEvaluateOnNewDocumentArgs) SetWorldName(worldName string) *A return a } +// SetIncludeCommandLineAPI sets the IncludeCommandLineAPI optional argument. +// Specifies whether command line API should be available to the +// script, defaults to false. +// +// Note: This property is experimental. +func (a *AddScriptToEvaluateOnNewDocumentArgs) SetIncludeCommandLineAPI(includeCommandLineAPI bool) *AddScriptToEvaluateOnNewDocumentArgs { + a.IncludeCommandLineAPI = &includeCommandLineAPI + return a +} + // AddScriptToEvaluateOnNewDocumentReply represents the return values for AddScriptToEvaluateOnNewDocument in the Page domain. type AddScriptToEvaluateOnNewDocumentReply struct { Identifier ScriptIdentifier `json:"identifier"` // Identifier of the added script. @@ -67,7 +82,7 @@ type AddScriptToEvaluateOnNewDocumentReply struct { type CaptureScreenshotArgs struct { // Format Image compression format (defaults to png). // - // Values: "jpeg", "png". + // Values: "jpeg", "png", "webp". Format *string `json:"format,omitempty"` Quality *int `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only). Clip *Viewport `json:"clip,omitempty"` // Capture the screenshot of a given region only. @@ -93,7 +108,7 @@ func NewCaptureScreenshotArgs() *CaptureScreenshotArgs { // SetFormat sets the Format optional argument. Image compression // format (defaults to png). // -// Values: "jpeg", "png". +// Values: "jpeg", "png", "webp". func (a *CaptureScreenshotArgs) SetFormat(format string) *CaptureScreenshotArgs { a.Format = &format return a diff --git a/protocol/page/domain.go b/protocol/page/domain.go index c9abf0d..a0c984a 100644 --- a/protocol/page/domain.go +++ b/protocol/page/domain.go @@ -1026,6 +1026,27 @@ func (c *lifecycleEventClient) Recv() (*LifecycleEventReply, error) { return event, nil } +func (d *domainClient) BackForwardCacheNotUsed(ctx context.Context) (BackForwardCacheNotUsedClient, error) { + s, err := rpcc.NewStream(ctx, "Page.backForwardCacheNotUsed", d.conn) + if err != nil { + return nil, err + } + return &backForwardCacheNotUsedClient{Stream: s}, nil +} + +type backForwardCacheNotUsedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *backForwardCacheNotUsedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *backForwardCacheNotUsedClient) Recv() (*BackForwardCacheNotUsedReply, error) { + event := new(BackForwardCacheNotUsedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Page", Op: "BackForwardCacheNotUsed Recv", Err: err} + } + return event, nil +} + func (d *domainClient) LoadEventFired(ctx context.Context) (LoadEventFiredClient, error) { s, err := rpcc.NewStream(ctx, "Page.loadEventFired", d.conn) if err != nil { diff --git a/protocol/page/event.go b/protocol/page/event.go index 52ec42c..5b0a45e 100644 --- a/protocol/page/event.go +++ b/protocol/page/event.go @@ -110,6 +110,10 @@ type FrameNavigatedClient interface { // FrameNavigatedReply is the reply for FrameNavigated events. type FrameNavigatedReply struct { Frame Frame `json:"frame"` // Frame object. + // Type + // + // Note: This property is experimental. + Type NavigationType `json:"type"` } // DocumentOpenedClient is a client for DocumentOpened events. Fired when @@ -202,7 +206,8 @@ type FrameStoppedLoadingReply struct { } // DownloadWillBeginClient is a client for DownloadWillBegin events. Fired -// when page is about to start a download. +// when page is about to start a download. Deprecated. Use +// Browser.downloadWillBegin instead. type DownloadWillBeginClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. @@ -219,7 +224,8 @@ type DownloadWillBeginReply struct { } // DownloadProgressClient is a client for DownloadProgress events. Fired when -// download makes progress. Last call has |done| == true. +// download makes progress. Last call has |done| == true. Deprecated. Use +// Browser.downloadProgress instead. type DownloadProgressClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. @@ -316,6 +322,25 @@ type LifecycleEventReply struct { Timestamp network.MonotonicTime `json:"timestamp"` // No description. } +// BackForwardCacheNotUsedClient is a client for BackForwardCacheNotUsed events. +// Fired for failed bfcache history navigations if BackForwardCache feature is +// enabled. Do not assume any ordering with the Page.frameNavigated event. This +// event is fired only for main-frame history navigation where the document +// changes (non-same-document navigations), when bfcache navigation fails. +type BackForwardCacheNotUsedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*BackForwardCacheNotUsedReply, error) + rpcc.Stream +} + +// BackForwardCacheNotUsedReply is the reply for BackForwardCacheNotUsed events. +type BackForwardCacheNotUsedReply struct { + LoaderID network.LoaderID `json:"loaderId"` // The loader id for the associated navgation. + FrameID FrameID `json:"frameId"` // The frame id of the associated frame. + NotRestoredExplanations []BackForwardCacheNotRestoredExplanation `json:"notRestoredExplanations"` // Array of reasons why the page could not be cached. This must not be empty. +} + // LoadEventFiredClient is a client for LoadEventFired events. type LoadEventFiredClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is diff --git a/protocol/page/types.go b/protocol/page/types.go index 60abed9..e443e5c 100644 --- a/protocol/page/types.go +++ b/protocol/page/types.go @@ -36,6 +36,41 @@ func (e AdFrameType) String() string { return string(e) } +// AdFrameExplanation +// +// Note: This type is experimental. +type AdFrameExplanation string + +// AdFrameExplanation as enums. +const ( + AdFrameExplanationNotSet AdFrameExplanation = "" + AdFrameExplanationParentIsAd AdFrameExplanation = "ParentIsAd" + AdFrameExplanationCreatedByAdScript AdFrameExplanation = "CreatedByAdScript" + AdFrameExplanationMatchedBlockingRule AdFrameExplanation = "MatchedBlockingRule" +) + +func (e AdFrameExplanation) Valid() bool { + switch e { + case "ParentIsAd", "CreatedByAdScript", "MatchedBlockingRule": + return true + default: + return false + } +} + +func (e AdFrameExplanation) String() string { + return string(e) +} + +// AdFrameStatus Indicates whether a frame has been identified as an ad and +// why. +// +// Note: This type is experimental. +type AdFrameStatus struct { + AdFrameType AdFrameType `json:"adFrameType"` // No description. + Explanations []AdFrameExplanation `json:"explanations,omitempty"` // No description. +} + // SecureContextType Indicates whether the frame is a secure context and why // it is the case. // @@ -120,7 +155,7 @@ func (e GatedAPIFeatures) String() string { // PermissionsPolicyFeature All Permissions Policy features. This enum should // match the one defined in -// renderer/core/feature_policy/feature_policy_features.json5. +// third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5. // // Note: This type is experimental. type PermissionsPolicyFeature string @@ -130,6 +165,7 @@ const ( PermissionsPolicyFeatureNotSet PermissionsPolicyFeature = "" PermissionsPolicyFeatureAccelerometer PermissionsPolicyFeature = "accelerometer" PermissionsPolicyFeatureAmbientLightSensor PermissionsPolicyFeature = "ambient-light-sensor" + PermissionsPolicyFeatureAttributionReporting PermissionsPolicyFeature = "attribution-reporting" PermissionsPolicyFeatureAutoplay PermissionsPolicyFeature = "autoplay" PermissionsPolicyFeatureCamera PermissionsPolicyFeature = "camera" PermissionsPolicyFeatureChDpr PermissionsPolicyFeature = "ch-dpr" @@ -137,9 +173,11 @@ const ( PermissionsPolicyFeatureChDownlink PermissionsPolicyFeature = "ch-downlink" PermissionsPolicyFeatureChEct PermissionsPolicyFeature = "ch-ect" PermissionsPolicyFeatureChLang PermissionsPolicyFeature = "ch-lang" + PermissionsPolicyFeatureChPrefersColorScheme PermissionsPolicyFeature = "ch-prefers-color-scheme" PermissionsPolicyFeatureChRtt PermissionsPolicyFeature = "ch-rtt" PermissionsPolicyFeatureChUa PermissionsPolicyFeature = "ch-ua" PermissionsPolicyFeatureChUaArch PermissionsPolicyFeature = "ch-ua-arch" + PermissionsPolicyFeatureChUaBitness PermissionsPolicyFeature = "ch-ua-bitness" PermissionsPolicyFeatureChUaPlatform PermissionsPolicyFeature = "ch-ua-platform" PermissionsPolicyFeatureChUaModel PermissionsPolicyFeature = "ch-ua-model" PermissionsPolicyFeatureChUaMobile PermissionsPolicyFeature = "ch-ua-mobile" @@ -149,8 +187,8 @@ const ( PermissionsPolicyFeatureChWidth PermissionsPolicyFeature = "ch-width" PermissionsPolicyFeatureClipboardRead PermissionsPolicyFeature = "clipboard-read" PermissionsPolicyFeatureClipboardWrite PermissionsPolicyFeature = "clipboard-write" - PermissionsPolicyFeatureConversionMeasurement PermissionsPolicyFeature = "conversion-measurement" PermissionsPolicyFeatureCrossOriginIsolated PermissionsPolicyFeature = "cross-origin-isolated" + PermissionsPolicyFeatureDirectSockets PermissionsPolicyFeature = "direct-sockets" PermissionsPolicyFeatureDisplayCapture PermissionsPolicyFeature = "display-capture" PermissionsPolicyFeatureDocumentDomain PermissionsPolicyFeature = "document-domain" PermissionsPolicyFeatureEncryptedMedia PermissionsPolicyFeature = "encrypted-media" @@ -174,18 +212,20 @@ const ( PermissionsPolicyFeaturePublickeyCredentialsGet PermissionsPolicyFeature = "publickey-credentials-get" PermissionsPolicyFeatureScreenWakeLock PermissionsPolicyFeature = "screen-wake-lock" PermissionsPolicyFeatureSerial PermissionsPolicyFeature = "serial" + PermissionsPolicyFeatureSharedAutofill PermissionsPolicyFeature = "shared-autofill" PermissionsPolicyFeatureStorageAccessAPI PermissionsPolicyFeature = "storage-access-api" PermissionsPolicyFeatureSyncXhr PermissionsPolicyFeature = "sync-xhr" PermissionsPolicyFeatureTrustTokenRedemption PermissionsPolicyFeature = "trust-token-redemption" PermissionsPolicyFeatureUSB PermissionsPolicyFeature = "usb" PermissionsPolicyFeatureVerticalScroll PermissionsPolicyFeature = "vertical-scroll" PermissionsPolicyFeatureWebShare PermissionsPolicyFeature = "web-share" + PermissionsPolicyFeatureWindowPlacement PermissionsPolicyFeature = "window-placement" PermissionsPolicyFeatureXrSpatialTracking PermissionsPolicyFeature = "xr-spatial-tracking" ) func (e PermissionsPolicyFeature) Valid() bool { switch e { - case "accelerometer", "ambient-light-sensor", "autoplay", "camera", "ch-dpr", "ch-device-memory", "ch-downlink", "ch-ect", "ch-lang", "ch-rtt", "ch-ua", "ch-ua-arch", "ch-ua-platform", "ch-ua-model", "ch-ua-mobile", "ch-ua-full-version", "ch-ua-platform-version", "ch-viewport-width", "ch-width", "clipboard-read", "clipboard-write", "conversion-measurement", "cross-origin-isolated", "display-capture", "document-domain", "encrypted-media", "execution-while-out-of-viewport", "execution-while-not-rendered", "focus-without-user-activation", "fullscreen", "frobulate", "gamepad", "geolocation", "gyroscope", "hid", "idle-detection", "interest-cohort", "magnetometer", "microphone", "midi", "otp-credentials", "payment", "picture-in-picture", "publickey-credentials-get", "screen-wake-lock", "serial", "storage-access-api", "sync-xhr", "trust-token-redemption", "usb", "vertical-scroll", "web-share", "xr-spatial-tracking": + case "accelerometer", "ambient-light-sensor", "attribution-reporting", "autoplay", "camera", "ch-dpr", "ch-device-memory", "ch-downlink", "ch-ect", "ch-lang", "ch-prefers-color-scheme", "ch-rtt", "ch-ua", "ch-ua-arch", "ch-ua-bitness", "ch-ua-platform", "ch-ua-model", "ch-ua-mobile", "ch-ua-full-version", "ch-ua-platform-version", "ch-viewport-width", "ch-width", "clipboard-read", "clipboard-write", "cross-origin-isolated", "direct-sockets", "display-capture", "document-domain", "encrypted-media", "execution-while-out-of-viewport", "execution-while-not-rendered", "focus-without-user-activation", "fullscreen", "frobulate", "gamepad", "geolocation", "gyroscope", "hid", "idle-detection", "interest-cohort", "magnetometer", "microphone", "midi", "otp-credentials", "payment", "picture-in-picture", "publickey-credentials-get", "screen-wake-lock", "serial", "shared-autofill", "storage-access-api", "sync-xhr", "trust-token-redemption", "usb", "vertical-scroll", "web-share", "window-placement", "xr-spatial-tracking": return true default: return false @@ -239,6 +279,124 @@ type PermissionsPolicyFeatureState struct { Locator *PermissionsPolicyBlockLocator `json:"locator,omitempty"` // No description. } +// OriginTrialTokenStatus Origin +// Trial(https://www.chromium.org/blink/origin-trials) support. Status for an +// Origin Trial token. +// +// Note: This type is experimental. +type OriginTrialTokenStatus string + +// OriginTrialTokenStatus as enums. +const ( + OriginTrialTokenStatusNotSet OriginTrialTokenStatus = "" + OriginTrialTokenStatusSuccess OriginTrialTokenStatus = "Success" + OriginTrialTokenStatusNotSupported OriginTrialTokenStatus = "NotSupported" + OriginTrialTokenStatusInsecure OriginTrialTokenStatus = "Insecure" + OriginTrialTokenStatusExpired OriginTrialTokenStatus = "Expired" + OriginTrialTokenStatusWrongOrigin OriginTrialTokenStatus = "WrongOrigin" + OriginTrialTokenStatusInvalidSignature OriginTrialTokenStatus = "InvalidSignature" + OriginTrialTokenStatusMalformed OriginTrialTokenStatus = "Malformed" + OriginTrialTokenStatusWrongVersion OriginTrialTokenStatus = "WrongVersion" + OriginTrialTokenStatusFeatureDisabled OriginTrialTokenStatus = "FeatureDisabled" + OriginTrialTokenStatusTokenDisabled OriginTrialTokenStatus = "TokenDisabled" + OriginTrialTokenStatusFeatureDisabledForUser OriginTrialTokenStatus = "FeatureDisabledForUser" +) + +func (e OriginTrialTokenStatus) Valid() bool { + switch e { + case "Success", "NotSupported", "Insecure", "Expired", "WrongOrigin", "InvalidSignature", "Malformed", "WrongVersion", "FeatureDisabled", "TokenDisabled", "FeatureDisabledForUser": + return true + default: + return false + } +} + +func (e OriginTrialTokenStatus) String() string { + return string(e) +} + +// OriginTrialStatus Status for an Origin Trial. +// +// Note: This type is experimental. +type OriginTrialStatus string + +// OriginTrialStatus as enums. +const ( + OriginTrialStatusNotSet OriginTrialStatus = "" + OriginTrialStatusEnabled OriginTrialStatus = "Enabled" + OriginTrialStatusValidTokenNotProvided OriginTrialStatus = "ValidTokenNotProvided" + OriginTrialStatusOSNotSupported OriginTrialStatus = "OSNotSupported" + OriginTrialStatusTrialNotAllowed OriginTrialStatus = "TrialNotAllowed" +) + +func (e OriginTrialStatus) Valid() bool { + switch e { + case "Enabled", "ValidTokenNotProvided", "OSNotSupported", "TrialNotAllowed": + return true + default: + return false + } +} + +func (e OriginTrialStatus) String() string { + return string(e) +} + +// OriginTrialUsageRestriction +// +// Note: This type is experimental. +type OriginTrialUsageRestriction string + +// OriginTrialUsageRestriction as enums. +const ( + OriginTrialUsageRestrictionNotSet OriginTrialUsageRestriction = "" + OriginTrialUsageRestrictionNone OriginTrialUsageRestriction = "None" + OriginTrialUsageRestrictionSubset OriginTrialUsageRestriction = "Subset" +) + +func (e OriginTrialUsageRestriction) Valid() bool { + switch e { + case "None", "Subset": + return true + default: + return false + } +} + +func (e OriginTrialUsageRestriction) String() string { + return string(e) +} + +// OriginTrialToken +// +// Note: This type is experimental. +type OriginTrialToken struct { + Origin string `json:"origin"` // No description. + MatchSubDomains bool `json:"matchSubDomains"` // No description. + TrialName string `json:"trialName"` // No description. + ExpiryTime network.TimeSinceEpoch `json:"expiryTime"` // No description. + IsThirdParty bool `json:"isThirdParty"` // No description. + UsageRestriction OriginTrialUsageRestriction `json:"usageRestriction"` // No description. +} + +// OriginTrialTokenWithStatus +// +// Note: This type is experimental. +type OriginTrialTokenWithStatus struct { + RawTokenText string `json:"rawTokenText"` // No description. + ParsedToken *OriginTrialToken `json:"parsedToken,omitempty"` // `parsedToken` is present only when the token is extractable and parsable. + Status OriginTrialTokenStatus `json:"status"` // No description. +} + +// OriginTrial +// +// Note: This type is experimental. +type OriginTrial struct { + TrialName string `json:"trialName"` // No description. + Status OriginTrialStatus `json:"status"` // No description. + TokensWithStatus []OriginTrialTokenWithStatus `json:"tokensWithStatus"` // No description. +} + // Frame Information about the Frame on the page. type Frame struct { ID FrameID `json:"id"` // Frame unique identifier. @@ -265,10 +423,11 @@ type Frame struct { // // Note: This property is experimental. UnreachableURL *string `json:"unreachableUrl,omitempty"` - // AdFrameType Indicates whether this frame was tagged as an ad. + // AdFrameStatus Indicates whether this frame was tagged as an ad and + // why. // // Note: This property is experimental. - AdFrameType AdFrameType `json:"adFrameType,omitempty"` + AdFrameStatus *AdFrameStatus `json:"adFrameStatus,omitempty"` // SecureContextType Indicates whether the main document is a secure // context and explains why that is the case. // @@ -284,6 +443,11 @@ type Frame struct { // // Note: This property is experimental. GatedAPIFeatures []GatedAPIFeatures `json:"gatedAPIFeatures"` + // OriginTrials Frame document's origin trials with at least one token + // present. + // + // Note: This property is experimental. + OriginTrials []OriginTrial `json:"originTrials,omitempty"` } // FrameResource Information about the Resource on the page. @@ -577,3 +741,181 @@ type CompilationCacheParams struct { URL string `json:"url"` // The URL of the script to produce a compilation cache entry for. Eager *bool `json:"eager,omitempty"` // A hint to the backend whether eager compilation is recommended. (the actual compilation mode used is upon backend discretion). } + +// NavigationType The type of a frameNavigated event. +// +// Note: This type is experimental. +type NavigationType string + +// NavigationType as enums. +const ( + NavigationTypeNotSet NavigationType = "" + NavigationTypeNavigation NavigationType = "Navigation" + NavigationTypeBackForwardCacheRestore NavigationType = "BackForwardCacheRestore" +) + +func (e NavigationType) Valid() bool { + switch e { + case "Navigation", "BackForwardCacheRestore": + return true + default: + return false + } +} + +func (e NavigationType) String() string { + return string(e) +} + +// BackForwardCacheNotRestoredReason List of not restored reasons for +// back-forward cache. +// +// Note: This type is experimental. +type BackForwardCacheNotRestoredReason string + +// BackForwardCacheNotRestoredReason as enums. +const ( + BackForwardCacheNotRestoredReasonNotSet BackForwardCacheNotRestoredReason = "" + BackForwardCacheNotRestoredReasonNotMainFrame BackForwardCacheNotRestoredReason = "NotMainFrame" + BackForwardCacheNotRestoredReasonBackForwardCacheDisabled BackForwardCacheNotRestoredReason = "BackForwardCacheDisabled" + BackForwardCacheNotRestoredReasonRelatedActiveContentsExist BackForwardCacheNotRestoredReason = "RelatedActiveContentsExist" + BackForwardCacheNotRestoredReasonHTTPStatusNotOK BackForwardCacheNotRestoredReason = "HTTPStatusNotOK" + BackForwardCacheNotRestoredReasonSchemeNotHTTPOrHTTPS BackForwardCacheNotRestoredReason = "SchemeNotHTTPOrHTTPS" + BackForwardCacheNotRestoredReasonLoading BackForwardCacheNotRestoredReason = "Loading" + BackForwardCacheNotRestoredReasonWasGrantedMediaAccess BackForwardCacheNotRestoredReason = "WasGrantedMediaAccess" + BackForwardCacheNotRestoredReasonDisableForRenderFrameHostCalled BackForwardCacheNotRestoredReason = "DisableForRenderFrameHostCalled" + BackForwardCacheNotRestoredReasonDomainNotAllowed BackForwardCacheNotRestoredReason = "DomainNotAllowed" + BackForwardCacheNotRestoredReasonHTTPMethodNotGET BackForwardCacheNotRestoredReason = "HTTPMethodNotGET" + BackForwardCacheNotRestoredReasonSubframeIsNavigating BackForwardCacheNotRestoredReason = "SubframeIsNavigating" + BackForwardCacheNotRestoredReasonTimeout BackForwardCacheNotRestoredReason = "Timeout" + BackForwardCacheNotRestoredReasonCacheLimit BackForwardCacheNotRestoredReason = "CacheLimit" + BackForwardCacheNotRestoredReasonJavaScriptExecution BackForwardCacheNotRestoredReason = "JavaScriptExecution" + BackForwardCacheNotRestoredReasonRendererProcessKilled BackForwardCacheNotRestoredReason = "RendererProcessKilled" + BackForwardCacheNotRestoredReasonRendererProcessCrashed BackForwardCacheNotRestoredReason = "RendererProcessCrashed" + BackForwardCacheNotRestoredReasonGrantedMediaStreamAccess BackForwardCacheNotRestoredReason = "GrantedMediaStreamAccess" + BackForwardCacheNotRestoredReasonSchedulerTrackedFeatureUsed BackForwardCacheNotRestoredReason = "SchedulerTrackedFeatureUsed" + BackForwardCacheNotRestoredReasonConflictingBrowsingInstance BackForwardCacheNotRestoredReason = "ConflictingBrowsingInstance" + BackForwardCacheNotRestoredReasonCacheFlushed BackForwardCacheNotRestoredReason = "CacheFlushed" + BackForwardCacheNotRestoredReasonServiceWorkerVersionActivation BackForwardCacheNotRestoredReason = "ServiceWorkerVersionActivation" + BackForwardCacheNotRestoredReasonSessionRestored BackForwardCacheNotRestoredReason = "SessionRestored" + BackForwardCacheNotRestoredReasonServiceWorkerPostMessage BackForwardCacheNotRestoredReason = "ServiceWorkerPostMessage" + BackForwardCacheNotRestoredReasonEnteredBackForwardCacheBeforeServiceWorkerHostAdded BackForwardCacheNotRestoredReason = "EnteredBackForwardCacheBeforeServiceWorkerHostAdded" + BackForwardCacheNotRestoredReasonRenderFrameHostReusedSameSite BackForwardCacheNotRestoredReason = "RenderFrameHostReused_SameSite" + BackForwardCacheNotRestoredReasonRenderFrameHostReusedCrossSite BackForwardCacheNotRestoredReason = "RenderFrameHostReused_CrossSite" + BackForwardCacheNotRestoredReasonServiceWorkerClaim BackForwardCacheNotRestoredReason = "ServiceWorkerClaim" + BackForwardCacheNotRestoredReasonIgnoreEventAndEvict BackForwardCacheNotRestoredReason = "IgnoreEventAndEvict" + BackForwardCacheNotRestoredReasonHaveInnerContents BackForwardCacheNotRestoredReason = "HaveInnerContents" + BackForwardCacheNotRestoredReasonTimeoutPuttingInCache BackForwardCacheNotRestoredReason = "TimeoutPuttingInCache" + BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByLowMemory BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledByLowMemory" + BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByCommandLine BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledByCommandLine" + BackForwardCacheNotRestoredReasonNetworkRequestDatapipeDrainedAsBytesConsumer BackForwardCacheNotRestoredReason = "NetworkRequestDatapipeDrainedAsBytesConsumer" + BackForwardCacheNotRestoredReasonNetworkRequestRedirected BackForwardCacheNotRestoredReason = "NetworkRequestRedirected" + BackForwardCacheNotRestoredReasonNetworkRequestTimeout BackForwardCacheNotRestoredReason = "NetworkRequestTimeout" + BackForwardCacheNotRestoredReasonNetworkExceedsBufferLimit BackForwardCacheNotRestoredReason = "NetworkExceedsBufferLimit" + BackForwardCacheNotRestoredReasonNavigationCancelledWhileRestoring BackForwardCacheNotRestoredReason = "NavigationCancelledWhileRestoring" + BackForwardCacheNotRestoredReasonNotMostRecentNavigationEntry BackForwardCacheNotRestoredReason = "NotMostRecentNavigationEntry" + BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForPrerender BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledForPrerender" + BackForwardCacheNotRestoredReasonUserAgentOverrideDiffers BackForwardCacheNotRestoredReason = "UserAgentOverrideDiffers" + BackForwardCacheNotRestoredReasonForegroundCacheLimit BackForwardCacheNotRestoredReason = "ForegroundCacheLimit" + BackForwardCacheNotRestoredReasonBrowsingInstanceNotSwapped BackForwardCacheNotRestoredReason = "BrowsingInstanceNotSwapped" + BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForDelegate BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledForDelegate" + BackForwardCacheNotRestoredReasonOptInUnloadHeaderNotPresent BackForwardCacheNotRestoredReason = "OptInUnloadHeaderNotPresent" + BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame BackForwardCacheNotRestoredReason = "UnloadHandlerExistsInSubFrame" + BackForwardCacheNotRestoredReasonServiceWorkerUnregistration BackForwardCacheNotRestoredReason = "ServiceWorkerUnregistration" + BackForwardCacheNotRestoredReasonCacheControlNoStore BackForwardCacheNotRestoredReason = "CacheControlNoStore" + BackForwardCacheNotRestoredReasonCacheControlNoStoreCookieModified BackForwardCacheNotRestoredReason = "CacheControlNoStoreCookieModified" + BackForwardCacheNotRestoredReasonCacheControlNoStoreHTTPOnlyCookieModified BackForwardCacheNotRestoredReason = "CacheControlNoStoreHTTPOnlyCookieModified" + BackForwardCacheNotRestoredReasonWebSocket BackForwardCacheNotRestoredReason = "WebSocket" + BackForwardCacheNotRestoredReasonWebRTC BackForwardCacheNotRestoredReason = "WebRTC" + BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoStore BackForwardCacheNotRestoredReason = "MainResourceHasCacheControlNoStore" + BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoCache BackForwardCacheNotRestoredReason = "MainResourceHasCacheControlNoCache" + BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoStore BackForwardCacheNotRestoredReason = "SubresourceHasCacheControlNoStore" + BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoCache BackForwardCacheNotRestoredReason = "SubresourceHasCacheControlNoCache" + BackForwardCacheNotRestoredReasonContainsPlugins BackForwardCacheNotRestoredReason = "ContainsPlugins" + BackForwardCacheNotRestoredReasonDocumentLoaded BackForwardCacheNotRestoredReason = "DocumentLoaded" + BackForwardCacheNotRestoredReasonDedicatedWorkerOrWorklet BackForwardCacheNotRestoredReason = "DedicatedWorkerOrWorklet" + BackForwardCacheNotRestoredReasonOutstandingNetworkRequestOthers BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestOthers" + BackForwardCacheNotRestoredReasonOutstandingIndexedDBTransaction BackForwardCacheNotRestoredReason = "OutstandingIndexedDBTransaction" + BackForwardCacheNotRestoredReasonRequestedNotificationsPermission BackForwardCacheNotRestoredReason = "RequestedNotificationsPermission" + BackForwardCacheNotRestoredReasonRequestedMIDIPermission BackForwardCacheNotRestoredReason = "RequestedMIDIPermission" + BackForwardCacheNotRestoredReasonRequestedAudioCapturePermission BackForwardCacheNotRestoredReason = "RequestedAudioCapturePermission" + BackForwardCacheNotRestoredReasonRequestedVideoCapturePermission BackForwardCacheNotRestoredReason = "RequestedVideoCapturePermission" + BackForwardCacheNotRestoredReasonRequestedBackForwardCacheBlockedSensors BackForwardCacheNotRestoredReason = "RequestedBackForwardCacheBlockedSensors" + BackForwardCacheNotRestoredReasonRequestedBackgroundWorkPermission BackForwardCacheNotRestoredReason = "RequestedBackgroundWorkPermission" + BackForwardCacheNotRestoredReasonBroadcastChannel BackForwardCacheNotRestoredReason = "BroadcastChannel" + BackForwardCacheNotRestoredReasonIndexedDBConnection BackForwardCacheNotRestoredReason = "IndexedDBConnection" + BackForwardCacheNotRestoredReasonWebXR BackForwardCacheNotRestoredReason = "WebXR" + BackForwardCacheNotRestoredReasonSharedWorker BackForwardCacheNotRestoredReason = "SharedWorker" + BackForwardCacheNotRestoredReasonWebLocks BackForwardCacheNotRestoredReason = "WebLocks" + BackForwardCacheNotRestoredReasonWebHID BackForwardCacheNotRestoredReason = "WebHID" + BackForwardCacheNotRestoredReasonWebShare BackForwardCacheNotRestoredReason = "WebShare" + BackForwardCacheNotRestoredReasonRequestedStorageAccessGrant BackForwardCacheNotRestoredReason = "RequestedStorageAccessGrant" + BackForwardCacheNotRestoredReasonWebNFC BackForwardCacheNotRestoredReason = "WebNfc" + BackForwardCacheNotRestoredReasonWebFileSystem BackForwardCacheNotRestoredReason = "WebFileSystem" + BackForwardCacheNotRestoredReasonOutstandingNetworkRequestFetch BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestFetch" + BackForwardCacheNotRestoredReasonOutstandingNetworkRequestXHR BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestXHR" + BackForwardCacheNotRestoredReasonAppBanner BackForwardCacheNotRestoredReason = "AppBanner" + BackForwardCacheNotRestoredReasonPrinting BackForwardCacheNotRestoredReason = "Printing" + BackForwardCacheNotRestoredReasonWebDatabase BackForwardCacheNotRestoredReason = "WebDatabase" + BackForwardCacheNotRestoredReasonPictureInPicture BackForwardCacheNotRestoredReason = "PictureInPicture" + BackForwardCacheNotRestoredReasonPortal BackForwardCacheNotRestoredReason = "Portal" + BackForwardCacheNotRestoredReasonSpeechRecognizer BackForwardCacheNotRestoredReason = "SpeechRecognizer" + BackForwardCacheNotRestoredReasonIdleManager BackForwardCacheNotRestoredReason = "IdleManager" + BackForwardCacheNotRestoredReasonPaymentManager BackForwardCacheNotRestoredReason = "PaymentManager" + BackForwardCacheNotRestoredReasonSpeechSynthesis BackForwardCacheNotRestoredReason = "SpeechSynthesis" + BackForwardCacheNotRestoredReasonKeyboardLock BackForwardCacheNotRestoredReason = "KeyboardLock" + BackForwardCacheNotRestoredReasonWebOTPService BackForwardCacheNotRestoredReason = "WebOTPService" + BackForwardCacheNotRestoredReasonOutstandingNetworkRequestDirectSocket BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestDirectSocket" + BackForwardCacheNotRestoredReasonIsolatedWorldScript BackForwardCacheNotRestoredReason = "IsolatedWorldScript" + BackForwardCacheNotRestoredReasonInjectedStyleSheet BackForwardCacheNotRestoredReason = "InjectedStyleSheet" + BackForwardCacheNotRestoredReasonMediaSessionImplOnServiceCreated BackForwardCacheNotRestoredReason = "MediaSessionImplOnServiceCreated" + BackForwardCacheNotRestoredReasonUnknown BackForwardCacheNotRestoredReason = "Unknown" +) + +func (e BackForwardCacheNotRestoredReason) Valid() bool { + switch e { + case "NotMainFrame", "BackForwardCacheDisabled", "RelatedActiveContentsExist", "HTTPStatusNotOK", "SchemeNotHTTPOrHTTPS", "Loading", "WasGrantedMediaAccess", "DisableForRenderFrameHostCalled", "DomainNotAllowed", "HTTPMethodNotGET", "SubframeIsNavigating", "Timeout", "CacheLimit", "JavaScriptExecution", "RendererProcessKilled", "RendererProcessCrashed", "GrantedMediaStreamAccess", "SchedulerTrackedFeatureUsed", "ConflictingBrowsingInstance", "CacheFlushed", "ServiceWorkerVersionActivation", "SessionRestored", "ServiceWorkerPostMessage", "EnteredBackForwardCacheBeforeServiceWorkerHostAdded", "RenderFrameHostReused_SameSite", "RenderFrameHostReused_CrossSite", "ServiceWorkerClaim", "IgnoreEventAndEvict", "HaveInnerContents", "TimeoutPuttingInCache", "BackForwardCacheDisabledByLowMemory", "BackForwardCacheDisabledByCommandLine", "NetworkRequestDatapipeDrainedAsBytesConsumer", "NetworkRequestRedirected", "NetworkRequestTimeout", "NetworkExceedsBufferLimit", "NavigationCancelledWhileRestoring", "NotMostRecentNavigationEntry", "BackForwardCacheDisabledForPrerender", "UserAgentOverrideDiffers", "ForegroundCacheLimit", "BrowsingInstanceNotSwapped", "BackForwardCacheDisabledForDelegate", "OptInUnloadHeaderNotPresent", "UnloadHandlerExistsInSubFrame", "ServiceWorkerUnregistration", "CacheControlNoStore", "CacheControlNoStoreCookieModified", "CacheControlNoStoreHTTPOnlyCookieModified", "WebSocket", "WebRTC", "MainResourceHasCacheControlNoStore", "MainResourceHasCacheControlNoCache", "SubresourceHasCacheControlNoStore", "SubresourceHasCacheControlNoCache", "ContainsPlugins", "DocumentLoaded", "DedicatedWorkerOrWorklet", "OutstandingNetworkRequestOthers", "OutstandingIndexedDBTransaction", "RequestedNotificationsPermission", "RequestedMIDIPermission", "RequestedAudioCapturePermission", "RequestedVideoCapturePermission", "RequestedBackForwardCacheBlockedSensors", "RequestedBackgroundWorkPermission", "BroadcastChannel", "IndexedDBConnection", "WebXR", "SharedWorker", "WebLocks", "WebHID", "WebShare", "RequestedStorageAccessGrant", "WebNfc", "WebFileSystem", "OutstandingNetworkRequestFetch", "OutstandingNetworkRequestXHR", "AppBanner", "Printing", "WebDatabase", "PictureInPicture", "Portal", "SpeechRecognizer", "IdleManager", "PaymentManager", "SpeechSynthesis", "KeyboardLock", "WebOTPService", "OutstandingNetworkRequestDirectSocket", "IsolatedWorldScript", "InjectedStyleSheet", "MediaSessionImplOnServiceCreated", "Unknown": + return true + default: + return false + } +} + +func (e BackForwardCacheNotRestoredReason) String() string { + return string(e) +} + +// BackForwardCacheNotRestoredReasonType Types of not restored reasons for +// back-forward cache. +// +// Note: This type is experimental. +type BackForwardCacheNotRestoredReasonType string + +// BackForwardCacheNotRestoredReasonType as enums. +const ( + BackForwardCacheNotRestoredReasonTypeNotSet BackForwardCacheNotRestoredReasonType = "" + BackForwardCacheNotRestoredReasonTypeSupportPending BackForwardCacheNotRestoredReasonType = "SupportPending" + BackForwardCacheNotRestoredReasonTypePageSupportNeeded BackForwardCacheNotRestoredReasonType = "PageSupportNeeded" + BackForwardCacheNotRestoredReasonTypeCircumstantial BackForwardCacheNotRestoredReasonType = "Circumstantial" +) + +func (e BackForwardCacheNotRestoredReasonType) Valid() bool { + switch e { + case "SupportPending", "PageSupportNeeded", "Circumstantial": + return true + default: + return false + } +} + +func (e BackForwardCacheNotRestoredReasonType) String() string { + return string(e) +} + +// BackForwardCacheNotRestoredExplanation +// +// Note: This type is experimental. +type BackForwardCacheNotRestoredExplanation struct { + Type BackForwardCacheNotRestoredReasonType `json:"type"` // Type of the reason + Reason BackForwardCacheNotRestoredReason `json:"reason"` // Not restored reason +} diff --git a/protocol/webauthn/types.go b/protocol/webauthn/types.go index 2e07087..29739d5 100644 --- a/protocol/webauthn/types.go +++ b/protocol/webauthn/types.go @@ -85,6 +85,7 @@ type VirtualAuthenticatorOptions struct { HasResidentKey *bool `json:"hasResidentKey,omitempty"` // Defaults to false. HasUserVerification *bool `json:"hasUserVerification,omitempty"` // Defaults to false. HasLargeBlob *bool `json:"hasLargeBlob,omitempty"` // If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false. + HasCredBlob *bool `json:"hasCredBlob,omitempty"` // If set to true, the authenticator will support the credBlob extension. https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension Defaults to false. AutomaticPresenceSimulation *bool `json:"automaticPresenceSimulation,omitempty"` // If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true. IsUserVerified *bool `json:"isUserVerified,omitempty"` // Sets whether User Verification succeeds or fails for an authenticator. Defaults to false. }