diff --git a/cdp.go b/cdp.go index 20850da..4e1cc04 100644 --- a/cdp.go +++ b/cdp.go @@ -7,7 +7,6 @@ import ( "github.com/mafredri/cdp/protocol/accessibility" "github.com/mafredri/cdp/protocol/animation" - "github.com/mafredri/cdp/protocol/applicationcache" "github.com/mafredri/cdp/protocol/audits" "github.com/mafredri/cdp/protocol/backgroundservice" "github.com/mafredri/cdp/protocol/browser" @@ -23,6 +22,7 @@ import ( "github.com/mafredri/cdp/protocol/domsnapshot" "github.com/mafredri/cdp/protocol/domstorage" "github.com/mafredri/cdp/protocol/emulation" + "github.com/mafredri/cdp/protocol/eventbreakpoints" "github.com/mafredri/cdp/protocol/fetch" "github.com/mafredri/cdp/protocol/headlessexperimental" "github.com/mafredri/cdp/protocol/heapprofiler" @@ -84,6 +84,22 @@ type Accessibility interface { // Note: This command is experimental. GetFullAXTree(context.Context, *accessibility.GetFullAXTreeArgs) (*accessibility.GetFullAXTreeReply, error) + // Command GetRootAXNode + // + // Fetches the root node. Requires `enable()` to have been called + // previously. + // + // Note: This command is experimental. + GetRootAXNode(context.Context, *accessibility.GetRootAXNodeArgs) (*accessibility.GetRootAXNodeReply, error) + + // Command GetAXNodeAndAncestors + // + // Fetches a node and all ancestors up to and including the root. + // Requires `enable()` to have been called previously. + // + // Note: This command is experimental. + GetAXNodeAndAncestors(context.Context, *accessibility.GetAXNodeAndAncestorsArgs) (*accessibility.GetAXNodeAndAncestorsReply, error) + // Command GetChildAXNodes // // Fetches a particular accessibility node by AXNodeId. Requires @@ -104,6 +120,23 @@ type Accessibility interface { // // Note: This command is experimental. QueryAXTree(context.Context, *accessibility.QueryAXTreeArgs) (*accessibility.QueryAXTreeReply, error) + + // Event LoadComplete + // + // The loadComplete event mirrors the load complete event sent by the + // browser to assistive technology when the web page has finished + // loading. + // + // Note: This event is experimental. + LoadComplete(context.Context) (accessibility.LoadCompleteClient, error) + + // Event NodesUpdated + // + // The nodesUpdated event is sent every time a previously requested + // node has changed the in tree. + // + // Note: This event is experimental. + NodesUpdated(context.Context) (accessibility.NodesUpdatedClient, error) } // The Animation domain. @@ -177,39 +210,6 @@ type Animation interface { AnimationStarted(context.Context) (animation.StartedClient, error) } -// The ApplicationCache domain. -// -// Note: This domain is experimental. -type ApplicationCache interface { - // Command Enable - // - // Enables application cache domain notifications. - Enable(context.Context) error - - // Command GetApplicationCacheForFrame - // - // Returns relevant application cache data for the document in given - // frame. - GetApplicationCacheForFrame(context.Context, *applicationcache.GetApplicationCacheForFrameArgs) (*applicationcache.GetApplicationCacheForFrameReply, error) - - // Command GetFramesWithManifests - // - // Returns array of frame identifiers with manifest urls for each - // frame containing a document associated with some application cache. - GetFramesWithManifests(context.Context) (*applicationcache.GetFramesWithManifestsReply, error) - - // Command GetManifestForFrame - // - // Returns manifest URL for document in the given frame. - GetManifestForFrame(context.Context, *applicationcache.GetManifestForFrameArgs) (*applicationcache.GetManifestForFrameReply, error) - - // Event ApplicationCacheStatusUpdated - ApplicationCacheStatusUpdated(context.Context) (applicationcache.StatusUpdatedClient, error) - - // Event NetworkStateUpdated - NetworkStateUpdated(context.Context) (applicationcache.NetworkStateUpdatedClient, error) -} - // The Audits domain. Audits domain allows investigation of page violations // and possible improvements. // @@ -497,6 +497,17 @@ type CSS interface { // Returns the current textual content for a stylesheet. GetStyleSheetText(context.Context, *css.GetStyleSheetTextArgs) (*css.GetStyleSheetTextReply, error) + // Command GetLayersForNode + // + // Returns all layers parsed by the rendering engine for the tree + // scope of a node. Given a DOM element identified by nodeId, + // getLayersForNode returns the root layer for the nearest ancestor + // document or shadow root. The layer root contains the full layer tree + // for the tree scope and their ordering. + // + // Note: This command is experimental. + GetLayersForNode(context.Context, *css.GetLayersForNodeArgs) (*css.GetLayersForNodeReply, error) + // Command TrackComputedStyleUpdates // // Starts tracking the given computed styles for updates. The @@ -541,6 +552,13 @@ type CSS interface { // Note: This command is experimental. SetContainerQueryText(context.Context, *css.SetContainerQueryTextArgs) (*css.SetContainerQueryTextReply, error) + // Command SetSupportsText + // + // Modifies the expression of a supports at-rule. + // + // Note: This command is experimental. + SetSupportsText(context.Context, *css.SetSupportsTextArgs) (*css.SetSupportsTextReply, error) + // Command SetRuleSelector // // Modifies the rule selector. @@ -667,6 +685,11 @@ type Cast interface { // SDK. SetSinkToUse(context.Context, *cast.SetSinkToUseArgs) error + // Command StartDesktopMirroring + // + // Starts mirroring the desktop to the sink. + StartDesktopMirroring(context.Context, *cast.StartDesktopMirroringArgs) error + // Command StartTabMirroring // // Starts mirroring the tab to the sink. @@ -776,7 +799,7 @@ type DOM interface { // Command Enable // // Enables DOM agent for the given page. - Enable(context.Context) error + Enable(context.Context, *dom.EnableArgs) error // Command Focus // @@ -1021,6 +1044,14 @@ type DOM interface { // Note: This command is experimental. GetContainerForNode(context.Context, *dom.GetContainerForNodeArgs) (*dom.GetContainerForNodeReply, error) + // Command GetQueryingDescendantsForContainer + // + // Returns the descendants of a container query container that have + // container queries against this container. + // + // Note: This command is experimental. + GetQueryingDescendantsForContainer(context.Context, *dom.GetQueryingDescendantsForContainerArgs) (*dom.GetQueryingDescendantsForContainerReply, error) + // Event AttributeModified // // Fired when `Element`'s attribute is modified. @@ -1230,6 +1261,9 @@ type DOMStorage interface { // Command SetDOMStorageItem SetDOMStorageItem(context.Context, *domstorage.SetDOMStorageItemArgs) error + // Command GetStorageKeyForFrame + GetStorageKeyForFrame(context.Context, *domstorage.GetStorageKeyForFrameArgs) (*domstorage.GetStorageKeyForFrameReply, error) + // Event DOMStorageItemAdded DOMStorageItemAdded(context.Context) (domstorage.ItemAddedClient, error) @@ -1338,7 +1372,7 @@ type Debugger interface { // Command RestartFrame // - // Restarts particular call frame from the beginning. + // Deprecated: Restarts particular call frame from the beginning. RestartFrame(context.Context, *debugger.RestartFrameArgs) (*debugger.RestartFrameReply, error) // Command Resume @@ -1533,6 +1567,13 @@ type Emulation interface { // Note: This command is experimental. SetFocusEmulationEnabled(context.Context, *emulation.SetFocusEmulationEnabledArgs) error + // Command SetAutoDarkModeOverride + // + // Automatically render all web contents using a dark theme. + // + // Note: This command is experimental. + SetAutoDarkModeOverride(context.Context, *emulation.SetAutoDarkModeOverrideArgs) error + // Command SetCPUThrottlingRate // // Enables CPU throttling to emulate slow CPUs. @@ -1670,6 +1711,13 @@ type Emulation interface { // Allows overriding user agent with the given string. SetUserAgentOverride(context.Context, *emulation.SetUserAgentOverrideArgs) error + // Command SetAutomationOverride + // + // Allows overriding the automation flag. + // + // Note: This command is experimental. + SetAutomationOverride(context.Context, *emulation.SetAutomationOverrideArgs) error + // Event VirtualTimeBudgetExpired // // Notification sent after the virtual time budget for the current @@ -1679,6 +1727,24 @@ type Emulation interface { VirtualTimeBudgetExpired(context.Context) (emulation.VirtualTimeBudgetExpiredClient, error) } +// The EventBreakpoints domain. EventBreakpoints permits setting breakpoints +// on particular operations and events in targets that run JavaScript but do +// not have a DOM. JavaScript execution will stop on these operations as if +// there was a regular breakpoint set. +// +// Note: This domain is experimental. +type EventBreakpoints interface { + // Command SetInstrumentationBreakpoint + // + // Sets breakpoint on particular native event. + SetInstrumentationBreakpoint(context.Context, *eventbreakpoints.SetInstrumentationBreakpointArgs) error + + // Command RemoveInstrumentationBreakpoint + // + // Removes breakpoint on particular native event. + RemoveInstrumentationBreakpoint(context.Context, *eventbreakpoints.RemoveInstrumentationBreakpointArgs) error +} + // The Fetch domain. A domain for letting clients substitute browser's network // layer with client code. type Fetch interface { @@ -1715,6 +1781,15 @@ type Fetch interface { // authRequired event. ContinueWithAuth(context.Context, *fetch.ContinueWithAuthArgs) error + // Command ContinueResponse + // + // Continues loading of the paused response, optionally modifying the + // response headers. If either responseCode or headers are modified, + // all of them must be present. + // + // Note: This command is experimental. + ContinueResponse(context.Context, *fetch.ContinueResponseArgs) error + // Command GetResponseBody // // Causes the body of the response to be received from the server and @@ -1768,7 +1843,7 @@ type HeadlessExperimental interface { // frame. Requires that the target was created with enabled // BeginFrameControl. Designed for use with // --run-all-compositor-stages-before-draw, see also - // https://goo.gl/3zHXhB for more background. + // https://goo.gle/chrome-headless-rendering for more background. BeginFrame(context.Context, *headlessexperimental.BeginFrameArgs) (*headlessexperimental.BeginFrameReply, error) // Command Disable @@ -1948,6 +2023,15 @@ type Input interface { // Note: This command is experimental. InsertText(context.Context, *input.InsertTextArgs) error + // Command IMESetComposition + // + // This method sets the current candidate text for ime. Use + // imeCommitComposition to commit the final text. Use imeSetComposition + // with empty string as text to cancel composition. + // + // Note: This command is experimental. + IMESetComposition(context.Context, *input.IMESetCompositionArgs) error + // Command DispatchMouseEvent // // Dispatches a mouse event to the page. @@ -2441,6 +2525,15 @@ type Network interface { // Note: This command is experimental. GetSecurityIsolationStatus(context.Context, *network.GetSecurityIsolationStatusArgs) (*network.GetSecurityIsolationStatusReply, error) + // Command EnableReportingAPI + // + // Enables tracking for the Reporting API, events generated by the + // Reporting API will now be delivered to the client. Enabling triggers + // 'reportingApiReportAdded' for all existing reports. + // + // Note: This command is experimental. + EnableReportingAPI(context.Context, *network.EnableReportingAPIArgs) error + // Command LoadNetworkResource // // Fetches the resource and returns the content. @@ -2618,6 +2711,24 @@ type Network interface { // // Note: This event is experimental. SubresourceWebBundleInnerResponseError(context.Context) (network.SubresourceWebBundleInnerResponseErrorClient, error) + + // Event ReportingAPIReportAdded + // + // Is sent whenever a new report is added. And after + // 'enableReportingApi' for all existing reports. + // + // Note: This event is experimental. + ReportingAPIReportAdded(context.Context) (network.ReportingAPIReportAddedClient, error) + + // Event ReportingAPIReportUpdated + // + // Note: This event is experimental. + ReportingAPIReportUpdated(context.Context) (network.ReportingAPIReportUpdatedClient, error) + + // Event ReportingAPIEndpointsChangedForOrigin + // + // Note: This event is experimental. + ReportingAPIEndpointsChangedForOrigin(context.Context) (network.ReportingAPIEndpointsChangedForOriginClient, error) } // The Overlay domain. This domain provides various functionality related to @@ -2745,7 +2856,7 @@ type Overlay interface { // Command SetShowHitTestBorders // - // Requests that backend shows hit-test borders on layers + // Deprecated: No longer has any effect. SetShowHitTestBorders(context.Context, *overlay.SetShowHitTestBordersArgs) error // Command SetShowWebVitals @@ -2763,6 +2874,11 @@ type Overlay interface { // Add a dual screen device hinge SetShowHinge(context.Context, *overlay.SetShowHingeArgs) error + // Command SetShowIsolatedElements + // + // Show elements in isolation mode with overlays. + SetShowIsolatedElements(context.Context, *overlay.SetShowIsolatedElementsArgs) error + // Event InspectNodeRequested // // Fired when the node should be inspected. This happens after call to @@ -2851,6 +2967,14 @@ type Page interface { // Note: This command is experimental. GetManifestIcons(context.Context) (*page.GetManifestIconsReply, error) + // Command GetAppID + // + // Returns the unique (PWA) app id. Only returns values if the feature + // flag 'WebAppEnableManifestId' is enabled + // + // Note: This command is experimental. + GetAppID(context.Context) (*page.GetAppIDReply, error) + // Command GetFrameTree // // Returns present frame tree structure. @@ -2961,6 +3085,13 @@ type Page interface { // Note: This command is experimental. GetPermissionsPolicyState(context.Context, *page.GetPermissionsPolicyStateArgs) (*page.GetPermissionsPolicyStateReply, error) + // Command GetOriginTrials + // + // Get Origin Trials on given frame. + // + // Note: This command is experimental. + GetOriginTrials(context.Context, *page.GetOriginTrialsArgs) (*page.GetOriginTrialsReply, error) + // Command SetFontFamilies // // Set generic font families. @@ -3036,23 +3167,12 @@ type Page interface { // Note: This command is experimental. StopScreencast(context.Context) error - // Command SetProduceCompilationCache - // - // Forces compilation cache to be generated for every subresource - // script. See also: `Page.produceCompilationCache`. - // - // Note: This command is experimental. - SetProduceCompilationCache(context.Context, *page.SetProduceCompilationCacheArgs) error - // Command ProduceCompilationCache // // Requests backend to produce compilation cache for the specified - // scripts. Unlike setProduceCompilationCache, this allows client to - // only produce cache for specific scripts. `scripts` are appeneded to - // the list of scripts for which the cache for would produced. - // Disabling compilation cache with `setProduceCompilationCache` would - // reset all pending cache requests. The list may also be reset during - // page navigation. When script with a matching URL is encountered, the + // scripts. `scripts` are appeneded to the list of scripts for which + // the cache would be produced. The list may be reset during page + // navigation. When script with a matching URL is encountered, the // cache is optionally produced upon backend discretion, based on // internal heuristics. See also: `Page.compilationCacheProduced`. // @@ -3074,6 +3194,14 @@ type Page interface { // Note: This command is experimental. ClearCompilationCache(context.Context) error + // Command SetSPCTransactionMode + // + // Sets the Secure Payment Confirmation transaction mode. + // https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode + // + // Note: This command is experimental. + SetSPCTransactionMode(context.Context, *page.SetSPCTransactionModeArgs) error + // Command GenerateTestReport // // Generates a report for testing. @@ -3222,6 +3350,11 @@ type Page interface { // Note: This event is experimental. BackForwardCacheNotUsed(context.Context) (page.BackForwardCacheNotUsedClient, error) + // Event PrerenderAttemptCompleted + // + // Fired when a prerender attempt is completed. + PrerenderAttemptCompleted(context.Context) (page.PrerenderAttemptCompletedClient, error) + // Event LoadEventFired LoadEventFired(context.Context) (page.LoadEventFiredClient, error) @@ -3382,48 +3515,6 @@ type Profiler interface { // Note: This command is experimental. TakeTypeProfile(context.Context) (*profiler.TakeTypeProfileReply, error) - // Command EnableCounters - // - // Enable counters collection. - // - // Note: This command is experimental. - EnableCounters(context.Context) error - - // Command DisableCounters - // - // Disable counters collection. - // - // Note: This command is experimental. - DisableCounters(context.Context) error - - // Command GetCounters - // - // Retrieve counters. - // - // Note: This command is experimental. - GetCounters(context.Context) (*profiler.GetCountersReply, error) - - // Command EnableRuntimeCallStats - // - // Enable run time call stats collection. - // - // Note: This command is experimental. - EnableRuntimeCallStats(context.Context) error - - // Command DisableRuntimeCallStats - // - // Disable run time call stats collection. - // - // Note: This command is experimental. - DisableRuntimeCallStats(context.Context) error - - // Command GetRuntimeCallStats - // - // Retrieve run time call stats. - // - // Note: This command is experimental. - GetRuntimeCallStats(context.Context) (*profiler.GetRuntimeCallStatsReply, error) - // Event ConsoleProfileFinished ConsoleProfileFinished(context.Context) (profiler.ConsoleProfileFinishedClient, error) @@ -3579,6 +3670,16 @@ type Runtime interface { // Note: This command is experimental. RemoveBinding(context.Context, *runtime.RemoveBindingArgs) error + // Command GetExceptionDetails + // + // This method tries to lookup and populate exception details for a + // JavaScript Error object. Note that the stackTrace portion of the + // resulting exceptionDetails will only be populated if the Runtime + // domain was enabled at the time when the Error was thrown. + // + // Note: This command is experimental. + GetExceptionDetails(context.Context, *runtime.GetExceptionDetailsArgs) (*runtime.GetExceptionDetailsReply, error) + // Event BindingCalled // // Notification is issued every time when binding is called. @@ -3684,7 +3785,8 @@ type Security interface { // Event SecurityStateChanged // - // The security state of the page changed. + // Deprecated: The security state of the page changed. No longer being + // sent. SecurityStateChanged(context.Context) (security.StateChangedClient, error) } @@ -3816,6 +3918,20 @@ type Storage interface { // Note: This command is experimental. ClearTrustTokens(context.Context, *storage.ClearTrustTokensArgs) (*storage.ClearTrustTokensReply, error) + // Command GetInterestGroupDetails + // + // Gets details for a named interest group. + // + // Note: This command is experimental. + GetInterestGroupDetails(context.Context, *storage.GetInterestGroupDetailsArgs) (*storage.GetInterestGroupDetailsReply, error) + + // Command SetInterestGroupTracking + // + // Enables/Disables issuing of interestGroupAccessed events. + // + // Note: This command is experimental. + SetInterestGroupTracking(context.Context, *storage.SetInterestGroupTrackingArgs) error + // Event CacheStorageContentUpdated // // A cache's contents have been modified. @@ -3835,6 +3951,11 @@ type Storage interface { // // The origin's IndexedDB database list has been modified. IndexedDBListUpdated(context.Context) (storage.IndexedDBListUpdatedClient, error) + + // Event InterestGroupAccessed + // + // One of the interest groups was accessed by the associated page. + InterestGroupAccessed(context.Context) (storage.InterestGroupAccessedClient, error) } // The SystemInfo domain. The SystemInfo domain defines methods and events for @@ -3951,11 +4072,26 @@ type Target interface { // Controls whether to automatically attach to new targets which are // considered to be related to this one. When turned on, attaches to // all existing related targets as well. When turned off, automatically - // detaches from all currently attached targets. + // detaches from all currently attached targets. This also clears all + // targets added by `autoAttachRelated` from the list of targets to + // watch for creation of related targets. // // Note: This command is experimental. SetAutoAttach(context.Context, *target.SetAutoAttachArgs) error + // Command AutoAttachRelated + // + // Adds the specified target to the list of targets that will be + // monitored for any related target creation (such as child frames, + // child workers and new versions of service worker) and reported + // through `attachedToTarget`. The specified target is also + // auto-attached. This cancels the effect of any previous + // `setAutoAttach` and is also canceled by subsequent `setAutoAttach`. + // Only available at the Browser target. + // + // Note: This command is experimental. + AutoAttachRelated(context.Context, *target.AutoAttachRelatedArgs) error + // Command SetDiscoverTargets // // Controls whether to discover available targets and notify via diff --git a/cdp_client.go b/cdp_client.go index 44f4cc6..ddc9f40 100644 --- a/cdp_client.go +++ b/cdp_client.go @@ -5,7 +5,6 @@ package cdp import ( "github.com/mafredri/cdp/protocol/accessibility" "github.com/mafredri/cdp/protocol/animation" - "github.com/mafredri/cdp/protocol/applicationcache" "github.com/mafredri/cdp/protocol/audits" "github.com/mafredri/cdp/protocol/backgroundservice" "github.com/mafredri/cdp/protocol/browser" @@ -21,6 +20,7 @@ import ( "github.com/mafredri/cdp/protocol/domsnapshot" "github.com/mafredri/cdp/protocol/domstorage" "github.com/mafredri/cdp/protocol/emulation" + "github.com/mafredri/cdp/protocol/eventbreakpoints" "github.com/mafredri/cdp/protocol/fetch" "github.com/mafredri/cdp/protocol/headlessexperimental" "github.com/mafredri/cdp/protocol/heapprofiler" @@ -58,7 +58,6 @@ import ( type Client struct { Accessibility Accessibility Animation Animation - ApplicationCache ApplicationCache Audits Audits BackgroundService BackgroundService Browser Browser @@ -74,6 +73,7 @@ type Client struct { Debugger Debugger DeviceOrientation DeviceOrientation Emulation Emulation + EventBreakpoints EventBreakpoints Fetch Fetch HeadlessExperimental HeadlessExperimental HeapProfiler HeapProfiler @@ -110,7 +110,6 @@ func NewClient(conn *rpcc.Conn) *Client { return &Client{ Accessibility: accessibility.NewClient(conn), Animation: animation.NewClient(conn), - ApplicationCache: applicationcache.NewClient(conn), Audits: audits.NewClient(conn), BackgroundService: backgroundservice.NewClient(conn), Browser: browser.NewClient(conn), @@ -126,6 +125,7 @@ func NewClient(conn *rpcc.Conn) *Client { Debugger: debugger.NewClient(conn), DeviceOrientation: deviceorientation.NewClient(conn), Emulation: emulation.NewClient(conn), + EventBreakpoints: eventbreakpoints.NewClient(conn), Fetch: fetch.NewClient(conn), HeadlessExperimental: headlessexperimental.NewClient(conn), HeapProfiler: heapprofiler.NewClient(conn), diff --git a/cmd/cdpgen/lint/name.go b/cmd/cdpgen/lint/name.go index 63f0701..e1e63b5 100644 --- a/cmd/cdpgen/lint/name.go +++ b/cmd/cdpgen/lint/name.go @@ -32,7 +32,9 @@ func init() { lint.SetInitialism("CORS", true) lint.SetInitialism("WASM", true) lint.SetInitialism("JXL", true) - lint.SetInitialism("BR", true) // Brotli compression. + lint.SetInitialism("BR", true) // Brotli compression. + lint.SetInitialism("HWB", true) // Color format. + lint.SetInitialism("IME", true) } // Name returns a different name if it should be different. diff --git a/cmd/cdpgen/protodef/browser_protocol.json b/cmd/cdpgen/protodef/browser_protocol.json index 84a21e6..5767051 100644 --- a/cmd/cdpgen/protodef/browser_protocol.json +++ b/cmd/cdpgen/protodef/browser_protocol.json @@ -205,7 +205,8 @@ }, { "name": "url", - "description": "JavaScript script name or url.", + "description": "JavaScript script name or url.\nDeprecated in favor of using the `location.scriptId` to resolve the URL via a previously\nsent `Debugger.scriptParsed` event.", + "deprecated": true, "type": "string" }, { @@ -226,6 +227,13 @@ "description": "The value being returned, if the function is at return point.", "optional": true, "$ref": "Runtime.RemoteObject" + }, + { + "name": "canBeRestarted", + "description": "Valid only while the VM is paused and indicates whether this frame\ncan be restarted or not. Note that a `true` value here does not\nguarantee that Debugger#restartFrame with this CallFrameId will be\nsuccessful, but it is very likely.", + "experimental": true, + "optional": true, + "type": "boolean" } ] }, @@ -389,7 +397,7 @@ "parameters": [ { "name": "maxScriptsCacheSize", - "description": "The maximum size in bytes of collected scripts (not referenced by other heap objects)\nthe debugger can hold. Puts no limit if paramter is omitted.", + "description": "The maximum size in bytes of collected scripts (not referenced by other heap objects)\nthe debugger can hold. Puts no limit if parameter is omitted.", "experimental": true, "optional": true, "type": "number" @@ -599,6 +607,7 @@ { "name": "restartFrame", "description": "Restarts particular call frame from the beginning.", + "deprecated": true, "parameters": [ { "name": "callFrameId", @@ -1166,7 +1175,7 @@ }, { "name": "hash", - "description": "Content hash of the script.", + "description": "Content hash of the script, SHA-256.", "type": "string" }, { @@ -1270,7 +1279,7 @@ }, { "name": "hash", - "description": "Content hash of the script.", + "description": "Content hash of the script, SHA-256.", "type": "string" }, { @@ -1546,6 +1555,12 @@ "name": "treatGlobalObjectsAsRoots", "optional": true, "type": "boolean" + }, + { + "name": "captureNumericValue", + "description": "If true, numerical values are included in the snapshot", + "optional": true, + "type": "boolean" } ] }, @@ -1560,7 +1575,13 @@ }, { "name": "treatGlobalObjectsAsRoots", - "description": "If true, a raw snapshot without artifical roots will be generated", + "description": "If true, a raw snapshot without artificial roots will be generated", + "optional": true, + "type": "boolean" + }, + { + "name": "captureNumericValue", + "description": "If true, numerical values are included in the snapshot", "optional": true, "type": "boolean" } @@ -1873,47 +1894,6 @@ } } ] - }, - { - "id": "CounterInfo", - "description": "Collected counter information.", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "name", - "description": "Counter name.", - "type": "string" - }, - { - "name": "value", - "description": "Counter value.", - "type": "integer" - } - ] - }, - { - "id": "RuntimeCallCounterInfo", - "description": "Runtime call counter information.", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "name", - "description": "Counter name.", - "type": "string" - }, - { - "name": "value", - "description": "Counter value.", - "type": "number" - }, - { - "name": "time", - "description": "Counter time in seconds.", - "type": "number" - } - ] } ], "commands": [ @@ -2039,56 +2019,6 @@ } } ] - }, - { - "name": "enableCounters", - "description": "Enable counters collection.", - "experimental": true - }, - { - "name": "disableCounters", - "description": "Disable counters collection.", - "experimental": true - }, - { - "name": "getCounters", - "description": "Retrieve counters.", - "experimental": true, - "returns": [ - { - "name": "result", - "description": "Collected counters information.", - "type": "array", - "items": { - "$ref": "CounterInfo" - } - } - ] - }, - { - "name": "enableRuntimeCallStats", - "description": "Enable run time call stats collection.", - "experimental": true - }, - { - "name": "disableRuntimeCallStats", - "description": "Disable run time call stats collection.", - "experimental": true - }, - { - "name": "getRuntimeCallStats", - "description": "Retrieve run time call stats.", - "experimental": true, - "returns": [ - { - "name": "result", - "description": "Collected runtime call counter information.", - "type": "array", - "items": { - "$ref": "RuntimeCallCounterInfo" - } - } - ] } ], "events": [ @@ -2139,7 +2069,7 @@ }, { "name": "preciseCoverageDeltaUpdate", - "description": "Reports coverage delta since the last poll (either from an event like this, or from\n`takePreciseCoverage` for the current isolate. May only be sent if precise code\ncoverage has been started. This event can be trigged by the embedder to, for example,\ntrigger collection of coverage data immediatelly at a certain point in time.", + "description": "Reports coverage delta since the last poll (either from an event like this, or from\n`takePreciseCoverage` for the current isolate. May only be sent if precise code\ncoverage has been started. This event can be trigged by the embedder to, for example,\ntrigger collection of coverage data immediately at a certain point in time.", "experimental": true, "parameters": [ { @@ -2148,7 +2078,7 @@ "type": "number" }, { - "name": "occassion", + "name": "occasion", "description": "Identifier for distinguishing coverage events.", "type": "string" }, @@ -2173,6 +2103,52 @@ "description": "Unique script identifier.", "type": "string" }, + { + "id": "WebDriverValue", + "description": "Represents the value serialiazed by the WebDriver BiDi specification\nhttps://w3c.github.io/webdriver-bidi.", + "type": "object", + "properties": [ + { + "name": "type", + "type": "string", + "enum": [ + "undefined", + "null", + "string", + "number", + "boolean", + "bigint", + "regexp", + "date", + "symbol", + "array", + "object", + "function", + "map", + "set", + "weakmap", + "weakset", + "error", + "proxy", + "promise", + "typedarray", + "arraybuffer", + "node", + "window" + ] + }, + { + "name": "value", + "optional": true, + "type": "any" + }, + { + "name": "objectId", + "optional": true, + "type": "string" + } + ] + }, { "id": "RemoteObjectId", "description": "Unique object identifier.", @@ -2254,6 +2230,13 @@ "optional": true, "type": "string" }, + { + "name": "webDriverValue", + "description": "WebDriver BiDi representation of the value.", + "experimental": true, + "optional": true, + "$ref": "WebDriverValue" + }, { "name": "objectId", "description": "Unique object identifier (for non-primitive values).", @@ -2621,7 +2604,7 @@ }, { "name": "uniqueId", - "description": "A system-unique execution context identifier. Unlike the id, this is unique accross\nmultiple processes, so can be reliably used to identify specific context while backend\nperforms a cross-process navigation.", + "description": "A system-unique execution context identifier. Unlike the id, this is unique across\nmultiple processes, so can be reliably used to identify specific context while backend\nperforms a cross-process navigation.", "experimental": true, "type": "string" }, @@ -2687,6 +2670,13 @@ "description": "Identifier of the context where exception happened.", "optional": true, "$ref": "ExecutionContextId" + }, + { + "name": "exceptionMetaData", + "description": "Dictionary with entries of meta data that the client associated\nwith this exception, such as information about associated network\nrequests, etc.", + "experimental": true, + "optional": true, + "type": "object" } ] }, @@ -2893,6 +2883,20 @@ "description": "Symbolic group name that can be used to release multiple objects. If objectGroup is not\nspecified and objectId is, objectGroup will be inherited from object.", "optional": true, "type": "string" + }, + { + "name": "throwOnSideEffect", + "description": "Whether to throw an exception if side effect cannot be ruled out during evaluation.", + "experimental": true, + "optional": true, + "type": "boolean" + }, + { + "name": "generateWebDriverValue", + "description": "Whether the result should contain `webDriverValue`, serialized according to\nhttps://w3c.github.io/webdriver-bidi. This is mutually exclusive with `returnByValue`, but\nresulting `objectId` is still provided.", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ @@ -3057,10 +3061,17 @@ }, { "name": "uniqueContextId", - "description": "An alternative way to specify the execution context to evaluate in.\nCompared to contextId that may be reused accross processes, this is guaranteed to be\nsystem-unique, so it can be used to prevent accidental evaluation of the expression\nin context different than intended (e.g. as a result of navigation accross process\nboundaries).\nThis is mutually exclusive with `contextId`.", + "description": "An alternative way to specify the execution context to evaluate in.\nCompared to contextId that may be reused across processes, this is guaranteed to be\nsystem-unique, so it can be used to prevent accidental evaluation of the expression\nin context different than intended (e.g. as a result of navigation across process\nboundaries).\nThis is mutually exclusive with `contextId`.", "experimental": true, "optional": true, "type": "string" + }, + { + "name": "generateWebDriverValue", + "description": "Whether the result should be serialized according to https://w3c.github.io/webdriver-bidi.", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ @@ -3134,6 +3145,13 @@ "experimental": true, "optional": true, "type": "boolean" + }, + { + "name": "nonIndexedPropertiesOnly", + "description": "If true, returns non-indexed properties only.", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ @@ -3356,7 +3374,8 @@ }, { "name": "executionContextId", - "description": "If specified, the binding would only be exposed to the specified\nexecution context. If omitted and `executionContextName` is not set,\nthe binding is exposed to all execution contexts of the target.\nThis parameter is mutually exclusive with `executionContextName`.", + "description": "If specified, the binding would only be exposed to the specified\nexecution context. If omitted and `executionContextName` is not set,\nthe binding is exposed to all execution contexts of the target.\nThis parameter is mutually exclusive with `executionContextName`.\nDeprecated in favor of `executionContextName` due to an unclear use case\nand bugs in implementation (crbug.com/1169639). `executionContextId` will be\nremoved in the future.", + "deprecated": true, "optional": true, "$ref": "ExecutionContextId" }, @@ -3379,6 +3398,25 @@ "type": "string" } ] + }, + { + "name": "getExceptionDetails", + "description": "This method tries to lookup and populate exception details for a\nJavaScript Error object.\nNote that the stackTrace portion of the resulting exceptionDetails will\nonly be populated if the Runtime domain was enabled at the time when the\nError was thrown.", + "experimental": true, + "parameters": [ + { + "name": "errorObjectId", + "description": "The error object for which to resolve the exception details.", + "$ref": "RemoteObjectId" + } + ], + "returns": [ + { + "name": "exceptionDetails", + "optional": true, + "$ref": "ExceptionDetails" + } + ] } ], "events": [ @@ -3532,6 +3570,13 @@ { "name": "hints", "type": "object" + }, + { + "name": "executionContextId", + "description": "Identifier of the context where the call was made.", + "experimental": true, + "optional": true, + "$ref": "ExecutionContextId" } ] } diff --git a/cmd/cdpgen/protodef/js_protocol.json b/cmd/cdpgen/protodef/js_protocol.json index a2a9592..615b28a 100644 --- a/cmd/cdpgen/protodef/js_protocol.json +++ b/cmd/cdpgen/protodef/js_protocol.json @@ -58,6 +58,7 @@ "description": "Enum of possible native property sources (as a subtype of a particular AXValueSourceType).", "type": "string", "enum": [ + "description", "figcaption", "label", "labelfor", @@ -307,6 +308,12 @@ "$ref": "AXProperty" } }, + { + "name": "parentId", + "description": "ID for this node's parent.", + "optional": true, + "$ref": "AXNodeId" + }, { "name": "childIds", "description": "IDs for each of this node's child nodes.", @@ -321,6 +328,12 @@ "description": "The backend ID for the associated DOM node, if any.", "optional": true, "$ref": "DOM.BackendNodeId" + }, + { + "name": "frameId", + "description": "The frame ID for the frame associated with this nodes document.", + "optional": true, + "$ref": "Page.FrameId" } ] } @@ -381,10 +394,69 @@ "experimental": true, "parameters": [ { - "name": "max_depth", + "name": "depth", "description": "The maximum depth at which descendants of the root node should be retrieved.\nIf omitted, the full tree is returned.", "optional": true, "type": "integer" + }, + { + "name": "frameId", + "description": "The frame for whose document the AX tree should be retrieved.\nIf omited, the root frame is used.", + "optional": true, + "$ref": "Page.FrameId" + } + ], + "returns": [ + { + "name": "nodes", + "type": "array", + "items": { + "$ref": "AXNode" + } + } + ] + }, + { + "name": "getRootAXNode", + "description": "Fetches the root node.\nRequires `enable()` to have been called previously.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "The frame in whose document the node resides.\nIf omitted, the root frame is used.", + "optional": true, + "$ref": "Page.FrameId" + } + ], + "returns": [ + { + "name": "node", + "$ref": "AXNode" + } + ] + }, + { + "name": "getAXNodeAndAncestors", + "description": "Fetches a node and all ancestors up to and including the root.\nRequires `enable()` to have been called previously.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "Identifier of the node to get.", + "optional": true, + "$ref": "DOM.NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node to get.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "objectId", + "description": "JavaScript object id of the node wrapper to get.", + "optional": true, + "$ref": "Runtime.RemoteObjectId" } ], "returns": [ @@ -405,6 +477,12 @@ { "name": "id", "$ref": "AXNodeId" + }, + { + "name": "frameId", + "description": "The frame in whose document the node resides.\nIf omitted, the root frame is used.", + "optional": true, + "$ref": "Page.FrameId" } ], "returns": [ @@ -464,6 +542,35 @@ } ] } + ], + "events": [ + { + "name": "loadComplete", + "description": "The loadComplete event mirrors the load complete event sent by the browser to assistive\ntechnology when the web page has finished loading.", + "experimental": true, + "parameters": [ + { + "name": "root", + "description": "New document root node.", + "$ref": "AXNode" + } + ] + }, + { + "name": "nodesUpdated", + "description": "The nodesUpdated event is sent every time a previously requested node has changed the in tree.", + "experimental": true, + "parameters": [ + { + "name": "nodes", + "description": "Updated node data.", + "type": "array", + "items": { + "$ref": "AXNode" + } + } + ] + } ] }, { @@ -813,181 +920,6 @@ } ] }, - { - "domain": "ApplicationCache", - "experimental": true, - "dependencies": [ - "Page" - ], - "types": [ - { - "id": "ApplicationCacheResource", - "description": "Detailed application cache resource information.", - "type": "object", - "properties": [ - { - "name": "url", - "description": "Resource url.", - "type": "string" - }, - { - "name": "size", - "description": "Resource size.", - "type": "integer" - }, - { - "name": "type", - "description": "Resource type.", - "type": "string" - } - ] - }, - { - "id": "ApplicationCache", - "description": "Detailed application cache information.", - "type": "object", - "properties": [ - { - "name": "manifestURL", - "description": "Manifest URL.", - "type": "string" - }, - { - "name": "size", - "description": "Application cache size.", - "type": "number" - }, - { - "name": "creationTime", - "description": "Application cache creation time.", - "type": "number" - }, - { - "name": "updateTime", - "description": "Application cache update time.", - "type": "number" - }, - { - "name": "resources", - "description": "Application cache resources.", - "type": "array", - "items": { - "$ref": "ApplicationCacheResource" - } - } - ] - }, - { - "id": "FrameWithManifest", - "description": "Frame identifier - manifest URL pair.", - "type": "object", - "properties": [ - { - "name": "frameId", - "description": "Frame identifier.", - "$ref": "Page.FrameId" - }, - { - "name": "manifestURL", - "description": "Manifest URL.", - "type": "string" - }, - { - "name": "status", - "description": "Application cache status.", - "type": "integer" - } - ] - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables application cache domain notifications." - }, - { - "name": "getApplicationCacheForFrame", - "description": "Returns relevant application cache data for the document in given frame.", - "parameters": [ - { - "name": "frameId", - "description": "Identifier of the frame containing document whose application cache is retrieved.", - "$ref": "Page.FrameId" - } - ], - "returns": [ - { - "name": "applicationCache", - "description": "Relevant application cache data for the document in given frame.", - "$ref": "ApplicationCache" - } - ] - }, - { - "name": "getFramesWithManifests", - "description": "Returns array of frame identifiers with manifest urls for each frame containing a document\nassociated with some application cache.", - "returns": [ - { - "name": "frameIds", - "description": "Array of frame identifiers with manifest urls for each frame containing a document\nassociated with some application cache.", - "type": "array", - "items": { - "$ref": "FrameWithManifest" - } - } - ] - }, - { - "name": "getManifestForFrame", - "description": "Returns manifest URL for document in the given frame.", - "parameters": [ - { - "name": "frameId", - "description": "Identifier of the frame containing document whose manifest is retrieved.", - "$ref": "Page.FrameId" - } - ], - "returns": [ - { - "name": "manifestURL", - "description": "Manifest URL for document in the given frame.", - "type": "string" - } - ] - } - ], - "events": [ - { - "name": "applicationCacheStatusUpdated", - "parameters": [ - { - "name": "frameId", - "description": "Identifier of the frame containing document whose application cache updated status.", - "$ref": "Page.FrameId" - }, - { - "name": "manifestURL", - "description": "Manifest URL.", - "type": "string" - }, - { - "name": "status", - "description": "Updated application cache status.", - "type": "integer" - } - ] - }, - { - "name": "networkStateUpdated", - "parameters": [ - { - "name": "isNowOnline", - "type": "boolean" - } - ] - } - ] - }, { "domain": "Audits", "description": "Audits domain allows investigation of page violations and possible improvements.", @@ -1045,18 +977,19 @@ ] }, { - "id": "SameSiteCookieExclusionReason", + "id": "CookieExclusionReason", "type": "string", "enum": [ "ExcludeSameSiteUnspecifiedTreatedAsLax", "ExcludeSameSiteNoneInsecure", "ExcludeSameSiteLax", "ExcludeSameSiteStrict", - "ExcludeInvalidSameParty" + "ExcludeInvalidSameParty", + "ExcludeSamePartyCrossPartyContext" ] }, { - "id": "SameSiteCookieWarningReason", + "id": "CookieWarningReason", "type": "string", "enum": [ "WarnSameSiteUnspecifiedCrossSiteContext", @@ -1066,11 +999,12 @@ "WarnSameSiteStrictCrossDowngradeStrict", "WarnSameSiteStrictCrossDowngradeLax", "WarnSameSiteLaxCrossDowngradeStrict", - "WarnSameSiteLaxCrossDowngradeLax" + "WarnSameSiteLaxCrossDowngradeLax", + "WarnAttributeValueExceedsMaxSize" ] }, { - "id": "SameSiteCookieOperation", + "id": "CookieOperation", "type": "string", "enum": [ "SetCookie", @@ -1078,7 +1012,7 @@ ] }, { - "id": "SameSiteCookieIssueDetails", + "id": "CookieIssueDetails", "description": "This information is currently necessary, as the front-end has a difficult\ntime finding a specific cookie. With this, we can convey specific error\ninformation without the cookie.", "type": "object", "properties": [ @@ -1097,20 +1031,20 @@ "name": "cookieWarningReasons", "type": "array", "items": { - "$ref": "SameSiteCookieWarningReason" + "$ref": "CookieWarningReason" } }, { "name": "cookieExclusionReasons", "type": "array", "items": { - "$ref": "SameSiteCookieExclusionReason" + "$ref": "CookieExclusionReason" } }, { "name": "operation", "description": "Optionally identifies the site-for-cookies and the cookie url, which\nmay be used by the front-end as additional context.", - "$ref": "SameSiteCookieOperation" + "$ref": "CookieOperation" }, { "name": "siteForCookies", @@ -1142,6 +1076,7 @@ "id": "MixedContentResourceType", "type": "string", "enum": [ + "AttributionSrc", "Audio", "Beacon", "CSPReport", @@ -1292,7 +1227,8 @@ "kEvalViolation", "kURLViolation", "kTrustedTypesSinkViolation", - "kTrustedTypesPolicyViolation" + "kTrustedTypesPolicyViolation", + "kWasmEvalViolation" ] }, { @@ -1504,10 +1440,9 @@ "type": "string", "enum": [ "PermissionPolicyDisabled", - "InvalidAttributionSourceEventId", - "InvalidAttributionData", "AttributionSourceUntrustworthyOrigin", - "AttributionUntrustworthyOrigin" + "AttributionUntrustworthyOrigin", + "InvalidHeader" ] }, { @@ -1585,24 +1520,172 @@ ] }, { - "id": "WasmCrossOriginModuleSharingIssueDetails", + "id": "GenericIssueErrorType", + "type": "string", + "enum": [ + "CrossOriginPortalPostMessageError" + ] + }, + { + "id": "GenericIssueDetails", + "description": "Depending on the concrete errorType, different properties are set.", "type": "object", "properties": [ { - "name": "wasmModuleUrl", - "type": "string" + "name": "errorType", + "description": "Issues with the same errorType are aggregated in the frontend.", + "$ref": "GenericIssueErrorType" }, { - "name": "sourceOrigin", - "type": "string" + "name": "frameId", + "optional": true, + "$ref": "Page.FrameId" + } + ] + }, + { + "id": "DeprecationIssueType", + "type": "string", + "enum": [ + "AuthorizationCoveredByWildcard", + "CanRequestURLHTTPContainingNewline", + "ChromeLoadTimesConnectionInfo", + "ChromeLoadTimesFirstPaintAfterLoadTime", + "ChromeLoadTimesWasAlternateProtocolAvailable", + "CookieWithTruncatingChar", + "CrossOriginAccessBasedOnDocumentDomain", + "CrossOriginWindowAlert", + "CrossOriginWindowConfirm", + "CSSSelectorInternalMediaControlsOverlayCastButton", + "CustomCursorIntersectsViewport", + "DeprecationExample", + "DocumentDomainSettingWithoutOriginAgentClusterHeader", + "EventPath", + "GeolocationInsecureOrigin", + "GeolocationInsecureOriginDeprecatedNotRemoved", + "GetUserMediaInsecureOrigin", + "HostCandidateAttributeGetter", + "InsecurePrivateNetworkSubresourceRequest", + "LegacyConstraintGoogIPv6", + "LocalCSSFileExtensionRejected", + "MediaElementAudioSourceNode", + "MediaSourceAbortRemove", + "MediaSourceDurationTruncatingBuffered", + "NoSysexWebMIDIWithoutPermission", + "NotificationInsecureOrigin", + "NotificationPermissionRequestedIframe", + "ObsoleteWebRtcCipherSuite", + "PaymentRequestBasicCard", + "PaymentRequestShowWithoutGesture", + "PictureSourceSrc", + "PrefixedCancelAnimationFrame", + "PrefixedRequestAnimationFrame", + "PrefixedStorageInfo", + "PrefixedVideoDisplayingFullscreen", + "PrefixedVideoEnterFullscreen", + "PrefixedVideoEnterFullScreen", + "PrefixedVideoExitFullscreen", + "PrefixedVideoExitFullScreen", + "PrefixedVideoSupportsFullscreen", + "RangeExpand", + "RequestedSubresourceWithEmbeddedCredentials", + "RTCConstraintEnableDtlsSrtpFalse", + "RTCConstraintEnableDtlsSrtpTrue", + "RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics", + "RTCPeerConnectionSdpSemanticsPlanB", + "RtcpMuxPolicyNegotiate", + "RTPDataChannel", + "SharedArrayBufferConstructedWithoutIsolation", + "TextToSpeech_DisallowedByAutoplay", + "V8SharedArrayBufferConstructedInExtensionWithoutIsolation", + "XHRJSONEncodingDetection", + "XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload", + "XRSupportsSession" + ] + }, + { + "id": "DeprecationIssueDetails", + "description": "This issue tracks information needed to print a deprecation message.\nhttps://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md", + "type": "object", + "properties": [ + { + "name": "affectedFrame", + "optional": true, + "$ref": "AffectedFrame" }, { - "name": "targetOrigin", - "type": "string" + "name": "sourceCodeLocation", + "$ref": "SourceCodeLocation" }, { - "name": "isWarning", - "type": "boolean" + "name": "type", + "$ref": "DeprecationIssueType" + } + ] + }, + { + "id": "ClientHintIssueReason", + "type": "string", + "enum": [ + "MetaTagAllowListInvalidOrigin", + "MetaTagModifiedHTML" + ] + }, + { + "id": "FederatedAuthRequestIssueDetails", + "type": "object", + "properties": [ + { + "name": "federatedAuthRequestIssueReason", + "$ref": "FederatedAuthRequestIssueReason" + } + ] + }, + { + "id": "FederatedAuthRequestIssueReason", + "description": "Represents the failure reason when a federated authentication reason fails.\nShould be updated alongside RequestIdTokenStatus in\nthird_party/blink/public/mojom/devtools/inspector_issue.mojom to include\nall cases except for success.", + "type": "string", + "enum": [ + "ApprovalDeclined", + "TooManyRequests", + "ManifestListHttpNotFound", + "ManifestListNoResponse", + "ManifestListInvalidResponse", + "ManifestNotInManifestList", + "ManifestListTooBig", + "ManifestHttpNotFound", + "ManifestNoResponse", + "ManifestInvalidResponse", + "ClientMetadataHttpNotFound", + "ClientMetadataNoResponse", + "ClientMetadataInvalidResponse", + "ClientMetadataMissingPrivacyPolicyUrl", + "DisabledInSettings", + "ErrorFetchingSignin", + "InvalidSigninResponse", + "AccountsHttpNotFound", + "AccountsNoResponse", + "AccountsInvalidResponse", + "IdTokenHttpNotFound", + "IdTokenNoResponse", + "IdTokenInvalidResponse", + "IdTokenInvalidRequest", + "ErrorIdToken", + "Canceled" + ] + }, + { + "id": "ClientHintIssueDetails", + "description": "This issue tracks client hints related issues. It's used to deprecate old\nfeatures, encourage the use of new ones, and provide general guidance.", + "type": "object", + "properties": [ + { + "name": "sourceCodeLocation", + "$ref": "SourceCodeLocation" + }, + { + "name": "clientHintIssueReason", + "$ref": "ClientHintIssueReason" } ] }, @@ -1611,7 +1694,7 @@ "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.", "type": "string", "enum": [ - "SameSiteCookieIssue", + "CookieIssue", "MixedContentIssue", "BlockedByResponseIssue", "HeavyAdIssue", @@ -1623,7 +1706,10 @@ "AttributionReportingIssue", "QuirksModeIssue", "NavigatorUserAgentIssue", - "WasmCrossOriginModuleSharingIssue" + "GenericIssue", + "DeprecationIssue", + "ClientHintIssue", + "FederatedAuthRequestIssue" ] }, { @@ -1632,9 +1718,9 @@ "type": "object", "properties": [ { - "name": "sameSiteCookieIssueDetails", + "name": "cookieIssueDetails", "optional": true, - "$ref": "SameSiteCookieIssueDetails" + "$ref": "CookieIssueDetails" }, { "name": "mixedContentIssueDetails", @@ -1692,9 +1778,24 @@ "$ref": "NavigatorUserAgentIssueDetails" }, { - "name": "wasmCrossOriginModuleSharingIssue", + "name": "genericIssueDetails", + "optional": true, + "$ref": "GenericIssueDetails" + }, + { + "name": "deprecationIssueDetails", "optional": true, - "$ref": "WasmCrossOriginModuleSharingIssueDetails" + "$ref": "DeprecationIssueDetails" + }, + { + "name": "clientHintIssueDetails", + "optional": true, + "$ref": "ClientHintIssueDetails" + }, + { + "name": "federatedAuthRequestIssueDetails", + "optional": true, + "$ref": "FederatedAuthRequestIssueDetails" } ] }, @@ -2622,6 +2723,21 @@ } ] }, + { + "id": "InheritedPseudoElementMatches", + "description": "Inherited pseudo element matches from pseudos of an ancestor node.", + "type": "object", + "properties": [ + { + "name": "pseudoElements", + "description": "Matches of pseudo styles from the pseudos of an ancestor node.", + "type": "array", + "items": { + "$ref": "PseudoElementMatches" + } + } + ] + }, { "id": "RuleMatch", "description": "Match data for a CSS rule.", @@ -2819,6 +2935,26 @@ "items": { "$ref": "CSSContainerQuery" } + }, + { + "name": "supports", + "description": "@supports CSS at-rule array.\nThe array enumerates @supports at-rules starting with the innermost one, going outwards.", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "$ref": "CSSSupports" + } + }, + { + "name": "layers", + "description": "Cascade layer array. Contains the layer hierarchy that this rule belongs to starting\nwith the innermost layer and going outwards.", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "$ref": "CSSLayer" + } } ] }, @@ -3143,6 +3279,88 @@ } ] }, + { + "id": "CSSSupports", + "description": "CSS Supports at-rule descriptor.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "text", + "description": "Supports rule text.", + "type": "string" + }, + { + "name": "active", + "description": "Whether the supports condition is satisfied.", + "type": "boolean" + }, + { + "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" + } + ] + }, + { + "id": "CSSLayer", + "description": "CSS Layer at-rule descriptor.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "text", + "description": "Layer name.", + "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" + } + ] + }, + { + "id": "CSSLayerData", + "description": "CSS Layer data.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "name", + "description": "Layer name.", + "type": "string" + }, + { + "name": "subLayers", + "description": "Direct sub-layers", + "optional": true, + "type": "array", + "items": { + "$ref": "CSSLayerData" + } + }, + { + "name": "order", + "description": "Layer order. The order determines the order of the layer in the cascade order.\nA higher number has higher priority in the cascade order.", + "type": "number" + } + ] + }, { "id": "PlatformFontUsage", "description": "Information about amount of glyphs that were rendered with given font.", @@ -3544,6 +3762,15 @@ "$ref": "InheritedStyleEntry" } }, + { + "name": "inheritedPseudoElements", + "description": "A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).", + "optional": true, + "type": "array", + "items": { + "$ref": "InheritedPseudoElementMatches" + } + }, { "name": "cssKeyframesRules", "description": "A list of CSS keyframed animations matching this node.", @@ -3605,6 +3832,23 @@ } ] }, + { + "name": "getLayersForNode", + "description": "Returns all layers parsed by the rendering engine for the tree scope of a node.\nGiven a DOM element identified by nodeId, getLayersForNode returns the root\nlayer for the nearest ancestor document or shadow root. The layer root contains\nthe full layer tree for the tree scope and their ordering.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "$ref": "DOM.NodeId" + } + ], + "returns": [ + { + "name": "rootLayer", + "$ref": "CSSLayerData" + } + ] + }, { "name": "trackComputedStyleUpdates", "description": "Starts tracking the given computed styles for updates. The specified array of properties\nreplaces the one previously specified. Pass empty array to disable tracking.\nUse takeComputedStyleUpdates to retrieve the list of nodes that had properties modified.\nThe changes to computed style properties are only tracked for nodes pushed to the front-end\nby the DOM agent. If no changes to the tracked properties occur after the node has been pushed\nto the front-end, no updates will be issued for the node.", @@ -3723,9 +3967,35 @@ ], "returns": [ { - "name": "containerQuery", - "description": "The resulting CSS container query rule after modification.", - "$ref": "CSSContainerQuery" + "name": "containerQuery", + "description": "The resulting CSS container query rule after modification.", + "$ref": "CSSContainerQuery" + } + ] + }, + { + "name": "setSupportsText", + "description": "Modifies the expression of a supports at-rule.", + "experimental": true, + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + }, + { + "name": "range", + "$ref": "SourceRange" + }, + { + "name": "text", + "type": "string" + } + ], + "returns": [ + { + "name": "supports", + "description": "The resulting CSS Supports rule after modification.", + "$ref": "CSSSupports" } ] }, @@ -4200,6 +4470,16 @@ } ] }, + { + "name": "startDesktopMirroring", + "description": "Starts mirroring the desktop to the sink.", + "parameters": [ + { + "name": "sinkName", + "type": "string" + } + ] + }, { "name": "startTabMirroring", "description": "Starts mirroring the tab to the sink.", @@ -4309,7 +4589,12 @@ "scrollbar-track-piece", "scrollbar-corner", "resizer", - "input-list-button" + "input-list-button", + "page-transition", + "page-transition-container", + "page-transition-image-wrapper", + "page-transition-outgoing-image", + "page-transition-incoming-image" ] }, { @@ -4818,7 +5103,20 @@ }, { "name": "enable", - "description": "Enables DOM agent for the given page." + "description": "Enables DOM agent for the given page.", + "parameters": [ + { + "name": "includeWhitespace", + "description": "Whether to include whitespaces in the children array of returned Nodes.", + "experimental": true, + "optional": true, + "type": "string", + "enum": [ + "none", + "all" + ] + } + ] }, { "name": "focus", @@ -5675,6 +5973,28 @@ "$ref": "NodeId" } ] + }, + { + "name": "getQueryingDescendantsForContainer", + "description": "Returns the descendants of a container query container that have\ncontainer queries against this container.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "Id of the container node to find querying descendants from.", + "$ref": "NodeId" + } + ], + "returns": [ + { + "name": "nodeIds", + "description": "Descendant nodes with container queries against the given container.", + "type": "array", + "items": { + "$ref": "NodeId" + } + } + ] } ], "events": [ @@ -6167,6 +6487,35 @@ } ] }, + { + "domain": "EventBreakpoints", + "description": "EventBreakpoints permits setting breakpoints on particular operations and\nevents in targets that run JavaScript but do not have a DOM.\nJavaScript execution will stop on these operations as if there was a regular\nbreakpoint set.", + "experimental": true, + "commands": [ + { + "name": "setInstrumentationBreakpoint", + "description": "Sets breakpoint on particular native event.", + "parameters": [ + { + "name": "eventName", + "description": "Instrumentation name to stop on.", + "type": "string" + } + ] + }, + { + "name": "removeInstrumentationBreakpoint", + "description": "Removes breakpoint on particular native event.", + "parameters": [ + { + "name": "eventName", + "description": "Instrumentation name to stop on.", + "type": "string" + } + ] + } + ] + }, { "domain": "DOMSnapshot", "description": "This domain facilitates obtaining document snapshots with DOM, layout, and style information.", @@ -7018,6 +7367,10 @@ "description": "Query and modify DOM storage.", "experimental": true, "types": [ + { + "id": "SerializedStorageKey", + "type": "string" + }, { "id": "StorageId", "description": "DOM Storage identifier.", @@ -7026,8 +7379,15 @@ { "name": "securityOrigin", "description": "Security origin for the storage.", + "optional": true, "type": "string" }, + { + "name": "storageKey", + "description": "Represents a key by which DOM Storage keys its CachedStorageAreas", + "optional": true, + "$ref": "SerializedStorageKey" + }, { "name": "isLocalStorage", "description": "Whether the storage is local storage (not session storage).", @@ -7109,6 +7469,21 @@ "type": "string" } ] + }, + { + "name": "getStorageKeyForFrame", + "parameters": [ + { + "name": "frameId", + "$ref": "Page.FrameId" + } + ], + "returns": [ + { + "name": "storageKey", + "$ref": "SerializedStorageKey" + } + ] } ], "events": [ @@ -7447,8 +7822,17 @@ "$ref": "UserAgentBrandVersion" } }, + { + "name": "fullVersionList", + "optional": true, + "type": "array", + "items": { + "$ref": "UserAgentBrandVersion" + } + }, { "name": "fullVersion", + "deprecated": true, "optional": true, "type": "string" }, @@ -7471,6 +7855,16 @@ { "name": "mobile", "type": "boolean" + }, + { + "name": "bitness", + "optional": true, + "type": "string" + }, + { + "name": "wow64", + "optional": true, + "type": "boolean" } ] }, @@ -7523,6 +7917,19 @@ } ] }, + { + "name": "setAutoDarkModeOverride", + "description": "Automatically render all web contents using a dark theme.", + "experimental": true, + "parameters": [ + { + "name": "enabled", + "description": "Whether to enable or disable automatic dark mode.\nIf not specified, any existing override will be cleared.", + "optional": true, + "type": "boolean" + } + ] + }, { "name": "setCPUThrottlingRate", "description": "Enables CPU throttling to emulate slow CPUs.", @@ -7839,12 +8246,6 @@ "optional": true, "type": "integer" }, - { - "name": "waitForNavigation", - "description": "If set the virtual time policy change should be deferred until any frame starts navigating.\nNote any previous deferred policy change is superseded.", - "optional": true, - "type": "boolean" - }, { "name": "initialVirtualTime", "description": "If set, base::Time::Now will be overridden to initially return this value.", @@ -7946,6 +8347,18 @@ "$ref": "UserAgentMetadata" } ] + }, + { + "name": "setAutomationOverride", + "description": "Allows overriding the automation flag.", + "experimental": true, + "parameters": [ + { + "name": "enabled", + "description": "Whether the override should be enabled.", + "type": "boolean" + } + ] } ], "events": [ @@ -7992,7 +8405,7 @@ "commands": [ { "name": "beginFrame", - "description": "Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a\nscreenshot from the resulting frame. Requires that the target was created with enabled\nBeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also\nhttps://goo.gl/3zHXhB for more background.", + "description": "Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a\nscreenshot from the resulting frame. Requires that the target was created with enabled\nBeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also\nhttps://goo.gle/chrome-headless-rendering for more background.", "parameters": [ { "name": "frameTimeTicks", @@ -8708,6 +9121,15 @@ "$ref": "DragDataItem" } }, + { + "name": "files", + "description": "List of filenames that should be included when dropping", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + }, { "name": "dragOperationsMask", "description": "Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16", @@ -8850,7 +9272,7 @@ }, { "name": "commands", - "description": "Editing commands to send with the key event (e.g., 'selectAll') (default: []).\nThese are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding.\nSee https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.", + "description": "Editing commands to send with the key event (e.g., 'selectAll') (default: []).\nThese are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding.\nSee https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.", "experimental": true, "optional": true, "type": "array", @@ -8872,6 +9294,40 @@ } ] }, + { + "name": "imeSetComposition", + "description": "This method sets the current candidate text for ime.\nUse imeCommitComposition to commit the final text.\nUse imeSetComposition with empty string as text to cancel composition.", + "experimental": true, + "parameters": [ + { + "name": "text", + "description": "The text to insert", + "type": "string" + }, + { + "name": "selectionStart", + "description": "selection start", + "type": "integer" + }, + { + "name": "selectionEnd", + "description": "selection end", + "type": "integer" + }, + { + "name": "replacementStart", + "description": "replacement start", + "optional": true, + "type": "integer" + }, + { + "name": "replacementEnd", + "description": "replacement end", + "optional": true, + "type": "integer" + } + ] + }, { "name": "dispatchMouseEvent", "description": "Dispatches a mouse event to the page.", @@ -9771,6 +10227,14 @@ "description": "Logged text.", "type": "string" }, + { + "name": "category", + "optional": true, + "type": "string", + "enum": [ + "cors" + ] + }, { "name": "timestamp", "description": "Timestamp when this entry was added.", @@ -10460,8 +10924,8 @@ }, { "name": "timestamp", - "description": "Issuance date.", - "$ref": "TimeSinceEpoch" + "description": "Issuance date. Unlike TimeSinceEpoch, this contains the number of\nmilliseconds since January 1, 1970, UTC, not the number of seconds.", + "type": "number" }, { "name": "hashAlgorithm", @@ -10613,12 +11077,16 @@ "PreflightInvalidAllowCredentials", "PreflightMissingAllowExternal", "PreflightInvalidAllowExternal", + "PreflightMissingAllowPrivateNetwork", + "PreflightInvalidAllowPrivateNetwork", "InvalidAllowMethodsPreflightResponse", "InvalidAllowHeadersPreflightResponse", "MethodDisallowedByPreflightResponse", "HeaderDisallowedByPreflightResponse", "RedirectContainsCredentials", "InsecurePrivateNetwork", + "InvalidPrivateNetworkAccess", + "UnexpectedPrivateNetworkAccess", "NoCorsRedirectModeNotFollow" ] }, @@ -10714,7 +11182,8 @@ }, { "name": "headersText", - "description": "HTTP response headers text.", + "description": "HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.", + "deprecated": true, "optional": true, "type": "string" }, @@ -10731,7 +11200,8 @@ }, { "name": "requestHeadersText", - "description": "HTTP request headers text.", + "description": "HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.", + "deprecated": true, "optional": true, "type": "string" }, @@ -11054,6 +11524,20 @@ "description": "Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.\nAn unspecified port value allows protocol clients to emulate legacy cookie scope for the port.\nThis is a temporary ability and it will be removed in the future.", "experimental": true, "type": "integer" + }, + { + "name": "partitionKey", + "description": "Cookie partition key. The site of the top-level URL the browser was visiting at the start\nof the request to the endpoint that set the cookie.", + "experimental": true, + "optional": true, + "type": "string" + }, + { + "name": "partitionKeyOpaque", + "description": "True if cookie partition key is opaque.", + "experimental": true, + "optional": true, + "type": "boolean" } ] }, @@ -11079,7 +11563,8 @@ "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", "SamePartyFromCrossPartyContext", - "SamePartyConflictsWithOtherAttributes" + "SamePartyConflictsWithOtherAttributes", + "NameValuePairExceedsMaxSize" ] }, { @@ -11100,7 +11585,8 @@ "SchemefulSameSiteStrict", "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", - "SamePartyFromCrossPartyContext" + "SamePartyFromCrossPartyContext", + "NameValuePairExceedsMaxSize" ] }, { @@ -11235,6 +11721,13 @@ "experimental": true, "optional": true, "type": "integer" + }, + { + "name": "partitionKey", + "description": "Cookie partition key. The site of the top-level URL the browser was visiting at the start\nof the request to the endpoint that set the cookie.\nIf not set, the cookie will be set as not partitioned.", + "experimental": true, + "optional": true, + "type": "string" } ] }, @@ -11523,7 +12016,9 @@ "enum": [ "Allow", "BlockFromInsecureToMorePrivate", - "WarnFromInsecureToMorePrivate" + "WarnFromInsecureToMorePrivate", + "PreflightBlock", + "PreflightWarn" ] }, { @@ -11537,6 +12032,18 @@ "Unknown" ] }, + { + "id": "ConnectTiming", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "requestTime", + "description": "Timing's requestTime is a baseline in seconds, while the other numbers are ticks in\nmilliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for\nthe same request (but not for redirected requests).", + "type": "number" + } + ] + }, { "id": "ClientSecurityState", "experimental": true, @@ -11564,7 +12071,8 @@ "SameOrigin", "SameOriginAllowPopups", "UnsafeNone", - "SameOriginPlusCoep" + "SameOriginPlusCoep", + "SameOriginAllowPopupsPlusCoep" ] }, { @@ -11608,39 +12116,123 @@ "type": "object", "properties": [ { - "name": "value", - "$ref": "CrossOriginEmbedderPolicyValue" + "name": "value", + "$ref": "CrossOriginEmbedderPolicyValue" + }, + { + "name": "reportOnlyValue", + "$ref": "CrossOriginEmbedderPolicyValue" + }, + { + "name": "reportingEndpoint", + "optional": true, + "type": "string" + }, + { + "name": "reportOnlyReportingEndpoint", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "SecurityIsolationStatus", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "coop", + "optional": true, + "$ref": "CrossOriginOpenerPolicyStatus" + }, + { + "name": "coep", + "optional": true, + "$ref": "CrossOriginEmbedderPolicyStatus" + } + ] + }, + { + "id": "ReportStatus", + "description": "The status of a Reporting API report.", + "experimental": true, + "type": "string", + "enum": [ + "Queued", + "Pending", + "MarkedForRemoval", + "Success" + ] + }, + { + "id": "ReportId", + "experimental": true, + "type": "string" + }, + { + "id": "ReportingApiReport", + "description": "An object representing a report generated by the Reporting API.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "id", + "$ref": "ReportId" + }, + { + "name": "initiatorUrl", + "description": "The URL of the document that triggered the report.", + "type": "string" + }, + { + "name": "destination", + "description": "The name of the endpoint group that should be used to deliver the report.", + "type": "string" + }, + { + "name": "type", + "description": "The type of the report (specifies the set of data that is contained in the report body).", + "type": "string" + }, + { + "name": "timestamp", + "description": "When the report was generated.", + "$ref": "Network.TimeSinceEpoch" }, { - "name": "reportOnlyValue", - "$ref": "CrossOriginEmbedderPolicyValue" + "name": "depth", + "description": "How many uploads deep the related request was.", + "type": "integer" }, { - "name": "reportingEndpoint", - "optional": true, - "type": "string" + "name": "completedAttempts", + "description": "The number of delivery attempts made so far, not including an active attempt.", + "type": "integer" }, { - "name": "reportOnlyReportingEndpoint", - "optional": true, - "type": "string" + "name": "body", + "type": "object" + }, + { + "name": "status", + "$ref": "ReportStatus" } ] }, { - "id": "SecurityIsolationStatus", + "id": "ReportingApiEndpoint", "experimental": true, "type": "object", "properties": [ { - "name": "coop", - "optional": true, - "$ref": "CrossOriginOpenerPolicyStatus" + "name": "url", + "description": "The URL of the endpoint to which reports may be delivered.", + "type": "string" }, { - "name": "coep", - "optional": true, - "$ref": "CrossOriginEmbedderPolicyStatus" + "name": "groupName", + "description": "Name of the endpoint group.", + "type": "string" } ] }, @@ -12225,6 +12817,13 @@ "experimental": true, "optional": true, "type": "integer" + }, + { + "name": "partitionKey", + "description": "Cookie partition key. The site of the top-level URL the browser was visiting at the start\nof the request to the endpoint that set the cookie.\nIf not set, the cookie will be set as not partitioned.", + "experimental": true, + "optional": true, + "type": "string" } ], "returns": [ @@ -12339,6 +12938,18 @@ } ] }, + { + "name": "enableReportingApi", + "description": "Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client.\nEnabling triggers 'reportingApiReportAdded' for all existing reports.", + "experimental": true, + "parameters": [ + { + "name": "enable", + "description": "Whether to enable or disable events for the Reporting API", + "type": "boolean" + } + ] + }, { "name": "loadNetworkResource", "description": "Fetches the resource and returns the content.", @@ -12346,7 +12957,8 @@ "parameters": [ { "name": "frameId", - "description": "Frame id to get the resource for.", + "description": "Frame id to get the resource for. Mandatory for frame targets, and\nshould be omitted for worker targets.", + "optional": true, "$ref": "Page.FrameId" }, { @@ -12621,6 +13233,12 @@ "description": "Request initiator.", "$ref": "Initiator" }, + { + "name": "redirectHasExtraInfo", + "description": "In the case that redirectResponse is populated, this flag indicates whether\nrequestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted\nfor the request which was just redirected.", + "experimental": true, + "type": "boolean" + }, { "name": "redirectResponse", "description": "Redirect response data.", @@ -12715,6 +13333,12 @@ "description": "Response data.", "$ref": "Response" }, + { + "name": "hasExtraInfo", + "description": "Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be\nor were emitted for this request.", + "experimental": true, + "type": "boolean" + }, { "name": "frameId", "description": "Frame identifier.", @@ -12953,6 +13577,12 @@ "description": "Raw request headers as they will be sent over the wire.", "$ref": "Headers" }, + { + "name": "connectTiming", + "description": "Connection timing information for the request.", + "experimental": true, + "$ref": "ConnectTiming" + }, { "name": "clientSecurityState", "description": "The client security state set for the request.", @@ -12989,6 +13619,11 @@ "description": "The IP address space of the resource. The address space can only be determined once the transport\nestablished the connection, so we can't send it in `requestWillBeSentExtraInfo`.", "$ref": "IPAddressSpace" }, + { + "name": "statusCode", + "description": "The status code of the response. This is useful in cases the request failed and no responseReceived\nevent is triggered, which is the case for, e.g., CORS errors. This is also the correct status code\nfor cached requests, where the status in responseReceived is a 200 and this will be 304.", + "type": "integer" + }, { "name": "headersText", "description": "Raw response header text as it was received over the wire. The raw text may not always be\navailable, such as in the case of HTTP/2 or QUIC.", @@ -13134,6 +13769,45 @@ "$ref": "RequestId" } ] + }, + { + "name": "reportingApiReportAdded", + "description": "Is sent whenever a new report is added.\nAnd after 'enableReportingApi' for all existing reports.", + "experimental": true, + "parameters": [ + { + "name": "report", + "$ref": "ReportingApiReport" + } + ] + }, + { + "name": "reportingApiReportUpdated", + "experimental": true, + "parameters": [ + { + "name": "report", + "$ref": "ReportingApiReport" + } + ] + }, + { + "name": "reportingApiEndpointsChangedForOrigin", + "experimental": true, + "parameters": [ + { + "name": "origin", + "description": "Origin of the document(s) which configured the endpoints.", + "type": "string" + }, + { + "name": "endpoints", + "type": "array", + "items": { + "$ref": "ReportingApiEndpoint" + } + } + ] } ] }, @@ -13551,6 +14225,7 @@ "enum": [ "rgb", "hsl", + "hwb", "hex" ] }, @@ -13679,12 +14354,58 @@ "properties": [ { "name": "containerBorder", - "description": "The style of the container border", + "description": "The style of the container border.", + "optional": true, + "$ref": "LineStyle" + }, + { + "name": "descendantBorder", + "description": "The style of the descendants' borders.", "optional": true, "$ref": "LineStyle" } ] }, + { + "id": "IsolatedElementHighlightConfig", + "type": "object", + "properties": [ + { + "name": "isolationModeHighlightConfig", + "description": "A descriptor for the highlight appearance of an element in isolation mode.", + "$ref": "IsolationModeHighlightConfig" + }, + { + "name": "nodeId", + "description": "Identifier of the isolated element to highlight.", + "$ref": "DOM.NodeId" + } + ] + }, + { + "id": "IsolationModeHighlightConfig", + "type": "object", + "properties": [ + { + "name": "resizerColor", + "description": "The fill color of the resizers (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "resizerHandleColor", + "description": "The fill color for resizer handles (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "maskColor", + "description": "The fill color for the mask covering non-isolated elements (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + } + ] + }, { "id": "InspectMode", "type": "string", @@ -14089,7 +14810,8 @@ }, { "name": "setShowHitTestBorders", - "description": "Requests that backend shows hit-test borders on layers", + "description": "Deprecated, no longer has any effect.", + "deprecated": true, "parameters": [ { "name": "show", @@ -14130,6 +14852,20 @@ "$ref": "HingeConfig" } ] + }, + { + "name": "setShowIsolatedElements", + "description": "Show elements in isolation mode with overlays.", + "parameters": [ + { + "name": "isolatedElementHighlightConfigs", + "description": "An array of node identifiers and descriptors for the highlight appearance.", + "type": "array", + "items": { + "$ref": "IsolatedElementHighlightConfig" + } + } + ] } ], "events": [ @@ -14272,22 +15008,29 @@ "ambient-light-sensor", "attribution-reporting", "autoplay", + "browsing-topics", "camera", "ch-dpr", "ch-device-memory", "ch-downlink", "ch-ect", - "ch-lang", + "ch-partitioned-cookies", "ch-prefers-color-scheme", "ch-rtt", + "ch-save-data", "ch-ua", "ch-ua-arch", "ch-ua-bitness", "ch-ua-platform", "ch-ua-model", "ch-ua-mobile", + "ch-ua-full", "ch-ua-full-version", + "ch-ua-full-version-list", "ch-ua-platform-version", + "ch-ua-reduced", + "ch-ua-wow64", + "ch-viewport-height", "ch-viewport-width", "ch-width", "clipboard-read", @@ -14308,6 +15051,9 @@ "hid", "idle-detection", "interest-cohort", + "join-ad-interest-group", + "keyboard-map", + "local-fonts", "magnetometer", "microphone", "midi", @@ -14315,6 +15061,7 @@ "payment", "picture-in-picture", "publickey-credentials-get", + "run-ad-auction", "screen-wake-lock", "serial", "shared-autofill", @@ -14335,7 +15082,8 @@ "type": "string", "enum": [ "Header", - "IframeAttribute" + "IframeAttribute", + "InFencedFrameTree" ] }, { @@ -14389,7 +15137,8 @@ "WrongVersion", "FeatureDisabled", "TokenDisabled", - "FeatureDisabledForUser" + "FeatureDisabledForUser", + "UnknownTrial" ] }, { @@ -14501,7 +15250,7 @@ "name": "parentId", "description": "Parent frame identifier.", "optional": true, - "type": "string" + "$ref": "FrameId" }, { "name": "loaderId", @@ -14576,16 +15325,6 @@ "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" - } } ] }, @@ -14989,13 +15728,31 @@ "type": "string" }, { - "name": "pictograph", - "description": "The pictograph font-family.", + "name": "math", + "description": "The math font-family.", "optional": true, "type": "string" } ] }, + { + "id": "ScriptFontFamilies", + "description": "Font families collection for a script.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "script", + "description": "Name of the script which these font families are defined for.", + "type": "string" + }, + { + "name": "fontFamilies", + "description": "Generic font families collection for the script.", + "$ref": "FontFamilies" + } + ] + }, { "id": "FontSizes", "description": "Default font sizes.", @@ -15131,7 +15888,7 @@ "experimental": true, "type": "string", "enum": [ - "NotMainFrame", + "NotPrimaryMainFrame", "BackForwardCacheDisabled", "RelatedActiveContentsExist", "HTTPStatusNotOK", @@ -15147,7 +15904,6 @@ "JavaScriptExecution", "RendererProcessKilled", "RendererProcessCrashed", - "GrantedMediaStreamAccess", "SchedulerTrackedFeatureUsed", "ConflictingBrowsingInstance", "CacheFlushed", @@ -15174,13 +15930,19 @@ "ForegroundCacheLimit", "BrowsingInstanceNotSwapped", "BackForwardCacheDisabledForDelegate", - "OptInUnloadHeaderNotPresent", + "UnloadHandlerExistsInMainFrame", "UnloadHandlerExistsInSubFrame", "ServiceWorkerUnregistration", "CacheControlNoStore", "CacheControlNoStoreCookieModified", "CacheControlNoStoreHTTPOnlyCookieModified", + "NoResponseHead", + "Unknown", + "ActivationNavigationsDisallowedForBug1234857", + "ErrorDocument", + "FencedFramesEmbedder", "WebSocket", + "WebTransport", "WebRTC", "MainResourceHasCacheControlNoStore", "MainResourceHasCacheControlNoCache", @@ -15206,7 +15968,6 @@ "WebShare", "RequestedStorageAccessGrant", "WebNfc", - "WebFileSystem", "OutstandingNetworkRequestFetch", "OutstandingNetworkRequestXHR", "AppBanner", @@ -15221,10 +15982,35 @@ "KeyboardLock", "WebOTPService", "OutstandingNetworkRequestDirectSocket", - "IsolatedWorldScript", + "InjectedJavascript", "InjectedStyleSheet", - "MediaSessionImplOnServiceCreated", - "Unknown" + "Dummy", + "ContentSecurityHandler", + "ContentWebAuthenticationAPI", + "ContentFileChooser", + "ContentSerial", + "ContentFileSystemAccess", + "ContentMediaDevicesDispatcherHost", + "ContentWebBluetooth", + "ContentWebUSB", + "ContentMediaSession", + "ContentMediaSessionService", + "ContentScreenReader", + "EmbedderPopupBlockerTabHelper", + "EmbedderSafeBrowsingTriggeredPopupBlocker", + "EmbedderSafeBrowsingThreatDetails", + "EmbedderAppBannerManager", + "EmbedderDomDistillerViewerSource", + "EmbedderDomDistillerSelfDeletingRequestDelegate", + "EmbedderOomInterventionTabHelper", + "EmbedderOfflinePage", + "EmbedderChromePasswordManagerClientBindCredentialManager", + "EmbedderPermissionRequestManager", + "EmbedderModalDialog", + "EmbedderExtensions", + "EmbedderExtensionMessaging", + "EmbedderExtensionMessagingForOpenPort", + "EmbedderExtensionSentMessageToCachedFrame" ] }, { @@ -15252,8 +16038,82 @@ "name": "reason", "description": "Not restored reason", "$ref": "BackForwardCacheNotRestoredReason" + }, + { + "name": "context", + "description": "Context associated with the reason. The meaning of this context is\ndependent on the reason:\n- EmbedderExtensionSentMessageToCachedFrame: the extension ID.", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "BackForwardCacheNotRestoredExplanationTree", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "url", + "description": "URL of each frame", + "type": "string" + }, + { + "name": "explanations", + "description": "Not restored reasons of each frame", + "type": "array", + "items": { + "$ref": "BackForwardCacheNotRestoredExplanation" + } + }, + { + "name": "children", + "description": "Array of children frame", + "type": "array", + "items": { + "$ref": "BackForwardCacheNotRestoredExplanationTree" + } } ] + }, + { + "id": "PrerenderFinalStatus", + "description": "List of FinalStatus reasons for Prerender2.", + "type": "string", + "enum": [ + "Activated", + "Destroyed", + "LowEndDevice", + "CrossOriginRedirect", + "CrossOriginNavigation", + "InvalidSchemeRedirect", + "InvalidSchemeNavigation", + "InProgressNavigation", + "NavigationRequestBlockedByCsp", + "MainFrameNavigation", + "MojoBinderPolicy", + "RendererProcessCrashed", + "RendererProcessKilled", + "Download", + "TriggerDestroyed", + "NavigationNotCommitted", + "NavigationBadHttpStatus", + "ClientCertRequested", + "NavigationRequestNetworkError", + "MaxNumOfRunningPrerendersExceeded", + "CancelAllHostsForTesting", + "DidFailLoad", + "Stop", + "SslCertificateError", + "LoginAuthRequested", + "UaChangeRequiresReload", + "BlockedByClient", + "AudioOutputDeviceRequested", + "MixedContent", + "TriggerBackgrounded", + "EmbedderTriggeredAndSameOriginRedirected", + "EmbedderTriggeredAndCrossOriginRedirected", + "EmbedderTriggeredAndDestroyed" + ] } ], "commands": [ @@ -15515,6 +16375,25 @@ } ] }, + { + "name": "getAppId", + "description": "Returns the unique (PWA) app id.\nOnly returns values if the feature flag 'WebAppEnableManifestId' is enabled", + "experimental": true, + "returns": [ + { + "name": "appId", + "description": "App id, either from manifest's id attribute or computed from start_url", + "optional": true, + "type": "string" + }, + { + "name": "recommendedId", + "description": "Recommendation for manifest's id attribute to match current id computed from start_url", + "optional": true, + "type": "string" + } + ] + }, { "name": "getCookies", "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie\ninformation in the `cookies` field.", @@ -15549,19 +16428,19 @@ "returns": [ { "name": "layoutViewport", - "description": "Deprecated metrics relating to the layout viewport. Can be in DP or in CSS pixels depending on the `enable-use-zoom-for-dsf` flag. Use `cssLayoutViewport` instead.", + "description": "Deprecated metrics relating to the layout viewport. Is in device pixels. Use `cssLayoutViewport` instead.", "deprecated": true, "$ref": "LayoutViewport" }, { "name": "visualViewport", - "description": "Deprecated metrics relating to the visual viewport. Can be in DP or in CSS pixels depending on the `enable-use-zoom-for-dsf` flag. Use `cssVisualViewport` instead.", + "description": "Deprecated metrics relating to the visual viewport. Is in device pixels. Use `cssVisualViewport` instead.", "deprecated": true, "$ref": "VisualViewport" }, { "name": "contentSize", - "description": "Deprecated size of scrollable area. Can be in DP or in CSS pixels depending on the `enable-use-zoom-for-dsf` flag. Use `cssContentSize` instead.", + "description": "Deprecated size of scrollable area. Is in DP. Use `cssContentSize` instead.", "deprecated": true, "$ref": "DOM.Rect" }, @@ -15795,16 +16674,10 @@ }, { "name": "pageRanges", - "description": "Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means\nprint all pages.", + "description": "Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are\nprinted in the document order, not in the order specified, and no\nmore than once.\nDefaults to empty string, which implies the entire document is printed.\nThe page numbers are quietly capped to actual page count of the\ndocument, and ranges beyond the end of the document are ignored.\nIf this results in no pages to print, an error is reported.\nIt is an error to specify a range with start greater than end.", "optional": true, "type": "string" }, - { - "name": "ignoreInvalidPageRanges", - "description": "Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'.\nDefaults to false.", - "optional": true, - "type": "boolean" - }, { "name": "headerTemplate", "description": "HTML template for the print header. Should be valid HTML markup with following\nclasses used to inject printing values into them:\n- `date`: formatted print date\n- `title`: document title\n- `url`: document location\n- `pageNumber`: current page number\n- `totalPages`: total pages in the document\n\nFor example, `` would generate span containing the title.", @@ -15990,6 +16863,26 @@ } ] }, + { + "name": "getOriginTrials", + "description": "Get Origin Trials on given frame.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "$ref": "FrameId" + } + ], + "returns": [ + { + "name": "originTrials", + "type": "array", + "items": { + "$ref": "OriginTrial" + } + } + ] + }, { "name": "setDeviceMetricsOverride", "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\nwindow.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media\nquery results).", @@ -16100,6 +16993,15 @@ "name": "fontFamilies", "description": "Specifies font families to set. If a font family is not specified, it won't be changed.", "$ref": "FontFamilies" + }, + { + "name": "forScripts", + "description": "Specifies font families to set for individual scripts.", + "optional": true, + "type": "array", + "items": { + "$ref": "ScriptFontFamilies" + } } ] }, @@ -16293,20 +17195,9 @@ "description": "Stops sending each frame in the `screencastFrame`.", "experimental": true }, - { - "name": "setProduceCompilationCache", - "description": "Forces compilation cache to be generated for every subresource script.\nSee also: `Page.produceCompilationCache`.", - "experimental": true, - "parameters": [ - { - "name": "enabled", - "type": "boolean" - } - ] - }, { "name": "produceCompilationCache", - "description": "Requests backend to produce compilation cache for the specified scripts.\nUnlike setProduceCompilationCache, this allows client to only produce cache\nfor specific scripts. `scripts` are appeneded to the list of scripts\nfor which the cache for would produced. Disabling compilation cache with\n`setProduceCompilationCache` would reset all pending cache requests.\nThe list may also be reset during page navigation.\nWhen script with a matching URL is encountered, the cache is optionally\nproduced upon backend discretion, based on internal heuristics.\nSee also: `Page.compilationCacheProduced`.", + "description": "Requests backend to produce compilation cache for the specified scripts.\n`scripts` are appeneded to the list of scripts for which the cache\nwould be produced. The list may be reset during page navigation.\nWhen script with a matching URL is encountered, the cache is optionally\nproduced upon backend discretion, based on internal heuristics.\nSee also: `Page.compilationCacheProduced`.", "experimental": true, "parameters": [ { @@ -16334,11 +17225,27 @@ } ] }, - { - "name": "clearCompilationCache", - "description": "Clears seeded compilation cache.", - "experimental": true - }, + { + "name": "clearCompilationCache", + "description": "Clears seeded compilation cache.", + "experimental": true + }, + { + "name": "setSPCTransactionMode", + "description": "Sets the Secure Payment Confirmation transaction mode.\nhttps://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode", + "experimental": true, + "parameters": [ + { + "name": "mode", + "type": "string", + "enum": [ + "none", + "autoaccept", + "autoreject" + ] + } + ] + }, { "name": "generateTestReport", "description": "Generates a report for testing.", @@ -16738,6 +17645,31 @@ "items": { "$ref": "BackForwardCacheNotRestoredExplanation" } + }, + { + "name": "notRestoredExplanationsTree", + "description": "Tree structure of reasons why the page could not be cached for each frame.", + "optional": true, + "$ref": "BackForwardCacheNotRestoredExplanationTree" + } + ] + }, + { + "name": "prerenderAttemptCompleted", + "description": "Fired when a prerender attempt is completed.", + "parameters": [ + { + "name": "initiatingFrameId", + "description": "The frame id of the frame initiating prerendering.", + "$ref": "FrameId" + }, + { + "name": "prerenderingUrl", + "type": "string" + }, + { + "name": "finalStatus", + "$ref": "PrerenderFinalStatus" } ] }, @@ -17494,7 +18426,8 @@ }, { "name": "securityStateChanged", - "description": "The security state of the page changed.", + "description": "The security state of the page changed. No longer being sent.", + "deprecated": true, "parameters": [ { "name": "securityState", @@ -17509,7 +18442,8 @@ }, { "name": "explanations", - "description": "List of explanations for the security state. If the overall security state is `insecure` or\n`warning`, at least one corresponding explanation should be included.", + "description": "Previously a list of explanations for the security state. Now always\nempty.", + "deprecated": true, "type": "array", "items": { "$ref": "SecurityStateExplanation" @@ -17523,7 +18457,8 @@ }, { "name": "summary", - "description": "Overrides user-visible description of the state.", + "description": "Overrides user-visible description of the state. Always omitted.", + "deprecated": true, "optional": true, "type": "string" } @@ -17840,6 +18775,10 @@ "Network" ], "types": [ + { + "id": "SerializedStorageKey", + "type": "string" + }, { "id": "StorageType", "description": "Enum of possible storage types.", @@ -17854,6 +18793,7 @@ "websql", "service_workers", "cache_storage", + "interest_groups", "all", "other" ] @@ -17890,6 +18830,103 @@ "type": "number" } ] + }, + { + "id": "InterestGroupAccessType", + "description": "Enum of interest group access types.", + "type": "string", + "enum": [ + "join", + "leave", + "update", + "bid", + "win" + ] + }, + { + "id": "InterestGroupAd", + "description": "Ad advertising element inside an interest group.", + "type": "object", + "properties": [ + { + "name": "renderUrl", + "type": "string" + }, + { + "name": "metadata", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "InterestGroupDetails", + "description": "The full details of an interest group.", + "type": "object", + "properties": [ + { + "name": "ownerOrigin", + "type": "string" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "expirationTime", + "$ref": "Network.TimeSinceEpoch" + }, + { + "name": "joiningOrigin", + "type": "string" + }, + { + "name": "biddingUrl", + "optional": true, + "type": "string" + }, + { + "name": "biddingWasmHelperUrl", + "optional": true, + "type": "string" + }, + { + "name": "updateUrl", + "optional": true, + "type": "string" + }, + { + "name": "trustedBiddingSignalsUrl", + "optional": true, + "type": "string" + }, + { + "name": "trustedBiddingSignalsKeys", + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "userBiddingSignals", + "optional": true, + "type": "string" + }, + { + "name": "ads", + "type": "array", + "items": { + "$ref": "InterestGroupAd" + } + }, + { + "name": "adComponents", + "type": "array", + "items": { + "$ref": "InterestGroupAd" + } + } + ] } ], "commands": [ @@ -18092,6 +19129,38 @@ "type": "boolean" } ] + }, + { + "name": "getInterestGroupDetails", + "description": "Gets details for a named interest group.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ], + "returns": [ + { + "name": "details", + "$ref": "InterestGroupDetails" + } + ] + }, + { + "name": "setInterestGroupTracking", + "description": "Enables/Disables issuing of interestGroupAccessed events.", + "experimental": true, + "parameters": [ + { + "name": "enable", + "type": "boolean" + } + ] } ], "events": [ @@ -18153,6 +19222,28 @@ "type": "string" } ] + }, + { + "name": "interestGroupAccessed", + "description": "One of the interest groups was accessed by the associated page.", + "parameters": [ + { + "name": "accessTime", + "$ref": "Network.TimeSinceEpoch" + }, + { + "name": "type", + "$ref": "InterestGroupAccessType" + }, + { + "name": "ownerOrigin", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] } ] }, @@ -18634,6 +19725,15 @@ "description": "Proxy bypass list, similar to the one passed to --proxy-bypass-list", "optional": true, "type": "string" + }, + { + "name": "originsWithUniversalNetworkAccess", + "description": "An optional list of origins to grant unlimited cross-origin access to.\nParts of the URL other than those constituting origin are ignored.", + "optional": true, + "type": "array", + "items": { + "type": "string" + } } ], "returns": [ @@ -18683,6 +19783,7 @@ { "name": "browserContextId", "description": "The browser context to create the page in.", + "experimental": true, "optional": true, "$ref": "Browser.BrowserContextID" }, @@ -18802,7 +19903,7 @@ }, { "name": "setAutoAttach", - "description": "Controls whether to automatically attach to new targets which are considered to be related to\nthis one. When turned on, attaches to all existing related targets as well. When turned off,\nautomatically detaches from all currently attached targets.", + "description": "Controls whether to automatically attach to new targets which are considered to be related to\nthis one. When turned on, attaches to all existing related targets as well. When turned off,\nautomatically detaches from all currently attached targets.\nThis also clears all targets added by `autoAttachRelated` from the list of targets to watch\nfor creation of related targets.", "experimental": true, "parameters": [ { @@ -18823,6 +19924,22 @@ } ] }, + { + "name": "autoAttachRelated", + "description": "Adds the specified target to the list of targets that will be monitored for any related target\ncreation (such as child frames, child workers and new versions of service worker) and reported\nthrough `attachedToTarget`. The specified target is also auto-attached.\nThis cancels the effect of any previous `setAutoAttach` and is also cancelled by subsequent\n`setAutoAttach`. Only available at the Browser target.", + "experimental": true, + "parameters": [ + { + "name": "targetId", + "$ref": "TargetID" + }, + { + "name": "waitForDebuggerOnStart", + "description": "Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`\nto run paused targets.", + "type": "boolean" + } + ] + }, { "name": "setDiscoverTargets", "description": "Controls whether to discover available targets and notify via\n`targetCreated/targetInfoChanged/targetDestroyed` events.", @@ -19522,7 +20639,7 @@ }, { "name": "body", - "description": "A response body. (Encoded as a base64 string when passed over JSON)", + "description": "A response body. If absent, original response body will be used if\nthe request is intercepted at the response stage and empty body\nwill be used if the request is intercepted at the request stage. (Encoded as a base64 string when passed over JSON)", "optional": true, "type": "string" }, @@ -19569,6 +20686,13 @@ "items": { "$ref": "HeaderEntry" } + }, + { + "name": "interceptResponse", + "description": "If set, overrides response interception behavior for this request.", + "experimental": true, + "optional": true, + "type": "boolean" } ] }, @@ -19588,6 +20712,45 @@ } ] }, + { + "name": "continueResponse", + "description": "Continues loading of the paused response, optionally modifying the\nresponse headers. If either responseCode or headers are modified, all of them\nmust be present.", + "experimental": true, + "parameters": [ + { + "name": "requestId", + "description": "An id the client received in requestPaused event.", + "$ref": "RequestId" + }, + { + "name": "responseCode", + "description": "An HTTP response code. If absent, original response code will be used.", + "optional": true, + "type": "integer" + }, + { + "name": "responsePhrase", + "description": "A textual representation of responseCode.\nIf absent, a standard phrase matching responseCode is used.", + "optional": true, + "type": "string" + }, + { + "name": "responseHeaders", + "description": "Response headers. If absent, original response headers will be used.", + "optional": true, + "type": "array", + "items": { + "$ref": "HeaderEntry" + } + }, + { + "name": "binaryResponseHeaders", + "description": "Alternative way of specifying response headers as a \\0-separated\nseries of name: value pairs. Prefer the above method unless you\nneed to represent some non-UTF8 values that can't be transmitted\nover the protocol as text. (Encoded as a base64 string when passed over JSON)", + "optional": true, + "type": "string" + } + ] + }, { "name": "getResponseBody", "description": "Causes the body of the response to be received from the server and\nreturned as a single string. May only be issued for a request that\nis paused in the Response stage and is mutually exclusive with\ntakeResponseBodyForInterceptionAsStream. Calling other methods that\naffect the request or disabling fetch domain before body is received\nresults in an undefined behavior.", @@ -19665,6 +20828,12 @@ "optional": true, "type": "integer" }, + { + "name": "responseStatusText", + "description": "Response status text if intercepted at response stage.", + "optional": true, + "type": "string" + }, { "name": "responseHeaders", "description": "Response headers if intercepted at the response stage.", @@ -20257,6 +21426,12 @@ "optional": true, "type": "boolean" }, + { + "name": "hasMinPinLength", + "description": "If set to true, the authenticator will support the minPinLength extension.\nhttps://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-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.", @@ -20522,23 +21697,55 @@ } ] }, + { + "id": "PlayerErrorSourceLocation", + "description": "Represents logged source line numbers reported in an error.\nNOTE: file and line are from chromium c++ implementation code, not js.", + "type": "object", + "properties": [ + { + "name": "file", + "type": "string" + }, + { + "name": "line", + "type": "integer" + } + ] + }, { "id": "PlayerError", "description": "Corresponds to kMediaError", "type": "object", "properties": [ { - "name": "type", - "type": "string", - "enum": [ - "pipeline_error", - "media_error" - ] + "name": "errorType", + "type": "string" }, { - "name": "errorCode", - "description": "When this switches to using media::Status instead of PipelineStatus\nwe can remove \"errorCode\" and replace it with the fields from\na Status instance. This also seems like a duplicate of the error\nlevel enum - there is a todo bug to have that level removed and\nuse this instead. (crbug.com/1068454)", - "type": "string" + "name": "code", + "description": "Code is the numeric enum entry for a specific set of error codes, such\nas PipelineStatusCodes in media/base/pipeline_status.h", + "type": "integer" + }, + { + "name": "stack", + "description": "A trace of where this error was caused / where it passed through.", + "type": "array", + "items": { + "$ref": "PlayerErrorSourceLocation" + } + }, + { + "name": "cause", + "description": "Errors potentially have a root cause error, ie, a DecoderError might be\ncaused by an WindowsError", + "type": "array", + "items": { + "$ref": "PlayerError" + } + }, + { + "name": "data", + "description": "Extra data attached to an error, such as an HRESULT, Video Codec, etc.", + "type": "object" } ] } diff --git a/example_advanced_test.go b/example_advanced_test.go index da44ed0..7ef5e84 100644 --- a/example_advanced_test.go +++ b/example_advanced_test.go @@ -83,7 +83,7 @@ func Example_advanced() { if err = runBatch( // Enable all the domain events that we're interested in. - func() error { return c.DOM.Enable(ctx) }, + func() error { return c.DOM.Enable(ctx, nil) }, func() error { return c.Network.Enable(ctx, nil) }, func() error { return c.Page.Enable(ctx) }, func() error { return c.Runtime.Enable(ctx) }, diff --git a/protocol/accessibility/command.go b/protocol/accessibility/command.go index 182f619..18ec424 100644 --- a/protocol/accessibility/command.go +++ b/protocol/accessibility/command.go @@ -4,6 +4,7 @@ package accessibility import ( "github.com/mafredri/cdp/protocol/dom" + "github.com/mafredri/cdp/protocol/page" "github.com/mafredri/cdp/protocol/runtime" ) @@ -59,7 +60,8 @@ type GetPartialAXTreeReply struct { // GetFullAXTreeArgs represents the arguments for GetFullAXTree in the Accessibility domain. type GetFullAXTreeArgs struct { - MaxDepth *int `json:"max_depth,omitempty"` // The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned. + Depth *int `json:"depth,omitempty"` // The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned. + FrameID *page.FrameID `json:"frameId,omitempty"` // The frame for whose document the AX tree should be retrieved. If omitted, the root frame is used. } // NewGetFullAXTreeArgs initializes GetFullAXTreeArgs with the required arguments. @@ -69,11 +71,19 @@ func NewGetFullAXTreeArgs() *GetFullAXTreeArgs { return args } -// SetMaxDepth sets the MaxDepth optional argument. The maximum depth -// at which descendants of the root node should be retrieved. If -// omitted, the full tree is returned. -func (a *GetFullAXTreeArgs) SetMaxDepth(maxDepth int) *GetFullAXTreeArgs { - a.MaxDepth = &maxDepth +// SetDepth sets the Depth optional argument. The maximum depth at +// which descendants of the root node should be retrieved. If omitted, +// the full tree is returned. +func (a *GetFullAXTreeArgs) SetDepth(depth int) *GetFullAXTreeArgs { + a.Depth = &depth + return a +} + +// SetFrameID sets the FrameID optional argument. The frame for whose +// document the AX tree should be retrieved. If omitted, the root frame +// is used. +func (a *GetFullAXTreeArgs) SetFrameID(frameID page.FrameID) *GetFullAXTreeArgs { + a.FrameID = &frameID return a } @@ -82,9 +92,74 @@ type GetFullAXTreeReply struct { Nodes []AXNode `json:"nodes"` // No description. } +// GetRootAXNodeArgs represents the arguments for GetRootAXNode in the Accessibility domain. +type GetRootAXNodeArgs struct { + FrameID *page.FrameID `json:"frameId,omitempty"` // The frame in whose document the node resides. If omitted, the root frame is used. +} + +// NewGetRootAXNodeArgs initializes GetRootAXNodeArgs with the required arguments. +func NewGetRootAXNodeArgs() *GetRootAXNodeArgs { + args := new(GetRootAXNodeArgs) + + return args +} + +// SetFrameID sets the FrameID optional argument. The frame in whose +// document the node resides. If omitted, the root frame is used. +func (a *GetRootAXNodeArgs) SetFrameID(frameID page.FrameID) *GetRootAXNodeArgs { + a.FrameID = &frameID + return a +} + +// GetRootAXNodeReply represents the return values for GetRootAXNode in the Accessibility domain. +type GetRootAXNodeReply struct { + Node AXNode `json:"node"` // No description. +} + +// GetAXNodeAndAncestorsArgs represents the arguments for GetAXNodeAndAncestors in the Accessibility domain. +type GetAXNodeAndAncestorsArgs struct { + NodeID *dom.NodeID `json:"nodeId,omitempty"` // Identifier of the node to get. + BackendNodeID *dom.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node to get. + ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper to get. +} + +// NewGetAXNodeAndAncestorsArgs initializes GetAXNodeAndAncestorsArgs with the required arguments. +func NewGetAXNodeAndAncestorsArgs() *GetAXNodeAndAncestorsArgs { + args := new(GetAXNodeAndAncestorsArgs) + + return args +} + +// SetNodeID sets the NodeID optional argument. Identifier of the node +// to get. +func (a *GetAXNodeAndAncestorsArgs) SetNodeID(nodeID dom.NodeID) *GetAXNodeAndAncestorsArgs { + a.NodeID = &nodeID + return a +} + +// SetBackendNodeID sets the BackendNodeID optional argument. +// Identifier of the backend node to get. +func (a *GetAXNodeAndAncestorsArgs) SetBackendNodeID(backendNodeID dom.BackendNodeID) *GetAXNodeAndAncestorsArgs { + a.BackendNodeID = &backendNodeID + return a +} + +// SetObjectID sets the ObjectID optional argument. JavaScript object +// id of the node wrapper to get. +func (a *GetAXNodeAndAncestorsArgs) SetObjectID(objectID runtime.RemoteObjectID) *GetAXNodeAndAncestorsArgs { + a.ObjectID = &objectID + return a +} + +// GetAXNodeAndAncestorsReply represents the return values for GetAXNodeAndAncestors in the Accessibility domain. +type GetAXNodeAndAncestorsReply struct { + Nodes []AXNode `json:"nodes"` // No description. +} + // GetChildAXNodesArgs represents the arguments for GetChildAXNodes in the Accessibility domain. type GetChildAXNodesArgs struct { - ID AXNodeID `json:"id"` // No description. + ID AXNodeID `json:"id"` // No description. + FrameID *page.FrameID `json:"frameId,omitempty"` // The frame in whose document the node resides. If omitted, the root frame is used. } // NewGetChildAXNodesArgs initializes GetChildAXNodesArgs with the required arguments. @@ -94,6 +169,13 @@ func NewGetChildAXNodesArgs(id AXNodeID) *GetChildAXNodesArgs { return args } +// SetFrameID sets the FrameID optional argument. The frame in whose +// document the node resides. If omitted, the root frame is used. +func (a *GetChildAXNodesArgs) SetFrameID(frameID page.FrameID) *GetChildAXNodesArgs { + a.FrameID = &frameID + return a +} + // GetChildAXNodesReply represents the return values for GetChildAXNodes in the Accessibility domain. type GetChildAXNodesReply struct { Nodes []AXNode `json:"nodes"` // No description. diff --git a/protocol/accessibility/domain.go b/protocol/accessibility/domain.go index d91374c..4671575 100644 --- a/protocol/accessibility/domain.go +++ b/protocol/accessibility/domain.go @@ -71,6 +71,37 @@ func (d *domainClient) GetFullAXTree(ctx context.Context, args *GetFullAXTreeArg return } +// GetRootAXNode invokes the Accessibility method. Fetches the root node. +// Requires `enable()` to have been called previously. +func (d *domainClient) GetRootAXNode(ctx context.Context, args *GetRootAXNodeArgs) (reply *GetRootAXNodeReply, err error) { + reply = new(GetRootAXNodeReply) + if args != nil { + err = rpcc.Invoke(ctx, "Accessibility.getRootAXNode", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "Accessibility.getRootAXNode", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Accessibility", Op: "GetRootAXNode", Err: err} + } + return +} + +// GetAXNodeAndAncestors invokes the Accessibility method. Fetches a node and +// all ancestors up to and including the root. Requires `enable()` to have been +// called previously. +func (d *domainClient) GetAXNodeAndAncestors(ctx context.Context, args *GetAXNodeAndAncestorsArgs) (reply *GetAXNodeAndAncestorsReply, err error) { + reply = new(GetAXNodeAndAncestorsReply) + if args != nil { + err = rpcc.Invoke(ctx, "Accessibility.getAXNodeAndAncestors", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "Accessibility.getAXNodeAndAncestors", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Accessibility", Op: "GetAXNodeAndAncestors", Err: err} + } + return +} + // GetChildAXNodes invokes the Accessibility method. Fetches a particular // accessibility node by AXNodeId. Requires `enable()` to have been called // previously. @@ -106,3 +137,45 @@ func (d *domainClient) QueryAXTree(ctx context.Context, args *QueryAXTreeArgs) ( } return } + +func (d *domainClient) LoadComplete(ctx context.Context) (LoadCompleteClient, error) { + s, err := rpcc.NewStream(ctx, "Accessibility.loadComplete", d.conn) + if err != nil { + return nil, err + } + return &loadCompleteClient{Stream: s}, nil +} + +type loadCompleteClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *loadCompleteClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *loadCompleteClient) Recv() (*LoadCompleteReply, error) { + event := new(LoadCompleteReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Accessibility", Op: "LoadComplete Recv", Err: err} + } + return event, nil +} + +func (d *domainClient) NodesUpdated(ctx context.Context) (NodesUpdatedClient, error) { + s, err := rpcc.NewStream(ctx, "Accessibility.nodesUpdated", d.conn) + if err != nil { + return nil, err + } + return &nodesUpdatedClient{Stream: s}, nil +} + +type nodesUpdatedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *nodesUpdatedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *nodesUpdatedClient) Recv() (*NodesUpdatedReply, error) { + event := new(NodesUpdatedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Accessibility", Op: "NodesUpdated Recv", Err: err} + } + return event, nil +} diff --git a/protocol/accessibility/event.go b/protocol/accessibility/event.go new file mode 100644 index 0000000..5cd9f00 --- /dev/null +++ b/protocol/accessibility/event.go @@ -0,0 +1,37 @@ +// Code generated by cdpgen. DO NOT EDIT. + +package accessibility + +import ( + "github.com/mafredri/cdp/rpcc" +) + +// LoadCompleteClient is a client for LoadComplete events. The loadComplete +// event mirrors the load complete event sent by the browser to assistive +// technology when the web page has finished loading. +type LoadCompleteClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*LoadCompleteReply, error) + rpcc.Stream +} + +// LoadCompleteReply is the reply for LoadComplete events. +type LoadCompleteReply struct { + Root AXNode `json:"root"` // New document root node. +} + +// NodesUpdatedClient is a client for NodesUpdated events. The nodesUpdated +// event is sent every time a previously requested node has changed the in +// tree. +type NodesUpdatedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*NodesUpdatedReply, error) + rpcc.Stream +} + +// NodesUpdatedReply is the reply for NodesUpdated events. +type NodesUpdatedReply struct { + Nodes []AXNode `json:"nodes"` // Updated node data. +} diff --git a/protocol/accessibility/types.go b/protocol/accessibility/types.go index 2f42d0d..6b0b923 100644 --- a/protocol/accessibility/types.go +++ b/protocol/accessibility/types.go @@ -6,6 +6,7 @@ import ( "encoding/json" "github.com/mafredri/cdp/protocol/dom" + "github.com/mafredri/cdp/protocol/page" ) // AXNodeID Unique accessibility node identifier. @@ -83,6 +84,7 @@ type AXValueNativeSourceType string // AXValueNativeSourceType as enums. const ( AXValueNativeSourceTypeNotSet AXValueNativeSourceType = "" + AXValueNativeSourceTypeDescription AXValueNativeSourceType = "description" AXValueNativeSourceTypeFigcaption AXValueNativeSourceType = "figcaption" AXValueNativeSourceTypeLabel AXValueNativeSourceType = "label" AXValueNativeSourceTypeLabelfor AXValueNativeSourceType = "labelfor" @@ -96,7 +98,7 @@ const ( func (e AXValueNativeSourceType) Valid() bool { switch e { - case "figcaption", "label", "labelfor", "labelwrapped", "legend", "rubyannotation", "tablecaption", "title", "other": + case "description", "figcaption", "label", "labelfor", "labelwrapped", "legend", "rubyannotation", "tablecaption", "title", "other": return true default: return false @@ -217,6 +219,8 @@ type AXNode struct { Description *AXValue `json:"description,omitempty"` // The accessible description for this `Node`. Value *AXValue `json:"value,omitempty"` // The value for this `Node`. Properties []AXProperty `json:"properties,omitempty"` // All other properties + ParentID *AXNodeID `json:"parentId,omitempty"` // ID for this node's parent. ChildIDs []AXNodeID `json:"childIds,omitempty"` // IDs for each of this node's child nodes. BackendDOMNodeID *dom.BackendNodeID `json:"backendDOMNodeId,omitempty"` // The backend ID for the associated DOM node, if any. + FrameID *page.FrameID `json:"frameId,omitempty"` // The frame ID for the frame associated with this nodes document. } diff --git a/protocol/audits/types.go b/protocol/audits/types.go index 46bc38f..e9d67db 100644 --- a/protocol/audits/types.go +++ b/protocol/audits/types.go @@ -29,72 +29,74 @@ type AffectedFrame struct { FrameID page.FrameID `json:"frameId"` // No description. } -// SameSiteCookieExclusionReason -type SameSiteCookieExclusionReason string +// CookieExclusionReason +type CookieExclusionReason string -// SameSiteCookieExclusionReason as enums. +// CookieExclusionReason as enums. const ( - SameSiteCookieExclusionReasonNotSet SameSiteCookieExclusionReason = "" - SameSiteCookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax SameSiteCookieExclusionReason = "ExcludeSameSiteUnspecifiedTreatedAsLax" - SameSiteCookieExclusionReasonExcludeSameSiteNoneInsecure SameSiteCookieExclusionReason = "ExcludeSameSiteNoneInsecure" - SameSiteCookieExclusionReasonExcludeSameSiteLax SameSiteCookieExclusionReason = "ExcludeSameSiteLax" - SameSiteCookieExclusionReasonExcludeSameSiteStrict SameSiteCookieExclusionReason = "ExcludeSameSiteStrict" - SameSiteCookieExclusionReasonExcludeInvalidSameParty SameSiteCookieExclusionReason = "ExcludeInvalidSameParty" + CookieExclusionReasonNotSet CookieExclusionReason = "" + CookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax CookieExclusionReason = "ExcludeSameSiteUnspecifiedTreatedAsLax" + CookieExclusionReasonExcludeSameSiteNoneInsecure CookieExclusionReason = "ExcludeSameSiteNoneInsecure" + CookieExclusionReasonExcludeSameSiteLax CookieExclusionReason = "ExcludeSameSiteLax" + CookieExclusionReasonExcludeSameSiteStrict CookieExclusionReason = "ExcludeSameSiteStrict" + CookieExclusionReasonExcludeInvalidSameParty CookieExclusionReason = "ExcludeInvalidSameParty" + CookieExclusionReasonExcludeSamePartyCrossPartyContext CookieExclusionReason = "ExcludeSamePartyCrossPartyContext" ) -func (e SameSiteCookieExclusionReason) Valid() bool { +func (e CookieExclusionReason) Valid() bool { switch e { - case "ExcludeSameSiteUnspecifiedTreatedAsLax", "ExcludeSameSiteNoneInsecure", "ExcludeSameSiteLax", "ExcludeSameSiteStrict", "ExcludeInvalidSameParty": + case "ExcludeSameSiteUnspecifiedTreatedAsLax", "ExcludeSameSiteNoneInsecure", "ExcludeSameSiteLax", "ExcludeSameSiteStrict", "ExcludeInvalidSameParty", "ExcludeSamePartyCrossPartyContext": return true default: return false } } -func (e SameSiteCookieExclusionReason) String() string { +func (e CookieExclusionReason) String() string { return string(e) } -// SameSiteCookieWarningReason -type SameSiteCookieWarningReason string +// CookieWarningReason +type CookieWarningReason string -// SameSiteCookieWarningReason as enums. +// CookieWarningReason as enums. const ( - SameSiteCookieWarningReasonNotSet SameSiteCookieWarningReason = "" - SameSiteCookieWarningReasonWarnSameSiteUnspecifiedCrossSiteContext SameSiteCookieWarningReason = "WarnSameSiteUnspecifiedCrossSiteContext" - SameSiteCookieWarningReasonWarnSameSiteNoneInsecure SameSiteCookieWarningReason = "WarnSameSiteNoneInsecure" - SameSiteCookieWarningReasonWarnSameSiteUnspecifiedLaxAllowUnsafe SameSiteCookieWarningReason = "WarnSameSiteUnspecifiedLaxAllowUnsafe" - SameSiteCookieWarningReasonWarnSameSiteStrictLaxDowngradeStrict SameSiteCookieWarningReason = "WarnSameSiteStrictLaxDowngradeStrict" - SameSiteCookieWarningReasonWarnSameSiteStrictCrossDowngradeStrict SameSiteCookieWarningReason = "WarnSameSiteStrictCrossDowngradeStrict" - SameSiteCookieWarningReasonWarnSameSiteStrictCrossDowngradeLax SameSiteCookieWarningReason = "WarnSameSiteStrictCrossDowngradeLax" - SameSiteCookieWarningReasonWarnSameSiteLaxCrossDowngradeStrict SameSiteCookieWarningReason = "WarnSameSiteLaxCrossDowngradeStrict" - SameSiteCookieWarningReasonWarnSameSiteLaxCrossDowngradeLax SameSiteCookieWarningReason = "WarnSameSiteLaxCrossDowngradeLax" + CookieWarningReasonNotSet CookieWarningReason = "" + CookieWarningReasonWarnSameSiteUnspecifiedCrossSiteContext CookieWarningReason = "WarnSameSiteUnspecifiedCrossSiteContext" + CookieWarningReasonWarnSameSiteNoneInsecure CookieWarningReason = "WarnSameSiteNoneInsecure" + CookieWarningReasonWarnSameSiteUnspecifiedLaxAllowUnsafe CookieWarningReason = "WarnSameSiteUnspecifiedLaxAllowUnsafe" + CookieWarningReasonWarnSameSiteStrictLaxDowngradeStrict CookieWarningReason = "WarnSameSiteStrictLaxDowngradeStrict" + CookieWarningReasonWarnSameSiteStrictCrossDowngradeStrict CookieWarningReason = "WarnSameSiteStrictCrossDowngradeStrict" + CookieWarningReasonWarnSameSiteStrictCrossDowngradeLax CookieWarningReason = "WarnSameSiteStrictCrossDowngradeLax" + CookieWarningReasonWarnSameSiteLaxCrossDowngradeStrict CookieWarningReason = "WarnSameSiteLaxCrossDowngradeStrict" + CookieWarningReasonWarnSameSiteLaxCrossDowngradeLax CookieWarningReason = "WarnSameSiteLaxCrossDowngradeLax" + CookieWarningReasonWarnAttributeValueExceedsMaxSize CookieWarningReason = "WarnAttributeValueExceedsMaxSize" ) -func (e SameSiteCookieWarningReason) Valid() bool { +func (e CookieWarningReason) Valid() bool { switch e { - case "WarnSameSiteUnspecifiedCrossSiteContext", "WarnSameSiteNoneInsecure", "WarnSameSiteUnspecifiedLaxAllowUnsafe", "WarnSameSiteStrictLaxDowngradeStrict", "WarnSameSiteStrictCrossDowngradeStrict", "WarnSameSiteStrictCrossDowngradeLax", "WarnSameSiteLaxCrossDowngradeStrict", "WarnSameSiteLaxCrossDowngradeLax": + case "WarnSameSiteUnspecifiedCrossSiteContext", "WarnSameSiteNoneInsecure", "WarnSameSiteUnspecifiedLaxAllowUnsafe", "WarnSameSiteStrictLaxDowngradeStrict", "WarnSameSiteStrictCrossDowngradeStrict", "WarnSameSiteStrictCrossDowngradeLax", "WarnSameSiteLaxCrossDowngradeStrict", "WarnSameSiteLaxCrossDowngradeLax", "WarnAttributeValueExceedsMaxSize": return true default: return false } } -func (e SameSiteCookieWarningReason) String() string { +func (e CookieWarningReason) String() string { return string(e) } -// SameSiteCookieOperation -type SameSiteCookieOperation string +// CookieOperation +type CookieOperation string -// SameSiteCookieOperation as enums. +// CookieOperation as enums. const ( - SameSiteCookieOperationNotSet SameSiteCookieOperation = "" - SameSiteCookieOperationSetCookie SameSiteCookieOperation = "SetCookie" - SameSiteCookieOperationReadCookie SameSiteCookieOperation = "ReadCookie" + CookieOperationNotSet CookieOperation = "" + CookieOperationSetCookie CookieOperation = "SetCookie" + CookieOperationReadCookie CookieOperation = "ReadCookie" ) -func (e SameSiteCookieOperation) Valid() bool { +func (e CookieOperation) Valid() bool { switch e { case "SetCookie", "ReadCookie": return true @@ -103,22 +105,22 @@ func (e SameSiteCookieOperation) Valid() bool { } } -func (e SameSiteCookieOperation) String() string { +func (e CookieOperation) String() string { return string(e) } -// SameSiteCookieIssueDetails This information is currently necessary, as the +// CookieIssueDetails This information is currently necessary, as the // 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,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. - SiteForCookies *string `json:"siteForCookies,omitempty"` // No description. - CookieURL *string `json:"cookieUrl,omitempty"` // No description. - Request *AffectedRequest `json:"request,omitempty"` // No description. +type CookieIssueDetails struct { + 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 []CookieWarningReason `json:"cookieWarningReasons"` // No description. + CookieExclusionReasons []CookieExclusionReason `json:"cookieExclusionReasons"` // No description. + Operation CookieOperation `json:"operation"` // Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context. + SiteForCookies *string `json:"siteForCookies,omitempty"` // No description. + CookieURL *string `json:"cookieUrl,omitempty"` // No description. + Request *AffectedRequest `json:"request,omitempty"` // No description. } // MixedContentResolutionStatus @@ -151,6 +153,7 @@ type MixedContentResourceType string // MixedContentResourceType as enums. const ( MixedContentResourceTypeNotSet MixedContentResourceType = "" + MixedContentResourceTypeAttributionSrc MixedContentResourceType = "AttributionSrc" MixedContentResourceTypeAudio MixedContentResourceType = "Audio" MixedContentResourceTypeBeacon MixedContentResourceType = "Beacon" MixedContentResourceTypeCSPReport MixedContentResourceType = "CSPReport" @@ -181,7 +184,7 @@ const ( func (e MixedContentResourceType) Valid() bool { switch e { - case "Audio", "Beacon", "CSPReport", "Download", "EventSource", "Favicon", "Font", "Form", "Frame", "Image", "Import", "Manifest", "Ping", "PluginData", "PluginResource", "Prefetch", "Resource", "Script", "ServiceWorker", "SharedWorker", "Stylesheet", "Track", "Video", "Worker", "XMLHttpRequest", "XSLT": + case "AttributionSrc", "Audio", "Beacon", "CSPReport", "Download", "EventSource", "Favicon", "Font", "Form", "Frame", "Image", "Import", "Manifest", "Ping", "PluginData", "PluginResource", "Prefetch", "Resource", "Script", "ServiceWorker", "SharedWorker", "Stylesheet", "Track", "Video", "Worker", "XMLHttpRequest", "XSLT": return true default: return false @@ -304,11 +307,12 @@ const ( ContentSecurityPolicyViolationTypeKURLViolation ContentSecurityPolicyViolationType = "kURLViolation" ContentSecurityPolicyViolationTypeKTrustedTypesSinkViolation ContentSecurityPolicyViolationType = "kTrustedTypesSinkViolation" ContentSecurityPolicyViolationTypeKTrustedTypesPolicyViolation ContentSecurityPolicyViolationType = "kTrustedTypesPolicyViolation" + ContentSecurityPolicyViolationTypeKWasmEvalViolation ContentSecurityPolicyViolationType = "kWasmEvalViolation" ) func (e ContentSecurityPolicyViolationType) Valid() bool { switch e { - case "kInlineViolation", "kEvalViolation", "kURLViolation", "kTrustedTypesSinkViolation", "kTrustedTypesPolicyViolation": + case "kInlineViolation", "kEvalViolation", "kURLViolation", "kTrustedTypesSinkViolation", "kTrustedTypesPolicyViolation", "kWasmEvalViolation": return true default: return false @@ -433,15 +437,14 @@ type AttributionReportingIssueType string const ( AttributionReportingIssueTypeNotSet AttributionReportingIssueType = "" AttributionReportingIssueTypePermissionPolicyDisabled AttributionReportingIssueType = "PermissionPolicyDisabled" - AttributionReportingIssueTypeInvalidAttributionSourceEventID AttributionReportingIssueType = "InvalidAttributionSourceEventId" - AttributionReportingIssueTypeInvalidAttributionData AttributionReportingIssueType = "InvalidAttributionData" AttributionReportingIssueTypeAttributionSourceUntrustworthyOrigin AttributionReportingIssueType = "AttributionSourceUntrustworthyOrigin" AttributionReportingIssueTypeAttributionUntrustworthyOrigin AttributionReportingIssueType = "AttributionUntrustworthyOrigin" + AttributionReportingIssueTypeInvalidHeader AttributionReportingIssueType = "InvalidHeader" ) func (e AttributionReportingIssueType) Valid() bool { switch e { - case "PermissionPolicyDisabled", "InvalidAttributionSourceEventId", "InvalidAttributionData", "AttributionSourceUntrustworthyOrigin", "AttributionUntrustworthyOrigin": + case "PermissionPolicyDisabled", "AttributionSourceUntrustworthyOrigin", "AttributionUntrustworthyOrigin", "InvalidHeader": return true default: return false @@ -479,12 +482,204 @@ type NavigatorUserAgentIssueDetails struct { 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. +// GenericIssueErrorType +type GenericIssueErrorType string + +// GenericIssueErrorType as enums. +const ( + GenericIssueErrorTypeNotSet GenericIssueErrorType = "" + GenericIssueErrorTypeCrossOriginPortalPostMessageError GenericIssueErrorType = "CrossOriginPortalPostMessageError" +) + +func (e GenericIssueErrorType) Valid() bool { + switch e { + case "CrossOriginPortalPostMessageError": + return true + default: + return false + } +} + +func (e GenericIssueErrorType) String() string { + return string(e) +} + +// GenericIssueDetails Depending on the concrete errorType, different +// properties are set. +type GenericIssueDetails struct { + ErrorType GenericIssueErrorType `json:"errorType"` // Issues with the same errorType are aggregated in the frontend. + FrameID *page.FrameID `json:"frameId,omitempty"` // No description. +} + +// DeprecationIssueType +type DeprecationIssueType string + +// DeprecationIssueType as enums. +const ( + DeprecationIssueTypeNotSet DeprecationIssueType = "" + DeprecationIssueTypeAuthorizationCoveredByWildcard DeprecationIssueType = "AuthorizationCoveredByWildcard" + DeprecationIssueTypeCanRequestURLHTTPContainingNewline DeprecationIssueType = "CanRequestURLHTTPContainingNewline" + DeprecationIssueTypeChromeLoadTimesConnectionInfo DeprecationIssueType = "ChromeLoadTimesConnectionInfo" + DeprecationIssueTypeChromeLoadTimesFirstPaintAfterLoadTime DeprecationIssueType = "ChromeLoadTimesFirstPaintAfterLoadTime" + DeprecationIssueTypeChromeLoadTimesWasAlternateProtocolAvailable DeprecationIssueType = "ChromeLoadTimesWasAlternateProtocolAvailable" + DeprecationIssueTypeCookieWithTruncatingChar DeprecationIssueType = "CookieWithTruncatingChar" + DeprecationIssueTypeCrossOriginAccessBasedOnDocumentDomain DeprecationIssueType = "CrossOriginAccessBasedOnDocumentDomain" + DeprecationIssueTypeCrossOriginWindowAlert DeprecationIssueType = "CrossOriginWindowAlert" + DeprecationIssueTypeCrossOriginWindowConfirm DeprecationIssueType = "CrossOriginWindowConfirm" + DeprecationIssueTypeCSSSelectorInternalMediaControlsOverlayCastButton DeprecationIssueType = "CSSSelectorInternalMediaControlsOverlayCastButton" + DeprecationIssueTypeCustomCursorIntersectsViewport DeprecationIssueType = "CustomCursorIntersectsViewport" + DeprecationIssueTypeDeprecationExample DeprecationIssueType = "DeprecationExample" + DeprecationIssueTypeDocumentDomainSettingWithoutOriginAgentClusterHeader DeprecationIssueType = "DocumentDomainSettingWithoutOriginAgentClusterHeader" + DeprecationIssueTypeEventPath DeprecationIssueType = "EventPath" + DeprecationIssueTypeGeolocationInsecureOrigin DeprecationIssueType = "GeolocationInsecureOrigin" + DeprecationIssueTypeGeolocationInsecureOriginDeprecatedNotRemoved DeprecationIssueType = "GeolocationInsecureOriginDeprecatedNotRemoved" + DeprecationIssueTypeGetUserMediaInsecureOrigin DeprecationIssueType = "GetUserMediaInsecureOrigin" + DeprecationIssueTypeHostCandidateAttributeGetter DeprecationIssueType = "HostCandidateAttributeGetter" + DeprecationIssueTypeInsecurePrivateNetworkSubresourceRequest DeprecationIssueType = "InsecurePrivateNetworkSubresourceRequest" + DeprecationIssueTypeLegacyConstraintGoogIPv6 DeprecationIssueType = "LegacyConstraintGoogIPv6" + DeprecationIssueTypeLocalCSSFileExtensionRejected DeprecationIssueType = "LocalCSSFileExtensionRejected" + DeprecationIssueTypeMediaElementAudioSourceNode DeprecationIssueType = "MediaElementAudioSourceNode" + DeprecationIssueTypeMediaSourceAbortRemove DeprecationIssueType = "MediaSourceAbortRemove" + DeprecationIssueTypeMediaSourceDurationTruncatingBuffered DeprecationIssueType = "MediaSourceDurationTruncatingBuffered" + DeprecationIssueTypeNoSysexWebMIDIWithoutPermission DeprecationIssueType = "NoSysexWebMIDIWithoutPermission" + DeprecationIssueTypeNotificationInsecureOrigin DeprecationIssueType = "NotificationInsecureOrigin" + DeprecationIssueTypeNotificationPermissionRequestedIframe DeprecationIssueType = "NotificationPermissionRequestedIframe" + DeprecationIssueTypeObsoleteWebRtcCipherSuite DeprecationIssueType = "ObsoleteWebRtcCipherSuite" + DeprecationIssueTypePaymentRequestBasicCard DeprecationIssueType = "PaymentRequestBasicCard" + DeprecationIssueTypePaymentRequestShowWithoutGesture DeprecationIssueType = "PaymentRequestShowWithoutGesture" + DeprecationIssueTypePictureSourceSrc DeprecationIssueType = "PictureSourceSrc" + DeprecationIssueTypePrefixedCancelAnimationFrame DeprecationIssueType = "PrefixedCancelAnimationFrame" + DeprecationIssueTypePrefixedRequestAnimationFrame DeprecationIssueType = "PrefixedRequestAnimationFrame" + DeprecationIssueTypePrefixedStorageInfo DeprecationIssueType = "PrefixedStorageInfo" + DeprecationIssueTypePrefixedVideoDisplayingFullscreen DeprecationIssueType = "PrefixedVideoDisplayingFullscreen" + DeprecationIssueTypePrefixedVideoEnterFullscreen DeprecationIssueType = "PrefixedVideoEnterFullscreen" + DeprecationIssueTypePrefixedVideoEnterFullScreen DeprecationIssueType = "PrefixedVideoEnterFullScreen" + DeprecationIssueTypePrefixedVideoExitFullscreen DeprecationIssueType = "PrefixedVideoExitFullscreen" + DeprecationIssueTypePrefixedVideoExitFullScreen DeprecationIssueType = "PrefixedVideoExitFullScreen" + DeprecationIssueTypePrefixedVideoSupportsFullscreen DeprecationIssueType = "PrefixedVideoSupportsFullscreen" + DeprecationIssueTypeRangeExpand DeprecationIssueType = "RangeExpand" + DeprecationIssueTypeRequestedSubresourceWithEmbeddedCredentials DeprecationIssueType = "RequestedSubresourceWithEmbeddedCredentials" + DeprecationIssueTypeRTCConstraintEnableDtlsSrtpFalse DeprecationIssueType = "RTCConstraintEnableDtlsSrtpFalse" + DeprecationIssueTypeRTCConstraintEnableDtlsSrtpTrue DeprecationIssueType = "RTCConstraintEnableDtlsSrtpTrue" + DeprecationIssueTypeRTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics DeprecationIssueType = "RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics" + DeprecationIssueTypeRTCPeerConnectionSdpSemanticsPlanB DeprecationIssueType = "RTCPeerConnectionSdpSemanticsPlanB" + DeprecationIssueTypeRtcpMuxPolicyNegotiate DeprecationIssueType = "RtcpMuxPolicyNegotiate" + DeprecationIssueTypeRTPDataChannel DeprecationIssueType = "RTPDataChannel" + DeprecationIssueTypeSharedArrayBufferConstructedWithoutIsolation DeprecationIssueType = "SharedArrayBufferConstructedWithoutIsolation" + DeprecationIssueTypeTextToSpeechDisallowedByAutoplay DeprecationIssueType = "TextToSpeech_DisallowedByAutoplay" + DeprecationIssueTypeV8SharedArrayBufferConstructedInExtensionWithoutIsolation DeprecationIssueType = "V8SharedArrayBufferConstructedInExtensionWithoutIsolation" + DeprecationIssueTypeXHRJSONEncodingDetection DeprecationIssueType = "XHRJSONEncodingDetection" + DeprecationIssueTypeXMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload DeprecationIssueType = "XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload" + DeprecationIssueTypeXRSupportsSession DeprecationIssueType = "XRSupportsSession" +) + +func (e DeprecationIssueType) Valid() bool { + switch e { + case "AuthorizationCoveredByWildcard", "CanRequestURLHTTPContainingNewline", "ChromeLoadTimesConnectionInfo", "ChromeLoadTimesFirstPaintAfterLoadTime", "ChromeLoadTimesWasAlternateProtocolAvailable", "CookieWithTruncatingChar", "CrossOriginAccessBasedOnDocumentDomain", "CrossOriginWindowAlert", "CrossOriginWindowConfirm", "CSSSelectorInternalMediaControlsOverlayCastButton", "CustomCursorIntersectsViewport", "DeprecationExample", "DocumentDomainSettingWithoutOriginAgentClusterHeader", "EventPath", "GeolocationInsecureOrigin", "GeolocationInsecureOriginDeprecatedNotRemoved", "GetUserMediaInsecureOrigin", "HostCandidateAttributeGetter", "InsecurePrivateNetworkSubresourceRequest", "LegacyConstraintGoogIPv6", "LocalCSSFileExtensionRejected", "MediaElementAudioSourceNode", "MediaSourceAbortRemove", "MediaSourceDurationTruncatingBuffered", "NoSysexWebMIDIWithoutPermission", "NotificationInsecureOrigin", "NotificationPermissionRequestedIframe", "ObsoleteWebRtcCipherSuite", "PaymentRequestBasicCard", "PaymentRequestShowWithoutGesture", "PictureSourceSrc", "PrefixedCancelAnimationFrame", "PrefixedRequestAnimationFrame", "PrefixedStorageInfo", "PrefixedVideoDisplayingFullscreen", "PrefixedVideoEnterFullscreen", "PrefixedVideoEnterFullScreen", "PrefixedVideoExitFullscreen", "PrefixedVideoExitFullScreen", "PrefixedVideoSupportsFullscreen", "RangeExpand", "RequestedSubresourceWithEmbeddedCredentials", "RTCConstraintEnableDtlsSrtpFalse", "RTCConstraintEnableDtlsSrtpTrue", "RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics", "RTCPeerConnectionSdpSemanticsPlanB", "RtcpMuxPolicyNegotiate", "RTPDataChannel", "SharedArrayBufferConstructedWithoutIsolation", "TextToSpeech_DisallowedByAutoplay", "V8SharedArrayBufferConstructedInExtensionWithoutIsolation", "XHRJSONEncodingDetection", "XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload", "XRSupportsSession": + return true + default: + return false + } +} + +func (e DeprecationIssueType) String() string { + return string(e) +} + +// DeprecationIssueDetails This issue tracks information needed to print a +// deprecation message. +// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md +type DeprecationIssueDetails struct { + AffectedFrame *AffectedFrame `json:"affectedFrame,omitempty"` // No description. + SourceCodeLocation SourceCodeLocation `json:"sourceCodeLocation"` // No description. + Type DeprecationIssueType `json:"type"` // No description. +} + +// ClientHintIssueReason +type ClientHintIssueReason string + +// ClientHintIssueReason as enums. +const ( + ClientHintIssueReasonNotSet ClientHintIssueReason = "" + ClientHintIssueReasonMetaTagAllowListInvalidOrigin ClientHintIssueReason = "MetaTagAllowListInvalidOrigin" + ClientHintIssueReasonMetaTagModifiedHTML ClientHintIssueReason = "MetaTagModifiedHTML" +) + +func (e ClientHintIssueReason) Valid() bool { + switch e { + case "MetaTagAllowListInvalidOrigin", "MetaTagModifiedHTML": + return true + default: + return false + } +} + +func (e ClientHintIssueReason) String() string { + return string(e) +} + +// FederatedAuthRequestIssueDetails +type FederatedAuthRequestIssueDetails struct { + FederatedAuthRequestIssueReason FederatedAuthRequestIssueReason `json:"federatedAuthRequestIssueReason"` // No description. +} + +// FederatedAuthRequestIssueReason Represents the failure reason when a +// federated authentication reason fails. Should be updated alongside +// RequestIdTokenStatus in +// third_party/blink/public/mojom/devtools/inspector_issue.mojom to include all +// cases except for success. +type FederatedAuthRequestIssueReason string + +// FederatedAuthRequestIssueReason as enums. +const ( + FederatedAuthRequestIssueReasonNotSet FederatedAuthRequestIssueReason = "" + FederatedAuthRequestIssueReasonApprovalDeclined FederatedAuthRequestIssueReason = "ApprovalDeclined" + FederatedAuthRequestIssueReasonTooManyRequests FederatedAuthRequestIssueReason = "TooManyRequests" + FederatedAuthRequestIssueReasonManifestListHTTPNotFound FederatedAuthRequestIssueReason = "ManifestListHttpNotFound" + FederatedAuthRequestIssueReasonManifestListNoResponse FederatedAuthRequestIssueReason = "ManifestListNoResponse" + FederatedAuthRequestIssueReasonManifestListInvalidResponse FederatedAuthRequestIssueReason = "ManifestListInvalidResponse" + FederatedAuthRequestIssueReasonManifestNotInManifestList FederatedAuthRequestIssueReason = "ManifestNotInManifestList" + FederatedAuthRequestIssueReasonManifestListTooBig FederatedAuthRequestIssueReason = "ManifestListTooBig" + FederatedAuthRequestIssueReasonManifestHTTPNotFound FederatedAuthRequestIssueReason = "ManifestHttpNotFound" + FederatedAuthRequestIssueReasonManifestNoResponse FederatedAuthRequestIssueReason = "ManifestNoResponse" + FederatedAuthRequestIssueReasonManifestInvalidResponse FederatedAuthRequestIssueReason = "ManifestInvalidResponse" + FederatedAuthRequestIssueReasonClientMetadataHTTPNotFound FederatedAuthRequestIssueReason = "ClientMetadataHttpNotFound" + FederatedAuthRequestIssueReasonClientMetadataNoResponse FederatedAuthRequestIssueReason = "ClientMetadataNoResponse" + FederatedAuthRequestIssueReasonClientMetadataInvalidResponse FederatedAuthRequestIssueReason = "ClientMetadataInvalidResponse" + FederatedAuthRequestIssueReasonClientMetadataMissingPrivacyPolicyURL FederatedAuthRequestIssueReason = "ClientMetadataMissingPrivacyPolicyUrl" + FederatedAuthRequestIssueReasonDisabledInSettings FederatedAuthRequestIssueReason = "DisabledInSettings" + FederatedAuthRequestIssueReasonErrorFetchingSignin FederatedAuthRequestIssueReason = "ErrorFetchingSignin" + FederatedAuthRequestIssueReasonInvalidSigninResponse FederatedAuthRequestIssueReason = "InvalidSigninResponse" + FederatedAuthRequestIssueReasonAccountsHTTPNotFound FederatedAuthRequestIssueReason = "AccountsHttpNotFound" + FederatedAuthRequestIssueReasonAccountsNoResponse FederatedAuthRequestIssueReason = "AccountsNoResponse" + FederatedAuthRequestIssueReasonAccountsInvalidResponse FederatedAuthRequestIssueReason = "AccountsInvalidResponse" + FederatedAuthRequestIssueReasonIDTokenHTTPNotFound FederatedAuthRequestIssueReason = "IdTokenHttpNotFound" + FederatedAuthRequestIssueReasonIDTokenNoResponse FederatedAuthRequestIssueReason = "IdTokenNoResponse" + FederatedAuthRequestIssueReasonIDTokenInvalidResponse FederatedAuthRequestIssueReason = "IdTokenInvalidResponse" + FederatedAuthRequestIssueReasonIDTokenInvalidRequest FederatedAuthRequestIssueReason = "IdTokenInvalidRequest" + FederatedAuthRequestIssueReasonErrorIDToken FederatedAuthRequestIssueReason = "ErrorIdToken" + FederatedAuthRequestIssueReasonCanceled FederatedAuthRequestIssueReason = "Canceled" +) + +func (e FederatedAuthRequestIssueReason) Valid() bool { + switch e { + case "ApprovalDeclined", "TooManyRequests", "ManifestListHttpNotFound", "ManifestListNoResponse", "ManifestListInvalidResponse", "ManifestNotInManifestList", "ManifestListTooBig", "ManifestHttpNotFound", "ManifestNoResponse", "ManifestInvalidResponse", "ClientMetadataHttpNotFound", "ClientMetadataNoResponse", "ClientMetadataInvalidResponse", "ClientMetadataMissingPrivacyPolicyUrl", "DisabledInSettings", "ErrorFetchingSignin", "InvalidSigninResponse", "AccountsHttpNotFound", "AccountsNoResponse", "AccountsInvalidResponse", "IdTokenHttpNotFound", "IdTokenNoResponse", "IdTokenInvalidResponse", "IdTokenInvalidRequest", "ErrorIdToken", "Canceled": + return true + default: + return false + } +} + +func (e FederatedAuthRequestIssueReason) String() string { + return string(e) +} + +// ClientHintIssueDetails This issue tracks client hints related issues. It's +// used to deprecate old features, encourage the use of new ones, and provide +// general guidance. +type ClientHintIssueDetails struct { + SourceCodeLocation SourceCodeLocation `json:"sourceCodeLocation"` // No description. + ClientHintIssueReason ClientHintIssueReason `json:"clientHintIssueReason"` // No description. } // InspectorIssueCode A unique identifier for the type of issue. Each type may @@ -494,25 +689,28 @@ 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" - InspectorIssueCodeAttributionReportingIssue InspectorIssueCode = "AttributionReportingIssue" - InspectorIssueCodeQuirksModeIssue InspectorIssueCode = "QuirksModeIssue" - InspectorIssueCodeNavigatorUserAgentIssue InspectorIssueCode = "NavigatorUserAgentIssue" - InspectorIssueCodeWASMCrossOriginModuleSharingIssue InspectorIssueCode = "WasmCrossOriginModuleSharingIssue" + InspectorIssueCodeNotSet InspectorIssueCode = "" + InspectorIssueCodeCookieIssue InspectorIssueCode = "CookieIssue" + 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" + InspectorIssueCodeGenericIssue InspectorIssueCode = "GenericIssue" + InspectorIssueCodeDeprecationIssue InspectorIssueCode = "DeprecationIssue" + InspectorIssueCodeClientHintIssue InspectorIssueCode = "ClientHintIssue" + InspectorIssueCodeFederatedAuthRequestIssue InspectorIssueCode = "FederatedAuthRequestIssue" ) func (e InspectorIssueCode) Valid() bool { switch e { - case "SameSiteCookieIssue", "MixedContentIssue", "BlockedByResponseIssue", "HeavyAdIssue", "ContentSecurityPolicyIssue", "SharedArrayBufferIssue", "TrustedWebActivityIssue", "LowTextContrastIssue", "CorsIssue", "AttributionReportingIssue", "QuirksModeIssue", "NavigatorUserAgentIssue", "WasmCrossOriginModuleSharingIssue": + case "CookieIssue", "MixedContentIssue", "BlockedByResponseIssue", "HeavyAdIssue", "ContentSecurityPolicyIssue", "SharedArrayBufferIssue", "TrustedWebActivityIssue", "LowTextContrastIssue", "CorsIssue", "AttributionReportingIssue", "QuirksModeIssue", "NavigatorUserAgentIssue", "GenericIssue", "DeprecationIssue", "ClientHintIssue", "FederatedAuthRequestIssue": return true default: return false @@ -527,19 +725,22 @@ 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. - 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. + CookieIssueDetails *CookieIssueDetails `json:"cookieIssueDetails,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. + GenericIssueDetails *GenericIssueDetails `json:"genericIssueDetails,omitempty"` // No description. + DeprecationIssueDetails *DeprecationIssueDetails `json:"deprecationIssueDetails,omitempty"` // No description. + ClientHintIssueDetails *ClientHintIssueDetails `json:"clientHintIssueDetails,omitempty"` // No description. + FederatedAuthRequestIssueDetails *FederatedAuthRequestIssueDetails `json:"federatedAuthRequestIssueDetails,omitempty"` // No description. } // IssueID A unique id for a DevTools inspector issue. Allows other entities diff --git a/protocol/cast/command.go b/protocol/cast/command.go index afee148..acabd82 100644 --- a/protocol/cast/command.go +++ b/protocol/cast/command.go @@ -32,6 +32,18 @@ func NewSetSinkToUseArgs(sinkName string) *SetSinkToUseArgs { return args } +// StartDesktopMirroringArgs represents the arguments for StartDesktopMirroring in the Cast domain. +type StartDesktopMirroringArgs struct { + SinkName string `json:"sinkName"` // No description. +} + +// NewStartDesktopMirroringArgs initializes StartDesktopMirroringArgs with the required arguments. +func NewStartDesktopMirroringArgs(sinkName string) *StartDesktopMirroringArgs { + args := new(StartDesktopMirroringArgs) + args.SinkName = sinkName + return args +} + // StartTabMirroringArgs represents the arguments for StartTabMirroring in the Cast domain. type StartTabMirroringArgs struct { SinkName string `json:"sinkName"` // No description. diff --git a/protocol/cast/domain.go b/protocol/cast/domain.go index 4ef210f..6164972 100644 --- a/protocol/cast/domain.go +++ b/protocol/cast/domain.go @@ -61,6 +61,20 @@ func (d *domainClient) SetSinkToUse(ctx context.Context, args *SetSinkToUseArgs) return } +// StartDesktopMirroring invokes the Cast method. Starts mirroring the desktop +// to the sink. +func (d *domainClient) StartDesktopMirroring(ctx context.Context, args *StartDesktopMirroringArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Cast.startDesktopMirroring", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Cast.startDesktopMirroring", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Cast", Op: "StartDesktopMirroring", Err: err} + } + return +} + // StartTabMirroring invokes the Cast method. Starts mirroring the tab to the // sink. func (d *domainClient) StartTabMirroring(ctx context.Context, args *StartTabMirroringArgs) (err error) { diff --git a/protocol/css/command.go b/protocol/css/command.go index 4a647bf..2937b56 100644 --- a/protocol/css/command.go +++ b/protocol/css/command.go @@ -144,12 +144,13 @@ func NewGetMatchedStylesForNodeArgs(nodeID dom.NodeID) *GetMatchedStylesForNodeA // GetMatchedStylesForNodeReply represents the return values for GetMatchedStylesForNode in the CSS domain. type GetMatchedStylesForNodeReply struct { - InlineStyle *Style `json:"inlineStyle,omitempty"` // Inline style for the specified DOM node. - AttributesStyle *Style `json:"attributesStyle,omitempty"` // Attribute-defined element style (e.g. resulting from "width=20 height=100%"). - MatchedCSSRules []RuleMatch `json:"matchedCSSRules,omitempty"` // CSS rules matching this node, from all applicable stylesheets. - PseudoElements []PseudoElementMatches `json:"pseudoElements,omitempty"` // Pseudo style matches for this node. - Inherited []InheritedStyleEntry `json:"inherited,omitempty"` // A chain of inherited styles (from the immediate node parent up to the DOM tree root). - CSSKeyframesRules []KeyframesRule `json:"cssKeyframesRules,omitempty"` // A list of CSS keyframed animations matching this node. + InlineStyle *Style `json:"inlineStyle,omitempty"` // Inline style for the specified DOM node. + AttributesStyle *Style `json:"attributesStyle,omitempty"` // Attribute-defined element style (e.g. resulting from "width=20 height=100%"). + MatchedCSSRules []RuleMatch `json:"matchedCSSRules,omitempty"` // CSS rules matching this node, from all applicable stylesheets. + PseudoElements []PseudoElementMatches `json:"pseudoElements,omitempty"` // Pseudo style matches for this node. + Inherited []InheritedStyleEntry `json:"inherited,omitempty"` // A chain of inherited styles (from the immediate node parent up to the DOM tree root). + InheritedPseudoElements []InheritedPseudoElementMatches `json:"inheritedPseudoElements,omitempty"` // A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root). + CSSKeyframesRules []KeyframesRule `json:"cssKeyframesRules,omitempty"` // A list of CSS keyframed animations matching this node. } // GetMediaQueriesReply represents the return values for GetMediaQueries in the CSS domain. @@ -191,6 +192,23 @@ type GetStyleSheetTextReply struct { Text string `json:"text"` // The stylesheet text. } +// GetLayersForNodeArgs represents the arguments for GetLayersForNode in the CSS domain. +type GetLayersForNodeArgs struct { + NodeID dom.NodeID `json:"nodeId"` // No description. +} + +// NewGetLayersForNodeArgs initializes GetLayersForNodeArgs with the required arguments. +func NewGetLayersForNodeArgs(nodeID dom.NodeID) *GetLayersForNodeArgs { + args := new(GetLayersForNodeArgs) + args.NodeID = nodeID + return args +} + +// GetLayersForNodeReply represents the return values for GetLayersForNode in the CSS domain. +type GetLayersForNodeReply struct { + RootLayer LayerData `json:"rootLayer"` // No description. +} + // TrackComputedStyleUpdatesArgs represents the arguments for TrackComputedStyleUpdates in the CSS domain. type TrackComputedStyleUpdatesArgs struct { PropertiesToTrack []ComputedStyleProperty `json:"propertiesToTrack"` // No description. @@ -287,6 +305,27 @@ type SetContainerQueryTextReply struct { ContainerQuery ContainerQuery `json:"containerQuery"` // The resulting CSS container query rule after modification. } +// SetSupportsTextArgs represents the arguments for SetSupportsText in the CSS domain. +type SetSupportsTextArgs struct { + StyleSheetID StyleSheetID `json:"styleSheetId"` // No description. + Range SourceRange `json:"range"` // No description. + Text string `json:"text"` // No description. +} + +// NewSetSupportsTextArgs initializes SetSupportsTextArgs with the required arguments. +func NewSetSupportsTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetSupportsTextArgs { + args := new(SetSupportsTextArgs) + args.StyleSheetID = styleSheetID + args.Range = rang + args.Text = text + return args +} + +// SetSupportsTextReply represents the return values for SetSupportsText in the CSS domain. +type SetSupportsTextReply struct { + Supports Supports `json:"supports"` // The resulting CSS Supports 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 440e114..ce14a09 100644 --- a/protocol/css/domain.go +++ b/protocol/css/domain.go @@ -215,6 +215,24 @@ func (d *domainClient) GetStyleSheetText(ctx context.Context, args *GetStyleShee return } +// GetLayersForNode invokes the CSS method. Returns all layers parsed by the +// rendering engine for the tree scope of a node. Given a DOM element +// identified by nodeId, getLayersForNode returns the root layer for the +// nearest ancestor document or shadow root. The layer root contains the full +// layer tree for the tree scope and their ordering. +func (d *domainClient) GetLayersForNode(ctx context.Context, args *GetLayersForNodeArgs) (reply *GetLayersForNodeReply, err error) { + reply = new(GetLayersForNodeReply) + if args != nil { + err = rpcc.Invoke(ctx, "CSS.getLayersForNode", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "CSS.getLayersForNode", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "CSS", Op: "GetLayersForNode", Err: err} + } + return +} + // TrackComputedStyleUpdates invokes the CSS method. Starts tracking the given // computed styles for updates. The specified array of properties replaces the // one previously specified. Pass empty array to disable tracking. Use @@ -304,6 +322,21 @@ func (d *domainClient) SetContainerQueryText(ctx context.Context, args *SetConta return } +// SetSupportsText invokes the CSS method. Modifies the expression of a +// supports at-rule. +func (d *domainClient) SetSupportsText(ctx context.Context, args *SetSupportsTextArgs) (reply *SetSupportsTextReply, err error) { + reply = new(SetSupportsTextReply) + if args != nil { + err = rpcc.Invoke(ctx, "CSS.setSupportsText", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "CSS.setSupportsText", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "CSS", Op: "SetSupportsText", 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 aabbc93..82f05c7 100644 --- a/protocol/css/types.go +++ b/protocol/css/types.go @@ -50,6 +50,12 @@ type InheritedStyleEntry struct { MatchedCSSRules []RuleMatch `json:"matchedCSSRules"` // Matches of CSS rules matching the ancestor node in the style inheritance chain. } +// InheritedPseudoElementMatches Inherited pseudo element matches from pseudos +// of an ancestor node. +type InheritedPseudoElementMatches struct { + PseudoElements []PseudoElementMatches `json:"pseudoElements"` // Matches of pseudo styles from the pseudos of an ancestor node. +} + // RuleMatch Match data for a CSS rule. type RuleMatch struct { Rule Rule `json:"rule"` // CSS rule in the match. @@ -103,6 +109,17 @@ type Rule struct { // // Note: This property is experimental. ContainerQueries []ContainerQuery `json:"containerQueries,omitempty"` + // Supports @supports CSS at-rule array. The array enumerates + // @supports at-rules starting with the innermost one, going outwards. + // + // Note: This property is experimental. + Supports []Supports `json:"supports,omitempty"` + // Layers Cascade layer array. Contains the layer hierarchy that this + // rule belongs to starting with the innermost layer and going + // outwards. + // + // Note: This property is experimental. + Layers []Layer `json:"layers,omitempty"` } // RuleUsage CSS coverage information. @@ -197,6 +214,34 @@ type ContainerQuery struct { Name *string `json:"name,omitempty"` // Optional name for the container. } +// Supports CSS Supports at-rule descriptor. +// +// Note: This type is experimental. +type Supports struct { + Text string `json:"text"` // Supports rule text. + Active bool `json:"active"` // Whether the supports condition is satisfied. + 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). +} + +// Layer CSS Layer at-rule descriptor. +// +// Note: This type is experimental. +type Layer struct { + Text string `json:"text"` // Layer name. + 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). +} + +// LayerData CSS Layer data. +// +// Note: This type is experimental. +type LayerData struct { + Name string `json:"name"` // Layer name. + SubLayers []LayerData `json:"subLayers,omitempty"` // Direct sub-layers + Order float64 `json:"order"` // Layer order. The order determines the order of the layer in the cascade order. A higher number has higher priority in the cascade order. +} + // PlatformFontUsage Information about amount of glyphs that were rendered // with given font. type PlatformFontUsage struct { diff --git a/protocol/debugger/event.go b/protocol/debugger/event.go index 687fea9..14e5a88 100644 --- a/protocol/debugger/event.go +++ b/protocol/debugger/event.go @@ -86,7 +86,7 @@ type ScriptFailedToParseReply struct { EndLine int `json:"endLine"` // Last line of the script. EndColumn int `json:"endColumn"` // Length of the last line of the script. ExecutionContextID runtime.ExecutionContextID `json:"executionContextId"` // Specifies script creation context. - Hash string `json:"hash"` // Content hash of the script. + Hash string `json:"hash"` // Content hash of the script, SHA-256. ExecutionContextAuxData json.RawMessage `json:"executionContextAuxData,omitempty"` // Embedder-specific auxiliary data. SourceMapURL *string `json:"sourceMapURL,omitempty"` // URL of source map associated with script (if any). HasSourceURL *bool `json:"hasSourceURL,omitempty"` // True, if this script has sourceURL. @@ -131,7 +131,7 @@ type ScriptParsedReply struct { EndLine int `json:"endLine"` // Last line of the script. EndColumn int `json:"endColumn"` // Length of the last line of the script. ExecutionContextID runtime.ExecutionContextID `json:"executionContextId"` // Specifies script creation context. - Hash string `json:"hash"` // Content hash of the script. + Hash string `json:"hash"` // Content hash of the script, SHA-256. ExecutionContextAuxData json.RawMessage `json:"executionContextAuxData,omitempty"` // Embedder-specific auxiliary data. // IsLiveEdit True, if this script is generated as a result of the // live edit operation. diff --git a/protocol/debugger/types.go b/protocol/debugger/types.go index e5a950d..a60317a 100644 --- a/protocol/debugger/types.go +++ b/protocol/debugger/types.go @@ -38,14 +38,26 @@ type LocationRange struct { // CallFrame JavaScript call frame. Array of call frames form the call stack. type CallFrame struct { - CallFrameID CallFrameID `json:"callFrameId"` // Call frame identifier. This identifier is only valid while the virtual machine is paused. - FunctionName string `json:"functionName"` // Name of the JavaScript function called on this call frame. - FunctionLocation *Location `json:"functionLocation,omitempty"` // Location in the source code. - Location Location `json:"location"` // Location in the source code. - URL string `json:"url"` // JavaScript script name or url. - ScopeChain []Scope `json:"scopeChain"` // Scope chain for this call frame. - This runtime.RemoteObject `json:"this"` // `this` object for this call frame. - ReturnValue *runtime.RemoteObject `json:"returnValue,omitempty"` // The value being returned, if the function is at return point. + CallFrameID CallFrameID `json:"callFrameId"` // Call frame identifier. This identifier is only valid while the virtual machine is paused. + FunctionName string `json:"functionName"` // Name of the JavaScript function called on this call frame. + FunctionLocation *Location `json:"functionLocation,omitempty"` // Location in the source code. + Location Location `json:"location"` // Location in the source code. + // URL is deprecated. + // + // Deprecated: JavaScript script name or url. Deprecated in favor of + // using the `location.scriptId` to resolve the URL via a previously + // sent `Debugger.scriptParsed` event. + URL string `json:"url"` + ScopeChain []Scope `json:"scopeChain"` // Scope chain for this call frame. + This runtime.RemoteObject `json:"this"` // `this` object for this call frame. + ReturnValue *runtime.RemoteObject `json:"returnValue,omitempty"` // The value being returned, if the function is at return point. + // CanBeRestarted Valid only while the VM is paused and indicates + // whether this frame can be restarted or not. Note that a `true` value + // here does not guarantee that Debugger#restartFrame with this + // CallFrameId will be successful, but it is very likely. + // + // Note: This property is experimental. + CanBeRestarted *bool `json:"canBeRestarted,omitempty"` } // Scope Scope description. diff --git a/protocol/dom/command.go b/protocol/dom/command.go index 314a3b2..8f56d0e 100644 --- a/protocol/dom/command.go +++ b/protocol/dom/command.go @@ -167,6 +167,36 @@ func NewDiscardSearchResultsArgs(searchID string) *DiscardSearchResultsArgs { return args } +// EnableArgs represents the arguments for Enable in the DOM domain. +type EnableArgs struct { + // IncludeWhitespace Whether to include whitespaces in the children + // array of returned Nodes. + // + // Values: "none", "all". + // + // Note: This property is experimental. + IncludeWhitespace *string `json:"includeWhitespace,omitempty"` +} + +// NewEnableArgs initializes EnableArgs with the required arguments. +func NewEnableArgs() *EnableArgs { + args := new(EnableArgs) + + return args +} + +// SetIncludeWhitespace sets the IncludeWhitespace optional argument. +// Whether to include whitespaces in the children array of returned +// Nodes. +// +// Values: "none", "all". +// +// Note: This property is experimental. +func (a *EnableArgs) SetIncludeWhitespace(includeWhitespace string) *EnableArgs { + a.IncludeWhitespace = &includeWhitespace + return a +} + // FocusArgs represents the arguments for Focus in the DOM domain. type FocusArgs struct { NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node. @@ -980,3 +1010,20 @@ func (a *GetContainerForNodeArgs) SetContainerName(containerName string) *GetCon type GetContainerForNodeReply struct { NodeID *NodeID `json:"nodeId,omitempty"` // The container node for the given node, or null if not found. } + +// GetQueryingDescendantsForContainerArgs represents the arguments for GetQueryingDescendantsForContainer in the DOM domain. +type GetQueryingDescendantsForContainerArgs struct { + NodeID NodeID `json:"nodeId"` // Id of the container node to find querying descendants from. +} + +// NewGetQueryingDescendantsForContainerArgs initializes GetQueryingDescendantsForContainerArgs with the required arguments. +func NewGetQueryingDescendantsForContainerArgs(nodeID NodeID) *GetQueryingDescendantsForContainerArgs { + args := new(GetQueryingDescendantsForContainerArgs) + args.NodeID = nodeID + return args +} + +// GetQueryingDescendantsForContainerReply represents the return values for GetQueryingDescendantsForContainer in the DOM domain. +type GetQueryingDescendantsForContainerReply struct { + NodeIDs []NodeID `json:"nodeIds"` // Descendant nodes with container queries against the given container. +} diff --git a/protocol/dom/domain.go b/protocol/dom/domain.go index 4d51c32..5f39949 100644 --- a/protocol/dom/domain.go +++ b/protocol/dom/domain.go @@ -125,8 +125,12 @@ func (d *domainClient) DiscardSearchResults(ctx context.Context, args *DiscardSe } // Enable invokes the DOM method. Enables DOM agent for the given page. -func (d *domainClient) Enable(ctx context.Context) (err error) { - err = rpcc.Invoke(ctx, "DOM.enable", nil, nil, d.conn) +func (d *domainClient) Enable(ctx context.Context, args *EnableArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "DOM.enable", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "DOM.enable", nil, nil, d.conn) + } if err != nil { err = &internal.OpError{Domain: "DOM", Op: "Enable", Err: err} } @@ -669,6 +673,22 @@ func (d *domainClient) GetContainerForNode(ctx context.Context, args *GetContain return } +// GetQueryingDescendantsForContainer invokes the DOM method. Returns the +// descendants of a container query container that have container queries +// against this container. +func (d *domainClient) GetQueryingDescendantsForContainer(ctx context.Context, args *GetQueryingDescendantsForContainerArgs) (reply *GetQueryingDescendantsForContainerReply, err error) { + reply = new(GetQueryingDescendantsForContainerReply) + if args != nil { + err = rpcc.Invoke(ctx, "DOM.getQueryingDescendantsForContainer", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "DOM.getQueryingDescendantsForContainer", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "DOM", Op: "GetQueryingDescendantsForContainer", 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 0202f98..6fbde4c 100644 --- a/protocol/dom/types.go +++ b/protocol/dom/types.go @@ -27,32 +27,37 @@ type PseudoType string // PseudoType as enums. const ( - PseudoTypeNotSet PseudoType = "" - PseudoTypeFirstLine PseudoType = "first-line" - PseudoTypeFirstLetter PseudoType = "first-letter" - PseudoTypeBefore PseudoType = "before" - PseudoTypeAfter PseudoType = "after" - PseudoTypeMarker PseudoType = "marker" - PseudoTypeBackdrop PseudoType = "backdrop" - PseudoTypeSelection PseudoType = "selection" - 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" - PseudoTypeScrollbarButton PseudoType = "scrollbar-button" - PseudoTypeScrollbarTrack PseudoType = "scrollbar-track" - PseudoTypeScrollbarTrackPiece PseudoType = "scrollbar-track-piece" - PseudoTypeScrollbarCorner PseudoType = "scrollbar-corner" - PseudoTypeResizer PseudoType = "resizer" - PseudoTypeInputListButton PseudoType = "input-list-button" + PseudoTypeNotSet PseudoType = "" + PseudoTypeFirstLine PseudoType = "first-line" + PseudoTypeFirstLetter PseudoType = "first-letter" + PseudoTypeBefore PseudoType = "before" + PseudoTypeAfter PseudoType = "after" + PseudoTypeMarker PseudoType = "marker" + PseudoTypeBackdrop PseudoType = "backdrop" + PseudoTypeSelection PseudoType = "selection" + 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" + PseudoTypeScrollbarButton PseudoType = "scrollbar-button" + PseudoTypeScrollbarTrack PseudoType = "scrollbar-track" + PseudoTypeScrollbarTrackPiece PseudoType = "scrollbar-track-piece" + PseudoTypeScrollbarCorner PseudoType = "scrollbar-corner" + PseudoTypeResizer PseudoType = "resizer" + PseudoTypeInputListButton PseudoType = "input-list-button" + PseudoTypePageTransition PseudoType = "page-transition" + PseudoTypePageTransitionContainer PseudoType = "page-transition-container" + PseudoTypePageTransitionImageWrapper PseudoType = "page-transition-image-wrapper" + PseudoTypePageTransitionOutgoingImage PseudoType = "page-transition-outgoing-image" + PseudoTypePageTransitionIncomingImage PseudoType = "page-transition-incoming-image" ) func (e PseudoType) Valid() bool { switch e { - 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": + 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", "page-transition", "page-transition-container", "page-transition-image-wrapper", "page-transition-outgoing-image", "page-transition-incoming-image": return true default: return false diff --git a/protocol/domstorage/command.go b/protocol/domstorage/command.go index 0a486a6..cf6845a 100644 --- a/protocol/domstorage/command.go +++ b/protocol/domstorage/command.go @@ -2,6 +2,10 @@ package domstorage +import ( + "github.com/mafredri/cdp/protocol/page" +) + // ClearArgs represents the arguments for Clear in the DOMStorage domain. type ClearArgs struct { StorageID StorageID `json:"storageId"` // No description. @@ -60,3 +64,20 @@ func NewSetDOMStorageItemArgs(storageID StorageID, key string, value string) *Se args.Value = value return args } + +// GetStorageKeyForFrameArgs represents the arguments for GetStorageKeyForFrame in the DOMStorage domain. +type GetStorageKeyForFrameArgs struct { + FrameID page.FrameID `json:"frameId"` // No description. +} + +// NewGetStorageKeyForFrameArgs initializes GetStorageKeyForFrameArgs with the required arguments. +func NewGetStorageKeyForFrameArgs(frameID page.FrameID) *GetStorageKeyForFrameArgs { + args := new(GetStorageKeyForFrameArgs) + args.FrameID = frameID + return args +} + +// GetStorageKeyForFrameReply represents the return values for GetStorageKeyForFrame in the DOMStorage domain. +type GetStorageKeyForFrameReply struct { + StorageKey SerializedStorageKey `json:"storageKey"` // No description. +} diff --git a/protocol/domstorage/domain.go b/protocol/domstorage/domain.go index 29ba595..708717d 100644 --- a/protocol/domstorage/domain.go +++ b/protocol/domstorage/domain.go @@ -93,6 +93,20 @@ func (d *domainClient) SetDOMStorageItem(ctx context.Context, args *SetDOMStorag return } +// GetStorageKeyForFrame invokes the DOMStorage method. +func (d *domainClient) GetStorageKeyForFrame(ctx context.Context, args *GetStorageKeyForFrameArgs) (reply *GetStorageKeyForFrameReply, err error) { + reply = new(GetStorageKeyForFrameReply) + if args != nil { + err = rpcc.Invoke(ctx, "DOMStorage.getStorageKeyForFrame", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "DOMStorage.getStorageKeyForFrame", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "DOMStorage", Op: "GetStorageKeyForFrame", Err: err} + } + return +} + func (d *domainClient) DOMStorageItemAdded(ctx context.Context) (ItemAddedClient, error) { s, err := rpcc.NewStream(ctx, "DOMStorage.domStorageItemAdded", d.conn) if err != nil { diff --git a/protocol/domstorage/types.go b/protocol/domstorage/types.go index dd07cb9..5b238ba 100644 --- a/protocol/domstorage/types.go +++ b/protocol/domstorage/types.go @@ -2,10 +2,14 @@ package domstorage +// SerializedStorageKey +type SerializedStorageKey string + // StorageID DOM Storage identifier. type StorageID struct { - SecurityOrigin string `json:"securityOrigin"` // Security origin for the storage. - IsLocalStorage bool `json:"isLocalStorage"` // Whether the storage is local storage (not session storage). + SecurityOrigin *string `json:"securityOrigin,omitempty"` // Security origin for the storage. + StorageKey *SerializedStorageKey `json:"storageKey,omitempty"` // Represents a key by which DOM Storage keys its CachedStorageAreas + IsLocalStorage bool `json:"isLocalStorage"` // Whether the storage is local storage (not session storage). } // Item DOM Storage item. diff --git a/protocol/emulation/command.go b/protocol/emulation/command.go index 409c4c6..195c86e 100644 --- a/protocol/emulation/command.go +++ b/protocol/emulation/command.go @@ -25,6 +25,26 @@ func NewSetFocusEmulationEnabledArgs(enabled bool) *SetFocusEmulationEnabledArgs return args } +// SetAutoDarkModeOverrideArgs represents the arguments for SetAutoDarkModeOverride in the Emulation domain. +type SetAutoDarkModeOverrideArgs struct { + Enabled *bool `json:"enabled,omitempty"` // Whether to enable or disable automatic dark mode. If not specified, any existing override will be cleared. +} + +// NewSetAutoDarkModeOverrideArgs initializes SetAutoDarkModeOverrideArgs with the required arguments. +func NewSetAutoDarkModeOverrideArgs() *SetAutoDarkModeOverrideArgs { + args := new(SetAutoDarkModeOverrideArgs) + + return args +} + +// SetEnabled sets the Enabled optional argument. Whether to enable or +// disable automatic dark mode. If not specified, any existing override +// will be cleared. +func (a *SetAutoDarkModeOverrideArgs) SetEnabled(enabled bool) *SetAutoDarkModeOverrideArgs { + a.Enabled = &enabled + return a +} + // SetCPUThrottlingRateArgs represents the arguments for SetCPUThrottlingRate in the Emulation domain. type SetCPUThrottlingRateArgs struct { Rate float64 `json:"rate"` // Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). @@ -398,7 +418,6 @@ type SetVirtualTimePolicyArgs struct { Policy VirtualTimePolicy `json:"policy"` // No description. Budget *float64 `json:"budget,omitempty"` // If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent. MaxVirtualTimeTaskStarvationCount *int `json:"maxVirtualTimeTaskStarvationCount,omitempty"` // If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock. - WaitForNavigation *bool `json:"waitForNavigation,omitempty"` // If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded. InitialVirtualTime network.TimeSinceEpoch `json:"initialVirtualTime,omitempty"` // If set, base::Time::Now will be overridden to initially return this value. } @@ -425,15 +444,6 @@ func (a *SetVirtualTimePolicyArgs) SetMaxVirtualTimeTaskStarvationCount(maxVirtu return a } -// SetWaitForNavigation sets the WaitForNavigation optional argument. -// If set the virtual time policy change should be deferred until any -// frame starts navigating. Note any previous deferred policy change is -// superseded. -func (a *SetVirtualTimePolicyArgs) SetWaitForNavigation(waitForNavigation bool) *SetVirtualTimePolicyArgs { - a.WaitForNavigation = &waitForNavigation - return a -} - // SetInitialVirtualTime sets the InitialVirtualTime optional argument. // If set, base::Time::Now will be overridden to initially return this // value. @@ -547,3 +557,15 @@ func (a *SetUserAgentOverrideArgs) SetUserAgentMetadata(userAgentMetadata UserAg a.UserAgentMetadata = &userAgentMetadata return a } + +// SetAutomationOverrideArgs represents the arguments for SetAutomationOverride in the Emulation domain. +type SetAutomationOverrideArgs struct { + Enabled bool `json:"enabled"` // Whether the override should be enabled. +} + +// NewSetAutomationOverrideArgs initializes SetAutomationOverrideArgs with the required arguments. +func NewSetAutomationOverrideArgs(enabled bool) *SetAutomationOverrideArgs { + args := new(SetAutomationOverrideArgs) + args.Enabled = enabled + return args +} diff --git a/protocol/emulation/domain.go b/protocol/emulation/domain.go index badd812..1b5877b 100644 --- a/protocol/emulation/domain.go +++ b/protocol/emulation/domain.go @@ -75,6 +75,20 @@ func (d *domainClient) SetFocusEmulationEnabled(ctx context.Context, args *SetFo return } +// SetAutoDarkModeOverride invokes the Emulation method. Automatically render +// all web contents using a dark theme. +func (d *domainClient) SetAutoDarkModeOverride(ctx context.Context, args *SetAutoDarkModeOverrideArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Emulation.setAutoDarkModeOverride", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Emulation.setAutoDarkModeOverride", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Emulation", Op: "SetAutoDarkModeOverride", Err: err} + } + return +} + // SetCPUThrottlingRate invokes the Emulation method. Enables CPU throttling // to emulate slow CPUs. func (d *domainClient) SetCPUThrottlingRate(ctx context.Context, args *SetCPUThrottlingRateArgs) (err error) { @@ -369,6 +383,20 @@ func (d *domainClient) SetUserAgentOverride(ctx context.Context, args *SetUserAg return } +// SetAutomationOverride invokes the Emulation method. Allows overriding the +// automation flag. +func (d *domainClient) SetAutomationOverride(ctx context.Context, args *SetAutomationOverrideArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Emulation.setAutomationOverride", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Emulation.setAutomationOverride", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Emulation", Op: "SetAutomationOverride", Err: err} + } + return +} + func (d *domainClient) VirtualTimeBudgetExpired(ctx context.Context) (VirtualTimeBudgetExpiredClient, error) { s, err := rpcc.NewStream(ctx, "Emulation.virtualTimeBudgetExpired", d.conn) if err != nil { diff --git a/protocol/emulation/types.go b/protocol/emulation/types.go index bddb5d1..a6231d6 100644 --- a/protocol/emulation/types.go +++ b/protocol/emulation/types.go @@ -72,13 +72,19 @@ type UserAgentBrandVersion struct { // // Note: This type is experimental. type UserAgentMetadata struct { - Brands []UserAgentBrandVersion `json:"brands,omitempty"` // No description. - FullVersion *string `json:"fullVersion,omitempty"` // No description. - Platform string `json:"platform"` // No description. - PlatformVersion string `json:"platformVersion"` // No description. - Architecture string `json:"architecture"` // No description. - Model string `json:"model"` // No description. - Mobile bool `json:"mobile"` // No description. + Brands []UserAgentBrandVersion `json:"brands,omitempty"` // No description. + FullVersionList []UserAgentBrandVersion `json:"fullVersionList,omitempty"` // No description. + // FullVersion is deprecated. + // + // Deprecated: This property should not be used. + FullVersion *string `json:"fullVersion,omitempty"` + Platform string `json:"platform"` // No description. + PlatformVersion string `json:"platformVersion"` // No description. + Architecture string `json:"architecture"` // No description. + Model string `json:"model"` // No description. + Mobile bool `json:"mobile"` // No description. + Bitness *string `json:"bitness,omitempty"` // No description. + Wow64 *bool `json:"wow64,omitempty"` // No description. } // DisabledImageType Enum of image types that can be disabled. diff --git a/protocol/eventbreakpoints/command.go b/protocol/eventbreakpoints/command.go new file mode 100644 index 0000000..e45bc4a --- /dev/null +++ b/protocol/eventbreakpoints/command.go @@ -0,0 +1,27 @@ +// Code generated by cdpgen. DO NOT EDIT. + +package eventbreakpoints + +// SetInstrumentationBreakpointArgs represents the arguments for SetInstrumentationBreakpoint in the EventBreakpoints domain. +type SetInstrumentationBreakpointArgs struct { + EventName string `json:"eventName"` // Instrumentation name to stop on. +} + +// NewSetInstrumentationBreakpointArgs initializes SetInstrumentationBreakpointArgs with the required arguments. +func NewSetInstrumentationBreakpointArgs(eventName string) *SetInstrumentationBreakpointArgs { + args := new(SetInstrumentationBreakpointArgs) + args.EventName = eventName + return args +} + +// RemoveInstrumentationBreakpointArgs represents the arguments for RemoveInstrumentationBreakpoint in the EventBreakpoints domain. +type RemoveInstrumentationBreakpointArgs struct { + EventName string `json:"eventName"` // Instrumentation name to stop on. +} + +// NewRemoveInstrumentationBreakpointArgs initializes RemoveInstrumentationBreakpointArgs with the required arguments. +func NewRemoveInstrumentationBreakpointArgs(eventName string) *RemoveInstrumentationBreakpointArgs { + args := new(RemoveInstrumentationBreakpointArgs) + args.EventName = eventName + return args +} diff --git a/protocol/eventbreakpoints/domain.go b/protocol/eventbreakpoints/domain.go new file mode 100644 index 0000000..6af81d0 --- /dev/null +++ b/protocol/eventbreakpoints/domain.go @@ -0,0 +1,54 @@ +// Code generated by cdpgen. DO NOT EDIT. + +// Package eventbreakpoints implements the EventBreakpoints domain. +// EventBreakpoints permits setting breakpoints on particular operations and +// events in targets that run JavaScript but do not have a DOM. JavaScript +// execution will stop on these operations as if there was a regular breakpoint +// set. +package eventbreakpoints + +import ( + "context" + + "github.com/mafredri/cdp/protocol/internal" + "github.com/mafredri/cdp/rpcc" +) + +// domainClient is a client for the EventBreakpoints domain. EventBreakpoints +// permits setting breakpoints on particular operations and events in targets +// that run JavaScript but do not have a DOM. JavaScript execution will stop on +// these operations as if there was a regular breakpoint set. +type domainClient struct{ conn *rpcc.Conn } + +// NewClient returns a client for the EventBreakpoints domain with the connection set to conn. +func NewClient(conn *rpcc.Conn) *domainClient { + return &domainClient{conn: conn} +} + +// SetInstrumentationBreakpoint invokes the EventBreakpoints method. Sets +// breakpoint on particular native event. +func (d *domainClient) SetInstrumentationBreakpoint(ctx context.Context, args *SetInstrumentationBreakpointArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "EventBreakpoints.setInstrumentationBreakpoint", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "EventBreakpoints.setInstrumentationBreakpoint", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "EventBreakpoints", Op: "SetInstrumentationBreakpoint", Err: err} + } + return +} + +// RemoveInstrumentationBreakpoint invokes the EventBreakpoints method. +// Removes breakpoint on particular native event. +func (d *domainClient) RemoveInstrumentationBreakpoint(ctx context.Context, args *RemoveInstrumentationBreakpointArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "EventBreakpoints.removeInstrumentationBreakpoint", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "EventBreakpoints.removeInstrumentationBreakpoint", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "EventBreakpoints", Op: "RemoveInstrumentationBreakpoint", Err: err} + } + return +} diff --git a/protocol/fetch/command.go b/protocol/fetch/command.go index ff7530f..054b413 100644 --- a/protocol/fetch/command.go +++ b/protocol/fetch/command.go @@ -57,7 +57,7 @@ type FulfillRequestArgs struct { ResponseCode int `json:"responseCode"` // An HTTP response code. ResponseHeaders []HeaderEntry `json:"responseHeaders,omitempty"` // Response headers. BinaryResponseHeaders []byte `json:"binaryResponseHeaders,omitempty"` // Alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text. (Encoded as a base64 string when passed over JSON) - Body []byte `json:"body,omitempty"` // A response body. (Encoded as a base64 string when passed over JSON) + Body []byte `json:"body,omitempty"` // A response body. If absent, original response body will be used if the request is intercepted at the response stage and empty body will be used if the request is intercepted at the request stage. (Encoded as a base64 string when passed over JSON) ResponsePhrase *string `json:"responsePhrase,omitempty"` // A textual representation of responseCode. If absent, a standard phrase matching responseCode is used. } @@ -86,8 +86,11 @@ func (a *FulfillRequestArgs) SetBinaryResponseHeaders(binaryResponseHeaders []by return a } -// SetBody sets the Body optional argument. A response body. (Encoded -// as a base64 string when passed over JSON) +// SetBody sets the Body optional argument. A response body. If +// absent, original response body will be used if the request is +// intercepted at the response stage and empty body will be used if the +// request is intercepted at the request stage. (Encoded as a base64 +// string when passed over JSON) func (a *FulfillRequestArgs) SetBody(body []byte) *FulfillRequestArgs { a.Body = body return a @@ -108,6 +111,11 @@ type ContinueRequestArgs struct { Method *string `json:"method,omitempty"` // If set, the request method is overridden. PostData []byte `json:"postData,omitempty"` // If set, overrides the post data in the request. (Encoded as a base64 string when passed over JSON) Headers []HeaderEntry `json:"headers,omitempty"` // If set, overrides the request headers. + // InterceptResponse If set, overrides response interception behavior + // for this request. + // + // Note: This property is experimental. + InterceptResponse *bool `json:"interceptResponse,omitempty"` } // NewContinueRequestArgs initializes ContinueRequestArgs with the required arguments. @@ -146,6 +154,15 @@ func (a *ContinueRequestArgs) SetHeaders(headers []HeaderEntry) *ContinueRequest return a } +// SetInterceptResponse sets the InterceptResponse optional argument. +// If set, overrides response interception behavior for this request. +// +// Note: This property is experimental. +func (a *ContinueRequestArgs) SetInterceptResponse(interceptResponse bool) *ContinueRequestArgs { + a.InterceptResponse = &interceptResponse + return a +} + // ContinueWithAuthArgs represents the arguments for ContinueWithAuth in the Fetch domain. type ContinueWithAuthArgs struct { RequestID RequestID `json:"requestId"` // An id the client received in authRequired event. @@ -160,6 +177,54 @@ func NewContinueWithAuthArgs(requestID RequestID, authChallengeResponse AuthChal return args } +// ContinueResponseArgs represents the arguments for ContinueResponse in the Fetch domain. +type ContinueResponseArgs struct { + RequestID RequestID `json:"requestId"` // An id the client received in requestPaused event. + ResponseCode *int `json:"responseCode,omitempty"` // An HTTP response code. If absent, original response code will be used. + ResponsePhrase *string `json:"responsePhrase,omitempty"` // A textual representation of responseCode. If absent, a standard phrase matching responseCode is used. + ResponseHeaders []HeaderEntry `json:"responseHeaders,omitempty"` // Response headers. If absent, original response headers will be used. + BinaryResponseHeaders []byte `json:"binaryResponseHeaders,omitempty"` // Alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text. (Encoded as a base64 string when passed over JSON) +} + +// NewContinueResponseArgs initializes ContinueResponseArgs with the required arguments. +func NewContinueResponseArgs(requestID RequestID) *ContinueResponseArgs { + args := new(ContinueResponseArgs) + args.RequestID = requestID + return args +} + +// SetResponseCode sets the ResponseCode optional argument. An HTTP +// response code. If absent, original response code will be used. +func (a *ContinueResponseArgs) SetResponseCode(responseCode int) *ContinueResponseArgs { + a.ResponseCode = &responseCode + return a +} + +// SetResponsePhrase sets the ResponsePhrase optional argument. A +// textual representation of responseCode. If absent, a standard phrase +// matching responseCode is used. +func (a *ContinueResponseArgs) SetResponsePhrase(responsePhrase string) *ContinueResponseArgs { + a.ResponsePhrase = &responsePhrase + return a +} + +// SetResponseHeaders sets the ResponseHeaders optional argument. +// Response headers. If absent, original response headers will be used. +func (a *ContinueResponseArgs) SetResponseHeaders(responseHeaders []HeaderEntry) *ContinueResponseArgs { + a.ResponseHeaders = responseHeaders + return a +} + +// SetBinaryResponseHeaders sets the BinaryResponseHeaders optional argument. +// Alternative way of specifying response headers as a \0-separated +// series of name: value pairs. Prefer the above method unless you need +// to represent some non-UTF8 values that can't be transmitted over the +// protocol as text. (Encoded as a base64 string when passed over JSON) +func (a *ContinueResponseArgs) SetBinaryResponseHeaders(binaryResponseHeaders []byte) *ContinueResponseArgs { + a.BinaryResponseHeaders = binaryResponseHeaders + return a +} + // GetResponseBodyArgs represents the arguments for GetResponseBody in the Fetch domain. type GetResponseBodyArgs struct { RequestID RequestID `json:"requestId"` // Identifier for the intercepted request to get body for. diff --git a/protocol/fetch/domain.go b/protocol/fetch/domain.go index 984611e..6e05bcc 100644 --- a/protocol/fetch/domain.go +++ b/protocol/fetch/domain.go @@ -99,6 +99,21 @@ func (d *domainClient) ContinueWithAuth(ctx context.Context, args *ContinueWithA return } +// ContinueResponse invokes the Fetch method. Continues loading of the paused +// response, optionally modifying the response headers. If either responseCode +// or headers are modified, all of them must be present. +func (d *domainClient) ContinueResponse(ctx context.Context, args *ContinueResponseArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Fetch.continueResponse", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Fetch.continueResponse", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Fetch", Op: "ContinueResponse", Err: err} + } + return +} + // GetResponseBody invokes the Fetch method. Causes the body of the response // to be received from the server and returned as a single string. May only be // issued for a request that is paused in the Response stage and is mutually diff --git a/protocol/fetch/event.go b/protocol/fetch/event.go index 7b62430..8342ceb 100644 --- a/protocol/fetch/event.go +++ b/protocol/fetch/event.go @@ -30,6 +30,7 @@ type RequestPausedReply struct { ResourceType network.ResourceType `json:"resourceType"` // How the requested resource will be used. ResponseErrorReason *network.ErrorReason `json:"responseErrorReason,omitempty"` // Response error if intercepted at response stage. ResponseStatusCode *int `json:"responseStatusCode,omitempty"` // Response code if intercepted at response stage. + ResponseStatusText *string `json:"responseStatusText,omitempty"` // Response status text if intercepted at response stage. ResponseHeaders []HeaderEntry `json:"responseHeaders,omitempty"` // Response headers if intercepted at the response stage. NetworkID *RequestID `json:"networkId,omitempty"` // If the intercepted request had a corresponding Network.requestWillBeSent event fired for it, then this networkId will be the same as the requestId present in the requestWillBeSent event. } diff --git a/protocol/headlessexperimental/domain.go b/protocol/headlessexperimental/domain.go index 1e99517..2f397ec 100644 --- a/protocol/headlessexperimental/domain.go +++ b/protocol/headlessexperimental/domain.go @@ -24,8 +24,8 @@ func NewClient(conn *rpcc.Conn) *domainClient { // the target and returns when the frame was completed. Optionally captures a // screenshot from the resulting frame. Requires that the target was created // with enabled BeginFrameControl. Designed for use with -// --run-all-compositor-stages-before-draw, see also https://goo.gl/3zHXhB for -// more background. +// --run-all-compositor-stages-before-draw, see also +// https://goo.gle/chrome-headless-rendering for more background. func (d *domainClient) BeginFrame(ctx context.Context, args *BeginFrameArgs) (reply *BeginFrameReply, err error) { reply = new(BeginFrameReply) if args != nil { diff --git a/protocol/heapprofiler/command.go b/protocol/heapprofiler/command.go index 8bae84d..bf6c094 100644 --- a/protocol/heapprofiler/command.go +++ b/protocol/heapprofiler/command.go @@ -112,6 +112,7 @@ type StopSamplingReply struct { type StopTrackingHeapObjectsArgs struct { ReportProgress *bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. TreatGlobalObjectsAsRoots *bool `json:"treatGlobalObjectsAsRoots,omitempty"` // No description. + CaptureNumericValue *bool `json:"captureNumericValue,omitempty"` // If true, numerical values are included in the snapshot } // NewStopTrackingHeapObjectsArgs initializes StopTrackingHeapObjectsArgs with the required arguments. @@ -135,10 +136,18 @@ func (a *StopTrackingHeapObjectsArgs) SetTreatGlobalObjectsAsRoots(treatGlobalOb return a } +// SetCaptureNumericValue sets the CaptureNumericValue optional argument. +// If true, numerical values are included in the snapshot +func (a *StopTrackingHeapObjectsArgs) SetCaptureNumericValue(captureNumericValue bool) *StopTrackingHeapObjectsArgs { + a.CaptureNumericValue = &captureNumericValue + return a +} + // TakeHeapSnapshotArgs represents the arguments for TakeHeapSnapshot in the HeapProfiler domain. type TakeHeapSnapshotArgs struct { ReportProgress *bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. TreatGlobalObjectsAsRoots *bool `json:"treatGlobalObjectsAsRoots,omitempty"` // If true, a raw snapshot without artificial roots will be generated + CaptureNumericValue *bool `json:"captureNumericValue,omitempty"` // If true, numerical values are included in the snapshot } // NewTakeHeapSnapshotArgs initializes TakeHeapSnapshotArgs with the required arguments. @@ -162,3 +171,10 @@ func (a *TakeHeapSnapshotArgs) SetTreatGlobalObjectsAsRoots(treatGlobalObjectsAs a.TreatGlobalObjectsAsRoots = &treatGlobalObjectsAsRoots return a } + +// SetCaptureNumericValue sets the CaptureNumericValue optional argument. +// If true, numerical values are included in the snapshot +func (a *TakeHeapSnapshotArgs) SetCaptureNumericValue(captureNumericValue bool) *TakeHeapSnapshotArgs { + a.CaptureNumericValue = &captureNumericValue + return a +} diff --git a/protocol/input/command.go b/protocol/input/command.go index b54fdbd..b9b71be 100644 --- a/protocol/input/command.go +++ b/protocol/input/command.go @@ -55,7 +55,7 @@ type DispatchKeyEventArgs struct { // 'selectAll') (default: []). These are related to but not equal the // command names used in `document.execCommand` and // NSStandardKeyBindingResponding. See - // https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h + // https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h // for valid command names. // // Note: This property is experimental. @@ -170,7 +170,7 @@ func (a *DispatchKeyEventArgs) SetLocation(location int) *DispatchKeyEventArgs { // to send with the key event (e.g., 'selectAll') (default: []). These // are related to but not equal the command names used in // `document.execCommand` and NSStandardKeyBindingResponding. See -// https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h +// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h // for valid command names. // // Note: This property is experimental. @@ -191,6 +191,38 @@ func NewInsertTextArgs(text string) *InsertTextArgs { return args } +// IMESetCompositionArgs represents the arguments for IMESetComposition in the Input domain. +type IMESetCompositionArgs struct { + Text string `json:"text"` // The text to insert + SelectionStart int `json:"selectionStart"` // selection start + SelectionEnd int `json:"selectionEnd"` // selection end + ReplacementStart *int `json:"replacementStart,omitempty"` // replacement start + ReplacementEnd *int `json:"replacementEnd,omitempty"` // replacement end +} + +// NewIMESetCompositionArgs initializes IMESetCompositionArgs with the required arguments. +func NewIMESetCompositionArgs(text string, selectionStart int, selectionEnd int) *IMESetCompositionArgs { + args := new(IMESetCompositionArgs) + args.Text = text + args.SelectionStart = selectionStart + args.SelectionEnd = selectionEnd + return args +} + +// SetReplacementStart sets the ReplacementStart optional argument. +// replacement start +func (a *IMESetCompositionArgs) SetReplacementStart(replacementStart int) *IMESetCompositionArgs { + a.ReplacementStart = &replacementStart + return a +} + +// SetReplacementEnd sets the ReplacementEnd optional argument. +// replacement end +func (a *IMESetCompositionArgs) SetReplacementEnd(replacementEnd int) *IMESetCompositionArgs { + a.ReplacementEnd = &replacementEnd + return a +} + // DispatchMouseEventArgs represents the arguments for DispatchMouseEvent in the Input domain. type DispatchMouseEventArgs struct { // Type Type of the mouse event. diff --git a/protocol/input/domain.go b/protocol/input/domain.go index 362711d..a71586c 100644 --- a/protocol/input/domain.go +++ b/protocol/input/domain.go @@ -60,6 +60,21 @@ func (d *domainClient) InsertText(ctx context.Context, args *InsertTextArgs) (er return } +// IMESetComposition invokes the Input method. This method sets the current +// candidate text for ime. Use imeCommitComposition to commit the final text. +// Use imeSetComposition with empty string as text to cancel composition. +func (d *domainClient) IMESetComposition(ctx context.Context, args *IMESetCompositionArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Input.imeSetComposition", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Input.imeSetComposition", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Input", Op: "IMESetComposition", Err: err} + } + return +} + // DispatchMouseEvent invokes the Input method. Dispatches a mouse event to // the page. func (d *domainClient) DispatchMouseEvent(ctx context.Context, args *DispatchMouseEventArgs) (err error) { diff --git a/protocol/input/types.go b/protocol/input/types.go index bc137b1..7bb3bb3 100644 --- a/protocol/input/types.go +++ b/protocol/input/types.go @@ -151,5 +151,6 @@ type DragDataItem struct { // Note: This type is experimental. type DragData struct { Items []DragDataItem `json:"items"` // No description. + Files []string `json:"files,omitempty"` // List of filenames that should be included when dropping DragOperationsMask int `json:"dragOperationsMask"` // Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 } diff --git a/protocol/log/types.go b/protocol/log/types.go index f6c96b2..1625a56 100644 --- a/protocol/log/types.go +++ b/protocol/log/types.go @@ -16,8 +16,12 @@ type Entry struct { // Level Log entry severity. // // Values: "verbose", "info", "warning", "error". - Level string `json:"level"` - Text string `json:"text"` // Logged text. + Level string `json:"level"` + Text string `json:"text"` // Logged text. + // Category + // + // Values: "cors". + Category *string `json:"category,omitempty"` Timestamp runtime.Timestamp `json:"timestamp"` // Timestamp when this entry was added. URL *string `json:"url,omitempty"` // URL of the resource if known. LineNumber *int `json:"lineNumber,omitempty"` // Line number in the resource. diff --git a/protocol/media/types.go b/protocol/media/types.go index 9d677c3..b304a95 100644 --- a/protocol/media/types.go +++ b/protocol/media/types.go @@ -83,11 +83,19 @@ type PlayerEvent struct { Value string `json:"value"` // No description. } +// PlayerErrorSourceLocation Represents logged source line numbers reported in +// an error. NOTE: file and line are from chromium c++ implementation code, not +// js. +type PlayerErrorSourceLocation struct { + File string `json:"file"` // No description. + Line int `json:"line"` // No description. +} + // PlayerError Corresponds to kMediaError type PlayerError struct { - // Type - // - // Values: "pipeline_error", "media_error". - Type string `json:"type"` - ErrorCode string `json:"errorCode"` // When this switches to using media::Status instead of PipelineStatus we can remove "errorCode" and replace it with the fields from a Status instance. This also seems like a duplicate of the error level enum - there is a todo bug to have that level removed and use this instead. (crbug.com/1068454) + ErrorType string `json:"errorType"` // No description. + Code int `json:"code"` // Code is the numeric enum entry for a specific set of error codes, such as PipelineStatusCodes in media/base/pipeline_status.h + Stack []PlayerErrorSourceLocation `json:"stack"` // A trace of where this error was caused / where it passed through. + Cause []PlayerError `json:"cause"` // Errors potentially have a root cause error, ie, a DecoderError might be caused by an WindowsError + Data json.RawMessage `json:"data"` // Extra data attached to an error, such as an HRESULT, Video Codec, etc. } diff --git a/protocol/network/command.go b/protocol/network/command.go index 37f68dc..6825297 100644 --- a/protocol/network/command.go +++ b/protocol/network/command.go @@ -456,6 +456,13 @@ type SetCookieArgs struct { // // Note: This property is experimental. SourcePort *int `json:"sourcePort,omitempty"` + // PartitionKey Cookie partition key. The site of the top-level URL + // the browser was visiting at the start of the request to the endpoint + // that set the cookie. If not set, the cookie will be set as not + // partitioned. + // + // Note: This property is experimental. + PartitionKey *string `json:"partitionKey,omitempty"` } // NewSetCookieArgs initializes SetCookieArgs with the required arguments. @@ -554,6 +561,17 @@ func (a *SetCookieArgs) SetSourcePort(sourcePort int) *SetCookieArgs { return a } +// SetPartitionKey sets the PartitionKey optional argument. Cookie +// partition key. The site of the top-level URL the browser was +// visiting at the start of the request to the endpoint that set the +// cookie. If not set, the cookie will be set as not partitioned. +// +// Note: This property is experimental. +func (a *SetCookieArgs) SetPartitionKey(partitionKey string) *SetCookieArgs { + a.PartitionKey = &partitionKey + return a +} + // SetCookieReply represents the return values for SetCookie in the Network domain. type SetCookieReply struct { // Success is deprecated. @@ -635,22 +653,41 @@ type GetSecurityIsolationStatusReply struct { Status SecurityIsolationStatus `json:"status"` // No description. } +// EnableReportingAPIArgs represents the arguments for EnableReportingAPI in the Network domain. +type EnableReportingAPIArgs struct { + Enable bool `json:"enable"` // Whether to enable or disable events for the Reporting API +} + +// NewEnableReportingAPIArgs initializes EnableReportingAPIArgs with the required arguments. +func NewEnableReportingAPIArgs(enable bool) *EnableReportingAPIArgs { + args := new(EnableReportingAPIArgs) + args.Enable = enable + return args +} + // LoadNetworkResourceArgs represents the arguments for LoadNetworkResource in the Network domain. type LoadNetworkResourceArgs struct { - FrameID internal.PageFrameID `json:"frameId"` // Frame id to get the resource for. - URL string `json:"url"` // URL of the resource to get content for. - Options LoadNetworkResourceOptions `json:"options"` // Options for the request. + FrameID *internal.PageFrameID `json:"frameId,omitempty"` // Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets. + URL string `json:"url"` // URL of the resource to get content for. + Options LoadNetworkResourceOptions `json:"options"` // Options for the request. } // NewLoadNetworkResourceArgs initializes LoadNetworkResourceArgs with the required arguments. -func NewLoadNetworkResourceArgs(frameID internal.PageFrameID, url string, options LoadNetworkResourceOptions) *LoadNetworkResourceArgs { +func NewLoadNetworkResourceArgs(url string, options LoadNetworkResourceOptions) *LoadNetworkResourceArgs { args := new(LoadNetworkResourceArgs) - args.FrameID = frameID args.URL = url args.Options = options return args } +// SetFrameID sets the FrameID optional argument. Frame id to get the +// resource for. Mandatory for frame targets, and should be omitted for +// worker targets. +func (a *LoadNetworkResourceArgs) SetFrameID(frameID internal.PageFrameID) *LoadNetworkResourceArgs { + a.FrameID = &frameID + return a +} + // LoadNetworkResourceReply represents the return values for LoadNetworkResource in the Network domain. type LoadNetworkResourceReply struct { Resource LoadNetworkResourcePageResult `json:"resource"` // No description. diff --git a/protocol/network/domain.go b/protocol/network/domain.go index 8c2d2a0..57baf38 100644 --- a/protocol/network/domain.go +++ b/protocol/network/domain.go @@ -434,6 +434,22 @@ func (d *domainClient) GetSecurityIsolationStatus(ctx context.Context, args *Get return } +// EnableReportingAPI invokes the Network method. Enables tracking for the +// Reporting API, events generated by the Reporting API will now be delivered +// to the client. Enabling triggers 'reportingApiReportAdded' for all existing +// reports. +func (d *domainClient) EnableReportingAPI(ctx context.Context, args *EnableReportingAPIArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Network.enableReportingApi", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Network.enableReportingApi", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Network", Op: "EnableReportingAPI", Err: err} + } + return +} + // LoadNetworkResource invokes the Network method. Fetches the resource and // returns the content. func (d *domainClient) LoadNetworkResource(ctx context.Context, args *LoadNetworkResourceArgs) (reply *LoadNetworkResourceReply, err error) { @@ -1015,3 +1031,66 @@ func (c *subresourceWebBundleInnerResponseErrorClient) Recv() (*SubresourceWebBu } return event, nil } + +func (d *domainClient) ReportingAPIReportAdded(ctx context.Context) (ReportingAPIReportAddedClient, error) { + s, err := rpcc.NewStream(ctx, "Network.reportingApiReportAdded", d.conn) + if err != nil { + return nil, err + } + return &reportingAPIReportAddedClient{Stream: s}, nil +} + +type reportingAPIReportAddedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *reportingAPIReportAddedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *reportingAPIReportAddedClient) Recv() (*ReportingAPIReportAddedReply, error) { + event := new(ReportingAPIReportAddedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Network", Op: "ReportingAPIReportAdded Recv", Err: err} + } + return event, nil +} + +func (d *domainClient) ReportingAPIReportUpdated(ctx context.Context) (ReportingAPIReportUpdatedClient, error) { + s, err := rpcc.NewStream(ctx, "Network.reportingApiReportUpdated", d.conn) + if err != nil { + return nil, err + } + return &reportingAPIReportUpdatedClient{Stream: s}, nil +} + +type reportingAPIReportUpdatedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *reportingAPIReportUpdatedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *reportingAPIReportUpdatedClient) Recv() (*ReportingAPIReportUpdatedReply, error) { + event := new(ReportingAPIReportUpdatedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Network", Op: "ReportingAPIReportUpdated Recv", Err: err} + } + return event, nil +} + +func (d *domainClient) ReportingAPIEndpointsChangedForOrigin(ctx context.Context) (ReportingAPIEndpointsChangedForOriginClient, error) { + s, err := rpcc.NewStream(ctx, "Network.reportingApiEndpointsChangedForOrigin", d.conn) + if err != nil { + return nil, err + } + return &reportingAPIEndpointsChangedForOriginClient{Stream: s}, nil +} + +type reportingAPIEndpointsChangedForOriginClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *reportingAPIEndpointsChangedForOriginClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *reportingAPIEndpointsChangedForOriginClient) Recv() (*ReportingAPIEndpointsChangedForOriginReply, error) { + event := new(ReportingAPIEndpointsChangedForOriginReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Network", Op: "ReportingAPIEndpointsChangedForOrigin Recv", Err: err} + } + return event, nil +} diff --git a/protocol/network/event.go b/protocol/network/event.go index c99c23b..dead332 100644 --- a/protocol/network/event.go +++ b/protocol/network/event.go @@ -130,17 +130,24 @@ type RequestWillBeSentClient interface { // RequestWillBeSentReply is the reply for RequestWillBeSent events. type RequestWillBeSentReply struct { - RequestID RequestID `json:"requestId"` // Request identifier. - LoaderID LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. - DocumentURL string `json:"documentURL"` // URL of the document this request is loaded for. - Request Request `json:"request"` // Request data. - Timestamp MonotonicTime `json:"timestamp"` // Timestamp. - WallTime TimeSinceEpoch `json:"wallTime"` // Timestamp. - Initiator Initiator `json:"initiator"` // Request initiator. - RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data. - Type ResourceType `json:"type,omitempty"` // Type of this resource. - FrameID *internal.PageFrameID `json:"frameId,omitempty"` // Frame identifier. - HasUserGesture *bool `json:"hasUserGesture,omitempty"` // Whether the request is initiated by a user gesture. Defaults to false. + RequestID RequestID `json:"requestId"` // Request identifier. + LoaderID LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. + DocumentURL string `json:"documentURL"` // URL of the document this request is loaded for. + Request Request `json:"request"` // Request data. + Timestamp MonotonicTime `json:"timestamp"` // Timestamp. + WallTime TimeSinceEpoch `json:"wallTime"` // Timestamp. + Initiator Initiator `json:"initiator"` // Request initiator. + // RedirectHasExtraInfo In the case that redirectResponse is + // populated, this flag indicates whether requestWillBeSentExtraInfo + // and responseReceivedExtraInfo events will be or were emitted for the + // request which was just redirected. + // + // Note: This property is experimental. + RedirectHasExtraInfo bool `json:"redirectHasExtraInfo"` + RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data. + Type ResourceType `json:"type,omitempty"` // Type of this resource. + FrameID *internal.PageFrameID `json:"frameId,omitempty"` // Frame identifier. + HasUserGesture *bool `json:"hasUserGesture,omitempty"` // Whether the request is initiated by a user gesture. Defaults to false. } // ResourceChangedPriorityClient is a client for ResourceChangedPriority events. @@ -185,12 +192,18 @@ type ResponseReceivedClient interface { // ResponseReceivedReply is the reply for ResponseReceived events. type ResponseReceivedReply struct { - RequestID RequestID `json:"requestId"` // Request identifier. - LoaderID LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. - Timestamp MonotonicTime `json:"timestamp"` // Timestamp. - Type ResourceType `json:"type"` // Resource type. - Response Response `json:"response"` // Response data. - FrameID *internal.PageFrameID `json:"frameId,omitempty"` // Frame identifier. + RequestID RequestID `json:"requestId"` // Request identifier. + LoaderID LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. + Timestamp MonotonicTime `json:"timestamp"` // Timestamp. + Type ResourceType `json:"type"` // Resource type. + Response Response `json:"response"` // Response data. + // HasExtraInfo Indicates whether requestWillBeSentExtraInfo and + // responseReceivedExtraInfo events will be or were emitted for this + // request. + // + // Note: This property is experimental. + HasExtraInfo bool `json:"hasExtraInfo"` + FrameID *internal.PageFrameID `json:"frameId,omitempty"` // Frame identifier. } // WebSocketClosedClient is a client for WebSocketClosed events. Fired when @@ -367,10 +380,14 @@ type RequestWillBeSentExtraInfoClient interface { // RequestWillBeSentExtraInfoReply is the reply for RequestWillBeSentExtraInfo events. type RequestWillBeSentExtraInfoReply struct { - RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to an existing requestWillBeSent event. - AssociatedCookies []BlockedCookieWithReason `json:"associatedCookies"` // A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReason field set. - Headers Headers `json:"headers"` // Raw request headers as they will be sent over the wire. - ClientSecurityState *ClientSecurityState `json:"clientSecurityState,omitempty"` // The client security state set for the request. + RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to an existing requestWillBeSent event. + AssociatedCookies []BlockedCookieWithReason `json:"associatedCookies"` // A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReason field set. + Headers Headers `json:"headers"` // Raw request headers as they will be sent over the wire. + // ConnectTiming Connection timing information for the request. + // + // Note: This property is experimental. + ConnectTiming ConnectTiming `json:"connectTiming"` + ClientSecurityState *ClientSecurityState `json:"clientSecurityState,omitempty"` // The client security state set for the request. } // ResponseReceivedExtraInfoClient is a client for ResponseReceivedExtraInfo events. @@ -391,6 +408,7 @@ type ResponseReceivedExtraInfoReply struct { BlockedCookies []BlockedSetCookieWithReason `json:"blockedCookies"` // A list of cookies which were not stored from the response along with the corresponding reasons for blocking. The cookies here may not be valid due to syntax errors, which are represented by the invalid cookie line string instead of a proper cookie. Headers Headers `json:"headers"` // Raw response headers as they were received over the wire. ResourceIPAddressSpace IPAddressSpace `json:"resourceIPAddressSpace"` // The IP address space of the resource. The address space can only be determined once the transport established the connection, so we can't send it in `requestWillBeSentExtraInfo`. + StatusCode int `json:"statusCode"` // The status code of the response. This is useful in cases the request failed and no responseReceived event is triggered, which is the case for, e.g., CORS errors. This is also the correct status code for cached requests, where the status in responseReceived is a 200 and this will be 304. HeadersText *string `json:"headersText,omitempty"` // Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC. } @@ -486,3 +504,45 @@ type SubresourceWebBundleInnerResponseErrorReply struct { 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. } + +// ReportingAPIReportAddedClient is a client for ReportingAPIReportAdded events. +// Is sent whenever a new report is added. And after 'enableReportingApi' for +// all existing reports. +type ReportingAPIReportAddedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*ReportingAPIReportAddedReply, error) + rpcc.Stream +} + +// ReportingAPIReportAddedReply is the reply for ReportingAPIReportAdded events. +type ReportingAPIReportAddedReply struct { + Report ReportingAPIReport `json:"report"` // No description. +} + +// ReportingAPIReportUpdatedClient is a client for ReportingAPIReportUpdated events. +type ReportingAPIReportUpdatedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*ReportingAPIReportUpdatedReply, error) + rpcc.Stream +} + +// ReportingAPIReportUpdatedReply is the reply for ReportingAPIReportUpdated events. +type ReportingAPIReportUpdatedReply struct { + Report ReportingAPIReport `json:"report"` // No description. +} + +// ReportingAPIEndpointsChangedForOriginClient is a client for ReportingAPIEndpointsChangedForOrigin events. +type ReportingAPIEndpointsChangedForOriginClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*ReportingAPIEndpointsChangedForOriginReply, error) + rpcc.Stream +} + +// ReportingAPIEndpointsChangedForOriginReply is the reply for ReportingAPIEndpointsChangedForOrigin events. +type ReportingAPIEndpointsChangedForOriginReply struct { + Origin string `json:"origin"` // Origin of the document(s) which configured the endpoints. + Endpoints []ReportingAPIEndpoint `json:"endpoints"` // No description. +} diff --git a/protocol/network/types.go b/protocol/network/types.go index 71604ca..29fb348 100644 --- a/protocol/network/types.go +++ b/protocol/network/types.go @@ -383,14 +383,14 @@ type Request struct { // SignedCertificateTimestamp Details of a signed certificate timestamp (SCT). type SignedCertificateTimestamp struct { - Status string `json:"status"` // Validation status. - Origin string `json:"origin"` // Origin. - LogDescription string `json:"logDescription"` // Log name / description. - LogID string `json:"logId"` // Log ID. - Timestamp TimeSinceEpoch `json:"timestamp"` // Issuance date. - HashAlgorithm string `json:"hashAlgorithm"` // Hash algorithm. - SignatureAlgorithm string `json:"signatureAlgorithm"` // Signature algorithm. - SignatureData string `json:"signatureData"` // Signature data. + Status string `json:"status"` // Validation status. + Origin string `json:"origin"` // Origin. + LogDescription string `json:"logDescription"` // Log name / description. + LogID string `json:"logId"` // Log ID. + Timestamp float64 `json:"timestamp"` // Issuance date. Unlike TimeSinceEpoch, this contains the number of milliseconds since January 1, 1970, UTC, not the number of seconds. + HashAlgorithm string `json:"hashAlgorithm"` // Hash algorithm. + SignatureAlgorithm string `json:"signatureAlgorithm"` // Signature algorithm. + SignatureData string `json:"signatureData"` // Signature data. } // SecurityDetails Security details about a request. @@ -493,18 +493,22 @@ const ( CORSErrorPreflightInvalidAllowCredentials CORSError = "PreflightInvalidAllowCredentials" CORSErrorPreflightMissingAllowExternal CORSError = "PreflightMissingAllowExternal" CORSErrorPreflightInvalidAllowExternal CORSError = "PreflightInvalidAllowExternal" + CORSErrorPreflightMissingAllowPrivateNetwork CORSError = "PreflightMissingAllowPrivateNetwork" + CORSErrorPreflightInvalidAllowPrivateNetwork CORSError = "PreflightInvalidAllowPrivateNetwork" CORSErrorInvalidAllowMethodsPreflightResponse CORSError = "InvalidAllowMethodsPreflightResponse" CORSErrorInvalidAllowHeadersPreflightResponse CORSError = "InvalidAllowHeadersPreflightResponse" CORSErrorMethodDisallowedByPreflightResponse CORSError = "MethodDisallowedByPreflightResponse" CORSErrorHeaderDisallowedByPreflightResponse CORSError = "HeaderDisallowedByPreflightResponse" CORSErrorRedirectContainsCredentials CORSError = "RedirectContainsCredentials" CORSErrorInsecurePrivateNetwork CORSError = "InsecurePrivateNetwork" + CORSErrorInvalidPrivateNetworkAccess CORSError = "InvalidPrivateNetworkAccess" + CORSErrorUnexpectedPrivateNetworkAccess CORSError = "UnexpectedPrivateNetworkAccess" 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", "NoCorsRedirectModeNotFollow": + case "DisallowedByMode", "InvalidResponse", "WildcardOriginNotAllowed", "MissingAllowOriginHeader", "MultipleAllowOriginValues", "InvalidAllowOriginValue", "AllowOriginMismatch", "InvalidAllowCredentials", "CorsDisabledScheme", "PreflightInvalidStatus", "PreflightDisallowedRedirect", "PreflightWildcardOriginNotAllowed", "PreflightMissingAllowOriginHeader", "PreflightMultipleAllowOriginValues", "PreflightInvalidAllowOriginValue", "PreflightAllowOriginMismatch", "PreflightInvalidAllowCredentials", "PreflightMissingAllowExternal", "PreflightInvalidAllowExternal", "PreflightMissingAllowPrivateNetwork", "PreflightInvalidAllowPrivateNetwork", "InvalidAllowMethodsPreflightResponse", "InvalidAllowHeadersPreflightResponse", "MethodDisallowedByPreflightResponse", "HeaderDisallowedByPreflightResponse", "RedirectContainsCredentials", "InsecurePrivateNetwork", "InvalidPrivateNetworkAccess", "UnexpectedPrivateNetworkAccess", "NoCorsRedirectModeNotFollow": return true default: return false @@ -589,14 +593,22 @@ func (e TrustTokenOperationType) String() string { // Response HTTP response data. type Response struct { - URL string `json:"url"` // Response URL. This URL can be different from CachedResource.url in case of redirect. - Status int `json:"status"` // HTTP response status code. - StatusText string `json:"statusText"` // HTTP response status text. - Headers Headers `json:"headers"` // HTTP response headers. - HeadersText *string `json:"headersText,omitempty"` // HTTP response headers text. - MimeType string `json:"mimeType"` // Resource mimeType as determined by the browser. - RequestHeaders Headers `json:"requestHeaders,omitempty"` // Refined HTTP request headers that were actually transmitted over the network. - RequestHeadersText *string `json:"requestHeadersText,omitempty"` // HTTP request headers text. + URL string `json:"url"` // Response URL. This URL can be different from CachedResource.url in case of redirect. + Status int `json:"status"` // HTTP response status code. + StatusText string `json:"statusText"` // HTTP response status text. + Headers Headers `json:"headers"` // HTTP response headers. + // HeadersText is deprecated. + // + // Deprecated: HTTP response headers text. This has been replaced by + // the headers in Network.responseReceivedExtraInfo. + HeadersText *string `json:"headersText,omitempty"` + MimeType string `json:"mimeType"` // Resource mimeType as determined by the browser. + RequestHeaders Headers `json:"requestHeaders,omitempty"` // Refined HTTP request headers that were actually transmitted over the network. + // RequestHeadersText is deprecated. + // + // Deprecated: HTTP request headers text. This has been replaced by + // the headers in Network.requestWillBeSentExtraInfo. + RequestHeadersText *string `json:"requestHeadersText,omitempty"` ConnectionReused bool `json:"connectionReused"` // Specifies whether physical connection was actually reused for this request. ConnectionID float64 `json:"connectionId"` // Physical connection id that was actually used for this request. RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` // Remote IP address. @@ -689,6 +701,16 @@ type Cookie struct { // // Note: This property is experimental. SourcePort int `json:"sourcePort"` + // PartitionKey Cookie partition key. The site of the top-level URL + // the browser was visiting at the start of the request to the endpoint + // that set the cookie. + // + // Note: This property is experimental. + PartitionKey *string `json:"partitionKey,omitempty"` + // PartitionKeyOpaque True if cookie partition key is opaque. + // + // Note: This property is experimental. + PartitionKeyOpaque *bool `json:"partitionKeyOpaque,omitempty"` } // SetCookieBlockedReason Types of reasons why a cookie may not be stored from @@ -717,11 +739,12 @@ const ( SetCookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax SetCookieBlockedReason = "SchemefulSameSiteUnspecifiedTreatedAsLax" SetCookieBlockedReasonSamePartyFromCrossPartyContext SetCookieBlockedReason = "SamePartyFromCrossPartyContext" SetCookieBlockedReasonSamePartyConflictsWithOtherAttributes SetCookieBlockedReason = "SamePartyConflictsWithOtherAttributes" + SetCookieBlockedReasonNameValuePairExceedsMaxSize SetCookieBlockedReason = "NameValuePairExceedsMaxSize" ) func (e SetCookieBlockedReason) Valid() bool { switch e { - case "SecureOnly", "SameSiteStrict", "SameSiteLax", "SameSiteUnspecifiedTreatedAsLax", "SameSiteNoneInsecure", "UserPreferences", "SyntaxError", "SchemeNotSupported", "OverwriteSecure", "InvalidDomain", "InvalidPrefix", "UnknownError", "SchemefulSameSiteStrict", "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", "SamePartyFromCrossPartyContext", "SamePartyConflictsWithOtherAttributes": + case "SecureOnly", "SameSiteStrict", "SameSiteLax", "SameSiteUnspecifiedTreatedAsLax", "SameSiteNoneInsecure", "UserPreferences", "SyntaxError", "SchemeNotSupported", "OverwriteSecure", "InvalidDomain", "InvalidPrefix", "UnknownError", "SchemefulSameSiteStrict", "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", "SamePartyFromCrossPartyContext", "SamePartyConflictsWithOtherAttributes", "NameValuePairExceedsMaxSize": return true default: return false @@ -754,11 +777,12 @@ const ( CookieBlockedReasonSchemefulSameSiteLax CookieBlockedReason = "SchemefulSameSiteLax" CookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax CookieBlockedReason = "SchemefulSameSiteUnspecifiedTreatedAsLax" CookieBlockedReasonSamePartyFromCrossPartyContext CookieBlockedReason = "SamePartyFromCrossPartyContext" + CookieBlockedReasonNameValuePairExceedsMaxSize CookieBlockedReason = "NameValuePairExceedsMaxSize" ) func (e CookieBlockedReason) Valid() bool { switch e { - case "SecureOnly", "NotOnPath", "DomainMismatch", "SameSiteStrict", "SameSiteLax", "SameSiteUnspecifiedTreatedAsLax", "SameSiteNoneInsecure", "UserPreferences", "UnknownError", "SchemefulSameSiteStrict", "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", "SamePartyFromCrossPartyContext": + case "SecureOnly", "NotOnPath", "DomainMismatch", "SameSiteStrict", "SameSiteLax", "SameSiteUnspecifiedTreatedAsLax", "SameSiteNoneInsecure", "UserPreferences", "UnknownError", "SchemefulSameSiteStrict", "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", "SamePartyFromCrossPartyContext", "NameValuePairExceedsMaxSize": return true default: return false @@ -818,6 +842,13 @@ type CookieParam struct { // // Note: This property is experimental. SourcePort *int `json:"sourcePort,omitempty"` + // PartitionKey Cookie partition key. The site of the top-level URL + // the browser was visiting at the start of the request to the endpoint + // that set the cookie. If not set, the cookie will be set as not + // partitioned. + // + // Note: This property is experimental. + PartitionKey *string `json:"partitionKey,omitempty"` } // AuthChallenge Authorization challenge for HTTP status code 401 or 407. @@ -997,11 +1028,13 @@ const ( PrivateNetworkRequestPolicyAllow PrivateNetworkRequestPolicy = "Allow" PrivateNetworkRequestPolicyBlockFromInsecureToMorePrivate PrivateNetworkRequestPolicy = "BlockFromInsecureToMorePrivate" PrivateNetworkRequestPolicyWarnFromInsecureToMorePrivate PrivateNetworkRequestPolicy = "WarnFromInsecureToMorePrivate" + PrivateNetworkRequestPolicyPreflightBlock PrivateNetworkRequestPolicy = "PreflightBlock" + PrivateNetworkRequestPolicyPreflightWarn PrivateNetworkRequestPolicy = "PreflightWarn" ) func (e PrivateNetworkRequestPolicy) Valid() bool { switch e { - case "Allow", "BlockFromInsecureToMorePrivate", "WarnFromInsecureToMorePrivate": + case "Allow", "BlockFromInsecureToMorePrivate", "WarnFromInsecureToMorePrivate", "PreflightBlock", "PreflightWarn": return true default: return false @@ -1039,6 +1072,13 @@ func (e IPAddressSpace) String() string { return string(e) } +// ConnectTiming +// +// Note: This type is experimental. +type ConnectTiming struct { + RequestTime float64 `json:"requestTime"` // Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for the same request (but not for redirected requests). +} + // ClientSecurityState // // Note: This type is experimental. @@ -1055,16 +1095,17 @@ type CrossOriginOpenerPolicyValue string // CrossOriginOpenerPolicyValue as enums. const ( - CrossOriginOpenerPolicyValueNotSet CrossOriginOpenerPolicyValue = "" - CrossOriginOpenerPolicyValueSameOrigin CrossOriginOpenerPolicyValue = "SameOrigin" - CrossOriginOpenerPolicyValueSameOriginAllowPopups CrossOriginOpenerPolicyValue = "SameOriginAllowPopups" - CrossOriginOpenerPolicyValueUnsafeNone CrossOriginOpenerPolicyValue = "UnsafeNone" - CrossOriginOpenerPolicyValueSameOriginPlusCoep CrossOriginOpenerPolicyValue = "SameOriginPlusCoep" + CrossOriginOpenerPolicyValueNotSet CrossOriginOpenerPolicyValue = "" + CrossOriginOpenerPolicyValueSameOrigin CrossOriginOpenerPolicyValue = "SameOrigin" + CrossOriginOpenerPolicyValueSameOriginAllowPopups CrossOriginOpenerPolicyValue = "SameOriginAllowPopups" + CrossOriginOpenerPolicyValueUnsafeNone CrossOriginOpenerPolicyValue = "UnsafeNone" + CrossOriginOpenerPolicyValueSameOriginPlusCoep CrossOriginOpenerPolicyValue = "SameOriginPlusCoep" + CrossOriginOpenerPolicyValueSameOriginAllowPopupsPlusCoep CrossOriginOpenerPolicyValue = "SameOriginAllowPopupsPlusCoep" ) func (e CrossOriginOpenerPolicyValue) Valid() bool { switch e { - case "SameOrigin", "SameOriginAllowPopups", "UnsafeNone", "SameOriginPlusCoep": + case "SameOrigin", "SameOriginAllowPopups", "UnsafeNone", "SameOriginPlusCoep", "SameOriginAllowPopupsPlusCoep": return true default: return false @@ -1129,6 +1170,62 @@ type SecurityIsolationStatus struct { Coep *CrossOriginEmbedderPolicyStatus `json:"coep,omitempty"` // No description. } +// ReportStatus The status of a Reporting API report. +// +// Note: This type is experimental. +type ReportStatus string + +// ReportStatus as enums. +const ( + ReportStatusNotSet ReportStatus = "" + ReportStatusQueued ReportStatus = "Queued" + ReportStatusPending ReportStatus = "Pending" + ReportStatusMarkedForRemoval ReportStatus = "MarkedForRemoval" + ReportStatusSuccess ReportStatus = "Success" +) + +func (e ReportStatus) Valid() bool { + switch e { + case "Queued", "Pending", "MarkedForRemoval", "Success": + return true + default: + return false + } +} + +func (e ReportStatus) String() string { + return string(e) +} + +// ReportID +// +// Note: This type is experimental. +type ReportID string + +// ReportingAPIReport An object representing a report generated by the +// Reporting API. +// +// Note: This type is experimental. +type ReportingAPIReport struct { + ID ReportID `json:"id"` // No description. + InitiatorURL string `json:"initiatorUrl"` // The URL of the document that triggered the report. + Destination string `json:"destination"` // The name of the endpoint group that should be used to deliver the report. + Type string `json:"type"` // The type of the report (specifies the set of data that is contained in the report body). + Timestamp TimeSinceEpoch `json:"timestamp"` // When the report was generated. + Depth int `json:"depth"` // How many uploads deep the related request was. + CompletedAttempts int `json:"completedAttempts"` // The number of delivery attempts made so far, not including an active attempt. + Body json.RawMessage `json:"body"` // No description. + Status ReportStatus `json:"status"` // No description. +} + +// ReportingAPIEndpoint +// +// Note: This type is experimental. +type ReportingAPIEndpoint struct { + URL string `json:"url"` // The URL of the endpoint to which reports may be delivered. + GroupName string `json:"groupName"` // Name of the endpoint group. +} + // LoadNetworkResourcePageResult An object providing the result of a network // resource load. // diff --git a/protocol/overlay/command.go b/protocol/overlay/command.go index d373570..ce8d5e7 100644 --- a/protocol/overlay/command.go +++ b/protocol/overlay/command.go @@ -477,3 +477,15 @@ func (a *SetShowHingeArgs) SetHingeConfig(hingeConfig HingeConfig) *SetShowHinge a.HingeConfig = &hingeConfig return a } + +// SetShowIsolatedElementsArgs represents the arguments for SetShowIsolatedElements in the Overlay domain. +type SetShowIsolatedElementsArgs struct { + IsolatedElementHighlightConfigs []IsolatedElementHighlightConfig `json:"isolatedElementHighlightConfigs"` // An array of node identifiers and descriptors for the highlight appearance. +} + +// NewSetShowIsolatedElementsArgs initializes SetShowIsolatedElementsArgs with the required arguments. +func NewSetShowIsolatedElementsArgs(isolatedElementHighlightConfigs []IsolatedElementHighlightConfig) *SetShowIsolatedElementsArgs { + args := new(SetShowIsolatedElementsArgs) + args.IsolatedElementHighlightConfigs = isolatedElementHighlightConfigs + return args +} diff --git a/protocol/overlay/domain.go b/protocol/overlay/domain.go index 3891372..dea68cd 100644 --- a/protocol/overlay/domain.go +++ b/protocol/overlay/domain.go @@ -330,8 +330,8 @@ func (d *domainClient) SetShowScrollBottleneckRects(ctx context.Context, args *S return } -// SetShowHitTestBorders invokes the Overlay method. Requests that backend -// shows hit-test borders on layers +// SetShowHitTestBorders invokes the Overlay method. Deprecated, no longer has +// any effect. func (d *domainClient) SetShowHitTestBorders(ctx context.Context, args *SetShowHitTestBordersArgs) (err error) { if args != nil { err = rpcc.Invoke(ctx, "Overlay.setShowHitTestBorders", args, nil, d.conn) @@ -385,6 +385,20 @@ func (d *domainClient) SetShowHinge(ctx context.Context, args *SetShowHingeArgs) return } +// SetShowIsolatedElements invokes the Overlay method. Show elements in +// isolation mode with overlays. +func (d *domainClient) SetShowIsolatedElements(ctx context.Context, args *SetShowIsolatedElementsArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Overlay.setShowIsolatedElements", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Overlay.setShowIsolatedElements", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Overlay", Op: "SetShowIsolatedElements", Err: err} + } + return +} + func (d *domainClient) InspectNodeRequested(ctx context.Context) (InspectNodeRequestedClient, error) { s, err := rpcc.NewStream(ctx, "Overlay.inspectNodeRequested", d.conn) if err != nil { diff --git a/protocol/overlay/types.go b/protocol/overlay/types.go index 79c31b3..36f874e 100644 --- a/protocol/overlay/types.go +++ b/protocol/overlay/types.go @@ -137,12 +137,13 @@ const ( ColorFormatNotSet ColorFormat = "" ColorFormatRGB ColorFormat = "rgb" ColorFormatHSL ColorFormat = "hsl" + ColorFormatHWB ColorFormat = "hwb" ColorFormatHex ColorFormat = "hex" ) func (e ColorFormat) Valid() bool { switch e { - case "rgb", "hsl", "hex": + case "rgb", "hsl", "hwb", "hex": return true default: return false @@ -194,7 +195,21 @@ type ContainerQueryHighlightConfig struct { // ContainerQueryContainerHighlightConfig type ContainerQueryContainerHighlightConfig struct { - ContainerBorder *LineStyle `json:"containerBorder,omitempty"` // The style of the container border + ContainerBorder *LineStyle `json:"containerBorder,omitempty"` // The style of the container border. + DescendantBorder *LineStyle `json:"descendantBorder,omitempty"` // The style of the descendants' borders. +} + +// IsolatedElementHighlightConfig +type IsolatedElementHighlightConfig struct { + IsolationModeHighlightConfig IsolationModeHighlightConfig `json:"isolationModeHighlightConfig"` // A descriptor for the highlight appearance of an element in isolation mode. + NodeID dom.NodeID `json:"nodeId"` // Identifier of the isolated element to highlight. +} + +// IsolationModeHighlightConfig +type IsolationModeHighlightConfig struct { + ResizerColor *dom.RGBA `json:"resizerColor,omitempty"` // The fill color of the resizers (default: transparent). + ResizerHandleColor *dom.RGBA `json:"resizerHandleColor,omitempty"` // The fill color for resizer handles (default: transparent). + MaskColor *dom.RGBA `json:"maskColor,omitempty"` // The fill color for the mask covering non-isolated elements (default: transparent). } // InspectMode diff --git a/protocol/page/command.go b/protocol/page/command.go index f0617e3..4e2ab9e 100644 --- a/protocol/page/command.go +++ b/protocol/page/command.go @@ -235,6 +235,12 @@ type GetManifestIconsReply struct { PrimaryIcon *string `json:"primaryIcon,omitempty"` // No description. } +// GetAppIDReply represents the return values for GetAppID in the Page domain. +type GetAppIDReply struct { + AppID *string `json:"appId,omitempty"` // App id, either from manifest's id attribute or computed from start_url + RecommendedID *string `json:"recommendedId,omitempty"` // Recommendation for manifest's id attribute to match current id computed from start_url +} + // GetFrameTreeReply represents the return values for GetFrameTree in the Page domain. type GetFrameTreeReply struct { FrameTree FrameTree `json:"frameTree"` // Present frame tree structure. @@ -244,20 +250,17 @@ type GetFrameTreeReply struct { type GetLayoutMetricsReply struct { // LayoutViewport is deprecated. // - // Deprecated: Deprecated metrics relating to the layout viewport. Can - // be in DP or in CSS pixels depending on the `enable-use-zoom-for-dsf` - // flag. Use `cssLayoutViewport` instead. + // Deprecated: Deprecated metrics relating to the layout viewport. Is + // in device pixels. Use `cssLayoutViewport` instead. LayoutViewport LayoutViewport `json:"layoutViewport"` // VisualViewport is deprecated. // - // Deprecated: Deprecated metrics relating to the visual viewport. Can - // be in DP or in CSS pixels depending on the `enable-use-zoom-for-dsf` - // flag. Use `cssVisualViewport` instead. + // Deprecated: Deprecated metrics relating to the visual viewport. Is + // in device pixels. Use `cssVisualViewport` instead. VisualViewport VisualViewport `json:"visualViewport"` // ContentSize is deprecated. // - // Deprecated: Deprecated size of scrollable area. Can be in DP or in - // CSS pixels depending on the `enable-use-zoom-for-dsf` flag. Use + // Deprecated: Deprecated size of scrollable area. Is in DP. Use // `cssContentSize` instead. ContentSize dom.Rect `json:"contentSize"` CSSLayoutViewport LayoutViewport `json:"cssLayoutViewport"` // Metrics relating to the layout viewport in CSS pixels. @@ -386,21 +389,20 @@ func NewNavigateToHistoryEntryArgs(entryID int) *NavigateToHistoryEntryArgs { // PrintToPDFArgs represents the arguments for PrintToPDF in the Page domain. type PrintToPDFArgs struct { - Landscape *bool `json:"landscape,omitempty"` // Paper orientation. Defaults to false. - DisplayHeaderFooter *bool `json:"displayHeaderFooter,omitempty"` // Display header and footer. Defaults to false. - PrintBackground *bool `json:"printBackground,omitempty"` // Print background graphics. Defaults to false. - Scale *float64 `json:"scale,omitempty"` // Scale of the webpage rendering. Defaults to 1. - PaperWidth *float64 `json:"paperWidth,omitempty"` // Paper width in inches. Defaults to 8.5 inches. - PaperHeight *float64 `json:"paperHeight,omitempty"` // Paper height in inches. Defaults to 11 inches. - MarginTop *float64 `json:"marginTop,omitempty"` // Top margin in inches. Defaults to 1cm (~0.4 inches). - MarginBottom *float64 `json:"marginBottom,omitempty"` // Bottom margin in inches. Defaults to 1cm (~0.4 inches). - MarginLeft *float64 `json:"marginLeft,omitempty"` // Left margin in inches. Defaults to 1cm (~0.4 inches). - MarginRight *float64 `json:"marginRight,omitempty"` // Right margin in inches. Defaults to 1cm (~0.4 inches). - PageRanges *string `json:"pageRanges,omitempty"` // Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. - IgnoreInvalidPageRanges *bool `json:"ignoreInvalidPageRanges,omitempty"` // Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false. - HeaderTemplate *string `json:"headerTemplate,omitempty"` // HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document For example, `` would generate span containing the title. - FooterTemplate *string `json:"footerTemplate,omitempty"` // HTML template for the print footer. Should use the same format as the `headerTemplate`. - PreferCSSPageSize *bool `json:"preferCSSPageSize,omitempty"` // Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. + Landscape *bool `json:"landscape,omitempty"` // Paper orientation. Defaults to false. + DisplayHeaderFooter *bool `json:"displayHeaderFooter,omitempty"` // Display header and footer. Defaults to false. + PrintBackground *bool `json:"printBackground,omitempty"` // Print background graphics. Defaults to false. + Scale *float64 `json:"scale,omitempty"` // Scale of the webpage rendering. Defaults to 1. + PaperWidth *float64 `json:"paperWidth,omitempty"` // Paper width in inches. Defaults to 8.5 inches. + PaperHeight *float64 `json:"paperHeight,omitempty"` // Paper height in inches. Defaults to 11 inches. + MarginTop *float64 `json:"marginTop,omitempty"` // Top margin in inches. Defaults to 1cm (~0.4 inches). + MarginBottom *float64 `json:"marginBottom,omitempty"` // Bottom margin in inches. Defaults to 1cm (~0.4 inches). + MarginLeft *float64 `json:"marginLeft,omitempty"` // Left margin in inches. Defaults to 1cm (~0.4 inches). + MarginRight *float64 `json:"marginRight,omitempty"` // Right margin in inches. Defaults to 1cm (~0.4 inches). + PageRanges *string `json:"pageRanges,omitempty"` // Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are printed in the document order, not in the order specified, and no more than once. Defaults to empty string, which implies the entire document is printed. The page numbers are quietly capped to actual page count of the document, and ranges beyond the end of the document are ignored. If this results in no pages to print, an error is reported. It is an error to specify a range with start greater than end. + HeaderTemplate *string `json:"headerTemplate,omitempty"` // HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document For example, `` would generate span containing the title. + FooterTemplate *string `json:"footerTemplate,omitempty"` // HTML template for the print footer. Should use the same format as the `headerTemplate`. + PreferCSSPageSize *bool `json:"preferCSSPageSize,omitempty"` // Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. // TransferMode return as stream // // Values: "ReturnAsBase64", "ReturnAsStream". @@ -487,21 +489,18 @@ func (a *PrintToPDFArgs) SetMarginRight(marginRight float64) *PrintToPDFArgs { } // SetPageRanges sets the PageRanges optional argument. Paper ranges -// to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which -// means print all pages. +// to print, one based, e.g., '1-5, 8, 11-13'. Pages are printed in the +// document order, not in the order specified, and no more than once. +// Defaults to empty string, which implies the entire document is +// printed. The page numbers are quietly capped to actual page count of +// the document, and ranges beyond the end of the document are ignored. +// If this results in no pages to print, an error is reported. It is an +// error to specify a range with start greater than end. func (a *PrintToPDFArgs) SetPageRanges(pageRanges string) *PrintToPDFArgs { a.PageRanges = &pageRanges return a } -// SetIgnoreInvalidPageRanges sets the IgnoreInvalidPageRanges optional argument. -// Whether to silently ignore invalid but successfully parsed page -// ranges, such as '3-2'. Defaults to false. -func (a *PrintToPDFArgs) SetIgnoreInvalidPageRanges(ignoreInvalidPageRanges bool) *PrintToPDFArgs { - a.IgnoreInvalidPageRanges = &ignoreInvalidPageRanges - return a -} - // SetHeaderTemplate sets the HeaderTemplate optional argument. HTML // template for the print header. Should be valid HTML markup with // following classes used to inject printing values into them: - @@ -696,9 +695,27 @@ type GetPermissionsPolicyStateReply struct { States []PermissionsPolicyFeatureState `json:"states"` // No description. } +// GetOriginTrialsArgs represents the arguments for GetOriginTrials in the Page domain. +type GetOriginTrialsArgs struct { + FrameID FrameID `json:"frameId"` // No description. +} + +// NewGetOriginTrialsArgs initializes GetOriginTrialsArgs with the required arguments. +func NewGetOriginTrialsArgs(frameID FrameID) *GetOriginTrialsArgs { + args := new(GetOriginTrialsArgs) + args.FrameID = frameID + return args +} + +// GetOriginTrialsReply represents the return values for GetOriginTrials in the Page domain. +type GetOriginTrialsReply struct { + OriginTrials []OriginTrial `json:"originTrials"` // No description. +} + // SetFontFamiliesArgs represents the arguments for SetFontFamilies in the Page domain. type SetFontFamiliesArgs struct { - FontFamilies FontFamilies `json:"fontFamilies"` // Specifies font families to set. If a font family is not specified, it won't be changed. + FontFamilies FontFamilies `json:"fontFamilies"` // Specifies font families to set. If a font family is not specified, it won't be changed. + ForScripts []ScriptFontFamilies `json:"forScripts,omitempty"` // Specifies font families to set for individual scripts. } // NewSetFontFamiliesArgs initializes SetFontFamiliesArgs with the required arguments. @@ -708,6 +725,13 @@ func NewSetFontFamiliesArgs(fontFamilies FontFamilies) *SetFontFamiliesArgs { return args } +// SetForScripts sets the ForScripts optional argument. Specifies font +// families to set for individual scripts. +func (a *SetFontFamiliesArgs) SetForScripts(forScripts []ScriptFontFamilies) *SetFontFamiliesArgs { + a.ForScripts = forScripts + return a +} + // SetFontSizesArgs represents the arguments for SetFontSizes in the Page domain. type SetFontSizesArgs struct { FontSizes FontSizes `json:"fontSizes"` // Specifies font sizes to set. If a font size is not specified, it won't be changed. @@ -842,18 +866,6 @@ func NewSetWebLifecycleStateArgs(state string) *SetWebLifecycleStateArgs { return args } -// SetProduceCompilationCacheArgs represents the arguments for SetProduceCompilationCache in the Page domain. -type SetProduceCompilationCacheArgs struct { - Enabled bool `json:"enabled"` // No description. -} - -// NewSetProduceCompilationCacheArgs initializes SetProduceCompilationCacheArgs with the required arguments. -func NewSetProduceCompilationCacheArgs(enabled bool) *SetProduceCompilationCacheArgs { - args := new(SetProduceCompilationCacheArgs) - args.Enabled = enabled - return args -} - // ProduceCompilationCacheArgs represents the arguments for ProduceCompilationCache in the Page domain. type ProduceCompilationCacheArgs struct { Scripts []CompilationCacheParams `json:"scripts"` // No description. @@ -880,6 +892,21 @@ func NewAddCompilationCacheArgs(url string, data []byte) *AddCompilationCacheArg return args } +// SetSPCTransactionModeArgs represents the arguments for SetSPCTransactionMode in the Page domain. +type SetSPCTransactionModeArgs struct { + // Mode + // + // Values: "none", "autoaccept", "autoreject". + Mode string `json:"mode"` +} + +// NewSetSPCTransactionModeArgs initializes SetSPCTransactionModeArgs with the required arguments. +func NewSetSPCTransactionModeArgs(mode string) *SetSPCTransactionModeArgs { + args := new(SetSPCTransactionModeArgs) + args.Mode = mode + return args +} + // GenerateTestReportArgs represents the arguments for GenerateTestReport in the Page domain. type GenerateTestReportArgs struct { Message string `json:"message"` // Message to be displayed in the report. diff --git a/protocol/page/domain.go b/protocol/page/domain.go index a0c984a..6c257f7 100644 --- a/protocol/page/domain.go +++ b/protocol/page/domain.go @@ -152,6 +152,17 @@ func (d *domainClient) GetManifestIcons(ctx context.Context) (reply *GetManifest return } +// GetAppID invokes the Page method. Returns the unique (PWA) app id. Only +// returns values if the feature flag 'WebAppEnableManifestId' is enabled +func (d *domainClient) GetAppID(ctx context.Context) (reply *GetAppIDReply, err error) { + reply = new(GetAppIDReply) + err = rpcc.Invoke(ctx, "Page.getAppId", nil, reply, d.conn) + if err != nil { + err = &internal.OpError{Domain: "Page", Op: "GetAppID", Err: err} + } + return +} + // GetFrameTree invokes the Page method. Returns present frame tree structure. func (d *domainClient) GetFrameTree(ctx context.Context) (reply *GetFrameTreeReply, err error) { reply = new(GetFrameTreeReply) @@ -390,6 +401,20 @@ func (d *domainClient) GetPermissionsPolicyState(ctx context.Context, args *GetP return } +// GetOriginTrials invokes the Page method. Get Origin Trials on given frame. +func (d *domainClient) GetOriginTrials(ctx context.Context, args *GetOriginTrialsArgs) (reply *GetOriginTrialsReply, err error) { + reply = new(GetOriginTrialsReply) + if args != nil { + err = rpcc.Invoke(ctx, "Page.getOriginTrials", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "Page.getOriginTrials", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Page", Op: "GetOriginTrials", Err: err} + } + return +} + // SetFontFamilies invokes the Page method. Set generic font families. func (d *domainClient) SetFontFamilies(ctx context.Context, args *SetFontFamiliesArgs) (err error) { if args != nil { @@ -527,31 +552,12 @@ func (d *domainClient) StopScreencast(ctx context.Context) (err error) { return } -// SetProduceCompilationCache invokes the Page method. Forces compilation -// cache to be generated for every subresource script. See also: -// `Page.produceCompilationCache`. -func (d *domainClient) SetProduceCompilationCache(ctx context.Context, args *SetProduceCompilationCacheArgs) (err error) { - if args != nil { - err = rpcc.Invoke(ctx, "Page.setProduceCompilationCache", args, nil, d.conn) - } else { - err = rpcc.Invoke(ctx, "Page.setProduceCompilationCache", nil, nil, d.conn) - } - if err != nil { - err = &internal.OpError{Domain: "Page", Op: "SetProduceCompilationCache", Err: err} - } - return -} - // ProduceCompilationCache invokes the Page method. Requests backend to -// produce compilation cache for the specified scripts. Unlike -// setProduceCompilationCache, this allows client to only produce cache for -// specific scripts. `scripts` are appeneded to the list of scripts for which -// the cache for would produced. Disabling compilation cache with -// `setProduceCompilationCache` would reset all pending cache requests. The -// list may also be reset during page navigation. When script with a matching -// URL is encountered, the cache is optionally produced upon backend -// discretion, based on internal heuristics. See also: -// `Page.compilationCacheProduced`. +// produce compilation cache for the specified scripts. `scripts` are appeneded +// to the list of scripts for which the cache would be produced. The list may +// be reset during page navigation. When script with a matching URL is +// encountered, the cache is optionally produced upon backend discretion, based +// on internal heuristics. See also: `Page.compilationCacheProduced`. func (d *domainClient) ProduceCompilationCache(ctx context.Context, args *ProduceCompilationCacheArgs) (err error) { if args != nil { err = rpcc.Invoke(ctx, "Page.produceCompilationCache", args, nil, d.conn) @@ -588,6 +594,21 @@ func (d *domainClient) ClearCompilationCache(ctx context.Context) (err error) { return } +// SetSPCTransactionMode invokes the Page method. Sets the Secure Payment +// Confirmation transaction mode. +// https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode +func (d *domainClient) SetSPCTransactionMode(ctx context.Context, args *SetSPCTransactionModeArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Page.setSPCTransactionMode", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Page.setSPCTransactionMode", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Page", Op: "SetSPCTransactionMode", Err: err} + } + return +} + // GenerateTestReport invokes the Page method. Generates a report for testing. func (d *domainClient) GenerateTestReport(ctx context.Context, args *GenerateTestReportArgs) (err error) { if args != nil { @@ -1047,6 +1068,27 @@ func (c *backForwardCacheNotUsedClient) Recv() (*BackForwardCacheNotUsedReply, e return event, nil } +func (d *domainClient) PrerenderAttemptCompleted(ctx context.Context) (PrerenderAttemptCompletedClient, error) { + s, err := rpcc.NewStream(ctx, "Page.prerenderAttemptCompleted", d.conn) + if err != nil { + return nil, err + } + return &prerenderAttemptCompletedClient{Stream: s}, nil +} + +type prerenderAttemptCompletedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *prerenderAttemptCompletedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *prerenderAttemptCompletedClient) Recv() (*PrerenderAttemptCompletedReply, error) { + event := new(PrerenderAttemptCompletedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Page", Op: "PrerenderAttemptCompleted 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 5b0a45e..fddc1a9 100644 --- a/protocol/page/event.go +++ b/protocol/page/event.go @@ -336,9 +336,26 @@ type BackForwardCacheNotUsedClient interface { // 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. + 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. + NotRestoredExplanationsTree *BackForwardCacheNotRestoredExplanationTree `json:"notRestoredExplanationsTree,omitempty"` // Tree structure of reasons why the page could not be cached for each frame. +} + +// PrerenderAttemptCompletedClient is a client for PrerenderAttemptCompleted events. +// Fired when a prerender attempt is completed. +type PrerenderAttemptCompletedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*PrerenderAttemptCompletedReply, error) + rpcc.Stream +} + +// PrerenderAttemptCompletedReply is the reply for PrerenderAttemptCompleted events. +type PrerenderAttemptCompletedReply struct { + InitiatingFrameID FrameID `json:"initiatingFrameId"` // The frame id of the frame initiating prerendering. + PrerenderingURL string `json:"prerenderingUrl"` // No description. + FinalStatus PrerenderFinalStatus `json:"finalStatus"` // No description. } // LoadEventFiredClient is a client for LoadEventFired events. diff --git a/protocol/page/types.go b/protocol/page/types.go index e443e5c..1b922a9 100644 --- a/protocol/page/types.go +++ b/protocol/page/types.go @@ -167,22 +167,29 @@ const ( PermissionsPolicyFeatureAmbientLightSensor PermissionsPolicyFeature = "ambient-light-sensor" PermissionsPolicyFeatureAttributionReporting PermissionsPolicyFeature = "attribution-reporting" PermissionsPolicyFeatureAutoplay PermissionsPolicyFeature = "autoplay" + PermissionsPolicyFeatureBrowsingTopics PermissionsPolicyFeature = "browsing-topics" PermissionsPolicyFeatureCamera PermissionsPolicyFeature = "camera" PermissionsPolicyFeatureChDpr PermissionsPolicyFeature = "ch-dpr" PermissionsPolicyFeatureChDeviceMemory PermissionsPolicyFeature = "ch-device-memory" PermissionsPolicyFeatureChDownlink PermissionsPolicyFeature = "ch-downlink" PermissionsPolicyFeatureChEct PermissionsPolicyFeature = "ch-ect" - PermissionsPolicyFeatureChLang PermissionsPolicyFeature = "ch-lang" + PermissionsPolicyFeatureChPartitionedCookies PermissionsPolicyFeature = "ch-partitioned-cookies" PermissionsPolicyFeatureChPrefersColorScheme PermissionsPolicyFeature = "ch-prefers-color-scheme" PermissionsPolicyFeatureChRtt PermissionsPolicyFeature = "ch-rtt" + PermissionsPolicyFeatureChSaveData PermissionsPolicyFeature = "ch-save-data" 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" + PermissionsPolicyFeatureChUaFull PermissionsPolicyFeature = "ch-ua-full" PermissionsPolicyFeatureChUaFullVersion PermissionsPolicyFeature = "ch-ua-full-version" + PermissionsPolicyFeatureChUaFullVersionList PermissionsPolicyFeature = "ch-ua-full-version-list" PermissionsPolicyFeatureChUaPlatformVersion PermissionsPolicyFeature = "ch-ua-platform-version" + PermissionsPolicyFeatureChUaReduced PermissionsPolicyFeature = "ch-ua-reduced" + PermissionsPolicyFeatureChUaWow64 PermissionsPolicyFeature = "ch-ua-wow64" + PermissionsPolicyFeatureChViewportHeight PermissionsPolicyFeature = "ch-viewport-height" PermissionsPolicyFeatureChViewportWidth PermissionsPolicyFeature = "ch-viewport-width" PermissionsPolicyFeatureChWidth PermissionsPolicyFeature = "ch-width" PermissionsPolicyFeatureClipboardRead PermissionsPolicyFeature = "clipboard-read" @@ -203,6 +210,9 @@ const ( PermissionsPolicyFeatureHid PermissionsPolicyFeature = "hid" PermissionsPolicyFeatureIdleDetection PermissionsPolicyFeature = "idle-detection" PermissionsPolicyFeatureInterestCohort PermissionsPolicyFeature = "interest-cohort" + PermissionsPolicyFeatureJoinAdInterestGroup PermissionsPolicyFeature = "join-ad-interest-group" + PermissionsPolicyFeatureKeyboardMap PermissionsPolicyFeature = "keyboard-map" + PermissionsPolicyFeatureLocalFonts PermissionsPolicyFeature = "local-fonts" PermissionsPolicyFeatureMagnetometer PermissionsPolicyFeature = "magnetometer" PermissionsPolicyFeatureMicrophone PermissionsPolicyFeature = "microphone" PermissionsPolicyFeatureMidi PermissionsPolicyFeature = "midi" @@ -210,6 +220,7 @@ const ( PermissionsPolicyFeaturePayment PermissionsPolicyFeature = "payment" PermissionsPolicyFeaturePictureInPicture PermissionsPolicyFeature = "picture-in-picture" PermissionsPolicyFeaturePublickeyCredentialsGet PermissionsPolicyFeature = "publickey-credentials-get" + PermissionsPolicyFeatureRunAdAuction PermissionsPolicyFeature = "run-ad-auction" PermissionsPolicyFeatureScreenWakeLock PermissionsPolicyFeature = "screen-wake-lock" PermissionsPolicyFeatureSerial PermissionsPolicyFeature = "serial" PermissionsPolicyFeatureSharedAutofill PermissionsPolicyFeature = "shared-autofill" @@ -225,7 +236,7 @@ const ( func (e PermissionsPolicyFeature) Valid() bool { switch e { - 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": + case "accelerometer", "ambient-light-sensor", "attribution-reporting", "autoplay", "browsing-topics", "camera", "ch-dpr", "ch-device-memory", "ch-downlink", "ch-ect", "ch-partitioned-cookies", "ch-prefers-color-scheme", "ch-rtt", "ch-save-data", "ch-ua", "ch-ua-arch", "ch-ua-bitness", "ch-ua-platform", "ch-ua-model", "ch-ua-mobile", "ch-ua-full", "ch-ua-full-version", "ch-ua-full-version-list", "ch-ua-platform-version", "ch-ua-reduced", "ch-ua-wow64", "ch-viewport-height", "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", "join-ad-interest-group", "keyboard-map", "local-fonts", "magnetometer", "microphone", "midi", "otp-credentials", "payment", "picture-in-picture", "publickey-credentials-get", "run-ad-auction", "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 @@ -244,14 +255,15 @@ type PermissionsPolicyBlockReason string // PermissionsPolicyBlockReason as enums. const ( - PermissionsPolicyBlockReasonNotSet PermissionsPolicyBlockReason = "" - PermissionsPolicyBlockReasonHeader PermissionsPolicyBlockReason = "Header" - PermissionsPolicyBlockReasonIframeAttribute PermissionsPolicyBlockReason = "IframeAttribute" + PermissionsPolicyBlockReasonNotSet PermissionsPolicyBlockReason = "" + PermissionsPolicyBlockReasonHeader PermissionsPolicyBlockReason = "Header" + PermissionsPolicyBlockReasonIframeAttribute PermissionsPolicyBlockReason = "IframeAttribute" + PermissionsPolicyBlockReasonInFencedFrameTree PermissionsPolicyBlockReason = "InFencedFrameTree" ) func (e PermissionsPolicyBlockReason) Valid() bool { switch e { - case "Header", "IframeAttribute": + case "Header", "IframeAttribute", "InFencedFrameTree": return true default: return false @@ -300,11 +312,12 @@ const ( OriginTrialTokenStatusFeatureDisabled OriginTrialTokenStatus = "FeatureDisabled" OriginTrialTokenStatusTokenDisabled OriginTrialTokenStatus = "TokenDisabled" OriginTrialTokenStatusFeatureDisabledForUser OriginTrialTokenStatus = "FeatureDisabledForUser" + OriginTrialTokenStatusUnknownTrial OriginTrialTokenStatus = "UnknownTrial" ) func (e OriginTrialTokenStatus) Valid() bool { switch e { - case "Success", "NotSupported", "Insecure", "Expired", "WrongOrigin", "InvalidSignature", "Malformed", "WrongVersion", "FeatureDisabled", "TokenDisabled", "FeatureDisabledForUser": + case "Success", "NotSupported", "Insecure", "Expired", "WrongOrigin", "InvalidSignature", "Malformed", "WrongVersion", "FeatureDisabled", "TokenDisabled", "FeatureDisabledForUser", "UnknownTrial": return true default: return false @@ -443,11 +456,6 @@ 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. @@ -611,13 +619,21 @@ type Viewport struct { // // Note: This type is experimental. type FontFamilies struct { - Standard *string `json:"standard,omitempty"` // The standard font-family. - Fixed *string `json:"fixed,omitempty"` // The fixed font-family. - Serif *string `json:"serif,omitempty"` // The serif font-family. - SansSerif *string `json:"sansSerif,omitempty"` // The sansSerif font-family. - Cursive *string `json:"cursive,omitempty"` // The cursive font-family. - Fantasy *string `json:"fantasy,omitempty"` // The fantasy font-family. - Pictograph *string `json:"pictograph,omitempty"` // The pictograph font-family. + Standard *string `json:"standard,omitempty"` // The standard font-family. + Fixed *string `json:"fixed,omitempty"` // The fixed font-family. + Serif *string `json:"serif,omitempty"` // The serif font-family. + SansSerif *string `json:"sansSerif,omitempty"` // The sansSerif font-family. + Cursive *string `json:"cursive,omitempty"` // The cursive font-family. + Fantasy *string `json:"fantasy,omitempty"` // The fantasy font-family. + Math *string `json:"math,omitempty"` // The math font-family. +} + +// ScriptFontFamilies Font families collection for a script. +// +// Note: This type is experimental. +type ScriptFontFamilies struct { + Script string `json:"script"` // Name of the script which these font families are defined for. + FontFamilies FontFamilies `json:"fontFamilies"` // Generic font families collection for the script. } // FontSizes Default font sizes. @@ -775,106 +791,135 @@ 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" + BackForwardCacheNotRestoredReasonNotSet BackForwardCacheNotRestoredReason = "" + BackForwardCacheNotRestoredReasonNotPrimaryMainFrame BackForwardCacheNotRestoredReason = "NotPrimaryMainFrame" + 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" + 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" + BackForwardCacheNotRestoredReasonUnloadHandlerExistsInMainFrame BackForwardCacheNotRestoredReason = "UnloadHandlerExistsInMainFrame" + BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame BackForwardCacheNotRestoredReason = "UnloadHandlerExistsInSubFrame" + BackForwardCacheNotRestoredReasonServiceWorkerUnregistration BackForwardCacheNotRestoredReason = "ServiceWorkerUnregistration" + BackForwardCacheNotRestoredReasonCacheControlNoStore BackForwardCacheNotRestoredReason = "CacheControlNoStore" + BackForwardCacheNotRestoredReasonCacheControlNoStoreCookieModified BackForwardCacheNotRestoredReason = "CacheControlNoStoreCookieModified" + BackForwardCacheNotRestoredReasonCacheControlNoStoreHTTPOnlyCookieModified BackForwardCacheNotRestoredReason = "CacheControlNoStoreHTTPOnlyCookieModified" + BackForwardCacheNotRestoredReasonNoResponseHead BackForwardCacheNotRestoredReason = "NoResponseHead" + BackForwardCacheNotRestoredReasonUnknown BackForwardCacheNotRestoredReason = "Unknown" + BackForwardCacheNotRestoredReasonActivationNavigationsDisallowedForBug1234857 BackForwardCacheNotRestoredReason = "ActivationNavigationsDisallowedForBug1234857" + BackForwardCacheNotRestoredReasonErrorDocument BackForwardCacheNotRestoredReason = "ErrorDocument" + BackForwardCacheNotRestoredReasonFencedFramesEmbedder BackForwardCacheNotRestoredReason = "FencedFramesEmbedder" + BackForwardCacheNotRestoredReasonWebSocket BackForwardCacheNotRestoredReason = "WebSocket" + BackForwardCacheNotRestoredReasonWebTransport BackForwardCacheNotRestoredReason = "WebTransport" + 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" + 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" + BackForwardCacheNotRestoredReasonInjectedJavascript BackForwardCacheNotRestoredReason = "InjectedJavascript" + BackForwardCacheNotRestoredReasonInjectedStyleSheet BackForwardCacheNotRestoredReason = "InjectedStyleSheet" + BackForwardCacheNotRestoredReasonDummy BackForwardCacheNotRestoredReason = "Dummy" + BackForwardCacheNotRestoredReasonContentSecurityHandler BackForwardCacheNotRestoredReason = "ContentSecurityHandler" + BackForwardCacheNotRestoredReasonContentWebAuthenticationAPI BackForwardCacheNotRestoredReason = "ContentWebAuthenticationAPI" + BackForwardCacheNotRestoredReasonContentFileChooser BackForwardCacheNotRestoredReason = "ContentFileChooser" + BackForwardCacheNotRestoredReasonContentSerial BackForwardCacheNotRestoredReason = "ContentSerial" + BackForwardCacheNotRestoredReasonContentFileSystemAccess BackForwardCacheNotRestoredReason = "ContentFileSystemAccess" + BackForwardCacheNotRestoredReasonContentMediaDevicesDispatcherHost BackForwardCacheNotRestoredReason = "ContentMediaDevicesDispatcherHost" + BackForwardCacheNotRestoredReasonContentWebBluetooth BackForwardCacheNotRestoredReason = "ContentWebBluetooth" + BackForwardCacheNotRestoredReasonContentWebUSB BackForwardCacheNotRestoredReason = "ContentWebUSB" + BackForwardCacheNotRestoredReasonContentMediaSession BackForwardCacheNotRestoredReason = "ContentMediaSession" + BackForwardCacheNotRestoredReasonContentMediaSessionService BackForwardCacheNotRestoredReason = "ContentMediaSessionService" + BackForwardCacheNotRestoredReasonContentScreenReader BackForwardCacheNotRestoredReason = "ContentScreenReader" + BackForwardCacheNotRestoredReasonEmbedderPopupBlockerTabHelper BackForwardCacheNotRestoredReason = "EmbedderPopupBlockerTabHelper" + BackForwardCacheNotRestoredReasonEmbedderSafeBrowsingTriggeredPopupBlocker BackForwardCacheNotRestoredReason = "EmbedderSafeBrowsingTriggeredPopupBlocker" + BackForwardCacheNotRestoredReasonEmbedderSafeBrowsingThreatDetails BackForwardCacheNotRestoredReason = "EmbedderSafeBrowsingThreatDetails" + BackForwardCacheNotRestoredReasonEmbedderAppBannerManager BackForwardCacheNotRestoredReason = "EmbedderAppBannerManager" + BackForwardCacheNotRestoredReasonEmbedderDOMDistillerViewerSource BackForwardCacheNotRestoredReason = "EmbedderDomDistillerViewerSource" + BackForwardCacheNotRestoredReasonEmbedderDOMDistillerSelfDeletingRequestDelegate BackForwardCacheNotRestoredReason = "EmbedderDomDistillerSelfDeletingRequestDelegate" + BackForwardCacheNotRestoredReasonEmbedderOomInterventionTabHelper BackForwardCacheNotRestoredReason = "EmbedderOomInterventionTabHelper" + BackForwardCacheNotRestoredReasonEmbedderOfflinePage BackForwardCacheNotRestoredReason = "EmbedderOfflinePage" + BackForwardCacheNotRestoredReasonEmbedderChromePasswordManagerClientBindCredentialManager BackForwardCacheNotRestoredReason = "EmbedderChromePasswordManagerClientBindCredentialManager" + BackForwardCacheNotRestoredReasonEmbedderPermissionRequestManager BackForwardCacheNotRestoredReason = "EmbedderPermissionRequestManager" + BackForwardCacheNotRestoredReasonEmbedderModalDialog BackForwardCacheNotRestoredReason = "EmbedderModalDialog" + BackForwardCacheNotRestoredReasonEmbedderExtensions BackForwardCacheNotRestoredReason = "EmbedderExtensions" + BackForwardCacheNotRestoredReasonEmbedderExtensionMessaging BackForwardCacheNotRestoredReason = "EmbedderExtensionMessaging" + BackForwardCacheNotRestoredReasonEmbedderExtensionMessagingForOpenPort BackForwardCacheNotRestoredReason = "EmbedderExtensionMessagingForOpenPort" + BackForwardCacheNotRestoredReasonEmbedderExtensionSentMessageToCachedFrame BackForwardCacheNotRestoredReason = "EmbedderExtensionSentMessageToCachedFrame" ) 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": + case "NotPrimaryMainFrame", "BackForwardCacheDisabled", "RelatedActiveContentsExist", "HTTPStatusNotOK", "SchemeNotHTTPOrHTTPS", "Loading", "WasGrantedMediaAccess", "DisableForRenderFrameHostCalled", "DomainNotAllowed", "HTTPMethodNotGET", "SubframeIsNavigating", "Timeout", "CacheLimit", "JavaScriptExecution", "RendererProcessKilled", "RendererProcessCrashed", "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", "UnloadHandlerExistsInMainFrame", "UnloadHandlerExistsInSubFrame", "ServiceWorkerUnregistration", "CacheControlNoStore", "CacheControlNoStoreCookieModified", "CacheControlNoStoreHTTPOnlyCookieModified", "NoResponseHead", "Unknown", "ActivationNavigationsDisallowedForBug1234857", "ErrorDocument", "FencedFramesEmbedder", "WebSocket", "WebTransport", "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", "OutstandingNetworkRequestFetch", "OutstandingNetworkRequestXHR", "AppBanner", "Printing", "WebDatabase", "PictureInPicture", "Portal", "SpeechRecognizer", "IdleManager", "PaymentManager", "SpeechSynthesis", "KeyboardLock", "WebOTPService", "OutstandingNetworkRequestDirectSocket", "InjectedJavascript", "InjectedStyleSheet", "Dummy", "ContentSecurityHandler", "ContentWebAuthenticationAPI", "ContentFileChooser", "ContentSerial", "ContentFileSystemAccess", "ContentMediaDevicesDispatcherHost", "ContentWebBluetooth", "ContentWebUSB", "ContentMediaSession", "ContentMediaSessionService", "ContentScreenReader", "EmbedderPopupBlockerTabHelper", "EmbedderSafeBrowsingTriggeredPopupBlocker", "EmbedderSafeBrowsingThreatDetails", "EmbedderAppBannerManager", "EmbedderDomDistillerViewerSource", "EmbedderDomDistillerSelfDeletingRequestDelegate", "EmbedderOomInterventionTabHelper", "EmbedderOfflinePage", "EmbedderChromePasswordManagerClientBindCredentialManager", "EmbedderPermissionRequestManager", "EmbedderModalDialog", "EmbedderExtensions", "EmbedderExtensionMessaging", "EmbedderExtensionMessagingForOpenPort", "EmbedderExtensionSentMessageToCachedFrame": return true default: return false @@ -916,6 +961,70 @@ func (e BackForwardCacheNotRestoredReasonType) String() string { // // Note: This type is experimental. type BackForwardCacheNotRestoredExplanation struct { - Type BackForwardCacheNotRestoredReasonType `json:"type"` // Type of the reason - Reason BackForwardCacheNotRestoredReason `json:"reason"` // Not restored reason + Type BackForwardCacheNotRestoredReasonType `json:"type"` // Type of the reason + Reason BackForwardCacheNotRestoredReason `json:"reason"` // Not restored reason + Context *string `json:"context,omitempty"` // Context associated with the reason. The meaning of this context is dependent on the reason: - EmbedderExtensionSentMessageToCachedFrame: the extension ID. +} + +// BackForwardCacheNotRestoredExplanationTree +// +// Note: This type is experimental. +type BackForwardCacheNotRestoredExplanationTree struct { + URL string `json:"url"` // URL of each frame + Explanations []BackForwardCacheNotRestoredExplanation `json:"explanations"` // Not restored reasons of each frame + Children []BackForwardCacheNotRestoredExplanationTree `json:"children"` // Array of children frame +} + +// PrerenderFinalStatus List of FinalStatus reasons for Prerender2. +type PrerenderFinalStatus string + +// PrerenderFinalStatus as enums. +const ( + PrerenderFinalStatusNotSet PrerenderFinalStatus = "" + PrerenderFinalStatusActivated PrerenderFinalStatus = "Activated" + PrerenderFinalStatusDestroyed PrerenderFinalStatus = "Destroyed" + PrerenderFinalStatusLowEndDevice PrerenderFinalStatus = "LowEndDevice" + PrerenderFinalStatusCrossOriginRedirect PrerenderFinalStatus = "CrossOriginRedirect" + PrerenderFinalStatusCrossOriginNavigation PrerenderFinalStatus = "CrossOriginNavigation" + PrerenderFinalStatusInvalidSchemeRedirect PrerenderFinalStatus = "InvalidSchemeRedirect" + PrerenderFinalStatusInvalidSchemeNavigation PrerenderFinalStatus = "InvalidSchemeNavigation" + PrerenderFinalStatusInProgressNavigation PrerenderFinalStatus = "InProgressNavigation" + PrerenderFinalStatusNavigationRequestBlockedByCsp PrerenderFinalStatus = "NavigationRequestBlockedByCsp" + PrerenderFinalStatusMainFrameNavigation PrerenderFinalStatus = "MainFrameNavigation" + PrerenderFinalStatusMojoBinderPolicy PrerenderFinalStatus = "MojoBinderPolicy" + PrerenderFinalStatusRendererProcessCrashed PrerenderFinalStatus = "RendererProcessCrashed" + PrerenderFinalStatusRendererProcessKilled PrerenderFinalStatus = "RendererProcessKilled" + PrerenderFinalStatusDownload PrerenderFinalStatus = "Download" + PrerenderFinalStatusTriggerDestroyed PrerenderFinalStatus = "TriggerDestroyed" + PrerenderFinalStatusNavigationNotCommitted PrerenderFinalStatus = "NavigationNotCommitted" + PrerenderFinalStatusNavigationBadHTTPStatus PrerenderFinalStatus = "NavigationBadHttpStatus" + PrerenderFinalStatusClientCertRequested PrerenderFinalStatus = "ClientCertRequested" + PrerenderFinalStatusNavigationRequestNetworkError PrerenderFinalStatus = "NavigationRequestNetworkError" + PrerenderFinalStatusMaxNumOfRunningPrerendersExceeded PrerenderFinalStatus = "MaxNumOfRunningPrerendersExceeded" + PrerenderFinalStatusCancelAllHostsForTesting PrerenderFinalStatus = "CancelAllHostsForTesting" + PrerenderFinalStatusDidFailLoad PrerenderFinalStatus = "DidFailLoad" + PrerenderFinalStatusStop PrerenderFinalStatus = "Stop" + PrerenderFinalStatusSSLCertificateError PrerenderFinalStatus = "SslCertificateError" + PrerenderFinalStatusLoginAuthRequested PrerenderFinalStatus = "LoginAuthRequested" + PrerenderFinalStatusUaChangeRequiresReload PrerenderFinalStatus = "UaChangeRequiresReload" + PrerenderFinalStatusBlockedByClient PrerenderFinalStatus = "BlockedByClient" + PrerenderFinalStatusAudioOutputDeviceRequested PrerenderFinalStatus = "AudioOutputDeviceRequested" + PrerenderFinalStatusMixedContent PrerenderFinalStatus = "MixedContent" + PrerenderFinalStatusTriggerBackgrounded PrerenderFinalStatus = "TriggerBackgrounded" + PrerenderFinalStatusEmbedderTriggeredAndSameOriginRedirected PrerenderFinalStatus = "EmbedderTriggeredAndSameOriginRedirected" + PrerenderFinalStatusEmbedderTriggeredAndCrossOriginRedirected PrerenderFinalStatus = "EmbedderTriggeredAndCrossOriginRedirected" + PrerenderFinalStatusEmbedderTriggeredAndDestroyed PrerenderFinalStatus = "EmbedderTriggeredAndDestroyed" +) + +func (e PrerenderFinalStatus) Valid() bool { + switch e { + case "Activated", "Destroyed", "LowEndDevice", "CrossOriginRedirect", "CrossOriginNavigation", "InvalidSchemeRedirect", "InvalidSchemeNavigation", "InProgressNavigation", "NavigationRequestBlockedByCsp", "MainFrameNavigation", "MojoBinderPolicy", "RendererProcessCrashed", "RendererProcessKilled", "Download", "TriggerDestroyed", "NavigationNotCommitted", "NavigationBadHttpStatus", "ClientCertRequested", "NavigationRequestNetworkError", "MaxNumOfRunningPrerendersExceeded", "CancelAllHostsForTesting", "DidFailLoad", "Stop", "SslCertificateError", "LoginAuthRequested", "UaChangeRequiresReload", "BlockedByClient", "AudioOutputDeviceRequested", "MixedContent", "TriggerBackgrounded", "EmbedderTriggeredAndSameOriginRedirected", "EmbedderTriggeredAndCrossOriginRedirected", "EmbedderTriggeredAndDestroyed": + return true + default: + return false + } +} + +func (e PrerenderFinalStatus) String() string { + return string(e) } diff --git a/protocol/profiler/command.go b/protocol/profiler/command.go index 9a5e48e..4f3fe2f 100644 --- a/protocol/profiler/command.go +++ b/protocol/profiler/command.go @@ -74,13 +74,3 @@ type TakePreciseCoverageReply struct { type TakeTypeProfileReply struct { Result []ScriptTypeProfile `json:"result"` // Type profile for all scripts since startTypeProfile() was turned on. } - -// GetCountersReply represents the return values for GetCounters in the Profiler domain. -type GetCountersReply struct { - Result []CounterInfo `json:"result"` // Collected counters information. -} - -// GetRuntimeCallStatsReply represents the return values for GetRuntimeCallStats in the Profiler domain. -type GetRuntimeCallStatsReply struct { - Result []RuntimeCallCounterInfo `json:"result"` // Collected runtime call counter information. -} diff --git a/protocol/profiler/domain.go b/protocol/profiler/domain.go index 026ab5a..cc66c30 100644 --- a/protocol/profiler/domain.go +++ b/protocol/profiler/domain.go @@ -150,65 +150,6 @@ func (d *domainClient) TakeTypeProfile(ctx context.Context) (reply *TakeTypeProf return } -// EnableCounters invokes the Profiler method. Enable counters collection. -func (d *domainClient) EnableCounters(ctx context.Context) (err error) { - err = rpcc.Invoke(ctx, "Profiler.enableCounters", nil, nil, d.conn) - if err != nil { - err = &internal.OpError{Domain: "Profiler", Op: "EnableCounters", Err: err} - } - return -} - -// DisableCounters invokes the Profiler method. Disable counters collection. -func (d *domainClient) DisableCounters(ctx context.Context) (err error) { - err = rpcc.Invoke(ctx, "Profiler.disableCounters", nil, nil, d.conn) - if err != nil { - err = &internal.OpError{Domain: "Profiler", Op: "DisableCounters", Err: err} - } - return -} - -// GetCounters invokes the Profiler method. Retrieve counters. -func (d *domainClient) GetCounters(ctx context.Context) (reply *GetCountersReply, err error) { - reply = new(GetCountersReply) - err = rpcc.Invoke(ctx, "Profiler.getCounters", nil, reply, d.conn) - if err != nil { - err = &internal.OpError{Domain: "Profiler", Op: "GetCounters", Err: err} - } - return -} - -// EnableRuntimeCallStats invokes the Profiler method. Enable run time call -// stats collection. -func (d *domainClient) EnableRuntimeCallStats(ctx context.Context) (err error) { - err = rpcc.Invoke(ctx, "Profiler.enableRuntimeCallStats", nil, nil, d.conn) - if err != nil { - err = &internal.OpError{Domain: "Profiler", Op: "EnableRuntimeCallStats", Err: err} - } - return -} - -// DisableRuntimeCallStats invokes the Profiler method. Disable run time call -// stats collection. -func (d *domainClient) DisableRuntimeCallStats(ctx context.Context) (err error) { - err = rpcc.Invoke(ctx, "Profiler.disableRuntimeCallStats", nil, nil, d.conn) - if err != nil { - err = &internal.OpError{Domain: "Profiler", Op: "DisableRuntimeCallStats", Err: err} - } - return -} - -// GetRuntimeCallStats invokes the Profiler method. Retrieve run time call -// stats. -func (d *domainClient) GetRuntimeCallStats(ctx context.Context) (reply *GetRuntimeCallStatsReply, err error) { - reply = new(GetRuntimeCallStatsReply) - err = rpcc.Invoke(ctx, "Profiler.getRuntimeCallStats", nil, reply, d.conn) - if err != nil { - err = &internal.OpError{Domain: "Profiler", Op: "GetRuntimeCallStats", Err: err} - } - return -} - func (d *domainClient) ConsoleProfileFinished(ctx context.Context) (ConsoleProfileFinishedClient, error) { s, err := rpcc.NewStream(ctx, "Profiler.consoleProfileFinished", d.conn) if err != nil { diff --git a/protocol/profiler/event.go b/protocol/profiler/event.go index f705e2f..4be4242 100644 --- a/protocol/profiler/event.go +++ b/protocol/profiler/event.go @@ -55,6 +55,6 @@ type PreciseCoverageDeltaUpdateClient interface { // PreciseCoverageDeltaUpdateReply is the reply for PreciseCoverageDeltaUpdate events. type PreciseCoverageDeltaUpdateReply struct { Timestamp float64 `json:"timestamp"` // Monotonically increasing time (in seconds) when the coverage update was taken in the backend. - Occassion string `json:"occassion"` // Identifier for distinguishing coverage events. + Occasion string `json:"occasion"` // Identifier for distinguishing coverage events. Result []ScriptCoverage `json:"result"` // Coverage data for the current isolate. } diff --git a/protocol/profiler/types.go b/protocol/profiler/types.go index cd525f8..af23f6d 100644 --- a/protocol/profiler/types.go +++ b/protocol/profiler/types.go @@ -78,20 +78,3 @@ type ScriptTypeProfile struct { URL string `json:"url"` // JavaScript script name or url. Entries []TypeProfileEntry `json:"entries"` // Type profile entries for parameters and return values of the functions in the script. } - -// CounterInfo Collected counter information. -// -// Note: This type is experimental. -type CounterInfo struct { - Name string `json:"name"` // Counter name. - Value int `json:"value"` // Counter value. -} - -// RuntimeCallCounterInfo Runtime call counter information. -// -// Note: This type is experimental. -type RuntimeCallCounterInfo struct { - Name string `json:"name"` // Counter name. - Value float64 `json:"value"` // Counter value. - Time float64 `json:"time"` // Counter time in seconds. -} diff --git a/protocol/runtime/command.go b/protocol/runtime/command.go index 451de7f..5a4e118 100644 --- a/protocol/runtime/command.go +++ b/protocol/runtime/command.go @@ -52,6 +52,18 @@ type CallFunctionOnArgs struct { AwaitPromise *bool `json:"awaitPromise,omitempty"` // Whether execution should `await` for resulting value and return once awaited promise is resolved. ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` // Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. ObjectGroup *string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + // ThrowOnSideEffect Whether to throw an exception if side effect + // cannot be ruled out during evaluation. + // + // Note: This property is experimental. + ThrowOnSideEffect *bool `json:"throwOnSideEffect,omitempty"` + // GenerateWebDriverValue Whether the result should contain + // `webDriverValue`, serialized according to + // https://w3c.github.io/webdriver-bidi. This is mutually exclusive + // with `returnByValue`, but resulting `objectId` is still provided. + // + // Note: This property is experimental. + GenerateWebDriverValue *bool `json:"generateWebDriverValue,omitempty"` } // NewCallFunctionOnArgs initializes CallFunctionOnArgs with the required arguments. @@ -135,6 +147,28 @@ func (a *CallFunctionOnArgs) SetObjectGroup(objectGroup string) *CallFunctionOnA return a } +// SetThrowOnSideEffect sets the ThrowOnSideEffect optional argument. +// Whether to throw an exception if side effect cannot be ruled out +// during evaluation. +// +// Note: This property is experimental. +func (a *CallFunctionOnArgs) SetThrowOnSideEffect(throwOnSideEffect bool) *CallFunctionOnArgs { + a.ThrowOnSideEffect = &throwOnSideEffect + return a +} + +// SetGenerateWebDriverValue sets the GenerateWebDriverValue optional argument. +// Whether the result should contain `webDriverValue`, serialized +// according to https://w3c.github.io/webdriver-bidi. This is mutually +// exclusive with `returnByValue`, but resulting `objectId` is still +// provided. +// +// Note: This property is experimental. +func (a *CallFunctionOnArgs) SetGenerateWebDriverValue(generateWebDriverValue bool) *CallFunctionOnArgs { + a.GenerateWebDriverValue = &generateWebDriverValue + return a +} + // CallFunctionOnReply represents the return values for CallFunctionOn in the Runtime domain. type CallFunctionOnReply struct { Result RemoteObject `json:"result"` // Call result. @@ -225,6 +259,11 @@ type EvaluateArgs struct { // // Note: This property is experimental. UniqueContextID *string `json:"uniqueContextId,omitempty"` + // GenerateWebDriverValue Whether the result should be serialized + // according to https://w3c.github.io/webdriver-bidi. + // + // Note: This property is experimental. + GenerateWebDriverValue *bool `json:"generateWebDriverValue,omitempty"` } // NewEvaluateArgs initializes EvaluateArgs with the required arguments. @@ -366,6 +405,16 @@ func (a *EvaluateArgs) SetUniqueContextID(uniqueContextID string) *EvaluateArgs return a } +// SetGenerateWebDriverValue sets the GenerateWebDriverValue optional argument. +// Whether the result should be serialized according to +// https://w3c.github.io/webdriver-bidi. +// +// Note: This property is experimental. +func (a *EvaluateArgs) SetGenerateWebDriverValue(generateWebDriverValue bool) *EvaluateArgs { + a.GenerateWebDriverValue = &generateWebDriverValue + return a +} + // EvaluateReply represents the return values for Evaluate in the Runtime domain. type EvaluateReply struct { Result RemoteObject `json:"result"` // Evaluation result. @@ -397,6 +446,11 @@ type GetPropertiesArgs struct { // // Note: This property is experimental. GeneratePreview *bool `json:"generatePreview,omitempty"` + // NonIndexedPropertiesOnly If true, returns non-indexed properties + // only. + // + // Note: This property is experimental. + NonIndexedPropertiesOnly *bool `json:"nonIndexedPropertiesOnly,omitempty"` } // NewGetPropertiesArgs initializes GetPropertiesArgs with the required arguments. @@ -433,6 +487,15 @@ func (a *GetPropertiesArgs) SetGeneratePreview(generatePreview bool) *GetPropert return a } +// SetNonIndexedPropertiesOnly sets the NonIndexedPropertiesOnly optional argument. +// If true, returns non-indexed properties only. +// +// Note: This property is experimental. +func (a *GetPropertiesArgs) SetNonIndexedPropertiesOnly(nonIndexedPropertiesOnly bool) *GetPropertiesArgs { + a.NonIndexedPropertiesOnly = &nonIndexedPropertiesOnly + return a +} + // GetPropertiesReply represents the return values for GetProperties in the Runtime domain. type GetPropertiesReply struct { Result []PropertyDescriptor `json:"result"` // Object properties. @@ -624,8 +687,18 @@ func NewSetMaxCallStackSizeToCaptureArgs(size int) *SetMaxCallStackSizeToCapture // AddBindingArgs represents the arguments for AddBinding in the Runtime domain. type AddBindingArgs struct { - Name string `json:"name"` // No description. - ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` // If specified, the binding would only be exposed to the specified execution context. If omitted and `executionContextName` is not set, the binding is exposed to all execution contexts of the target. This parameter is mutually exclusive with `executionContextName`. + Name string `json:"name"` // No description. + // ExecutionContextID is deprecated. + // + // Deprecated: If specified, the binding would only be exposed to the + // specified execution context. If omitted and `executionContextName` + // is not set, the binding is exposed to all execution contexts of the + // target. This parameter is mutually exclusive with + // `executionContextName`. Deprecated in favor of + // `executionContextName` due to an unclear use case and bugs in + // implementation (crbug.com/1169639). `executionContextId` will be + // removed in the future. + ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` // ExecutionContextName If specified, the binding is exposed to the // executionContext with matching name, even for contexts created after // the binding is added. See also `ExecutionContext.name` and @@ -644,10 +717,15 @@ func NewAddBindingArgs(name string) *AddBindingArgs { } // SetExecutionContextID sets the ExecutionContextID optional argument. +// +// Deprecated: // If specified, the binding would only be exposed to the specified // execution context. If omitted and `executionContextName` is not set, // the binding is exposed to all execution contexts of the target. This // parameter is mutually exclusive with `executionContextName`. +// Deprecated in favor of `executionContextName` due to an unclear use +// case and bugs in implementation (crbug.com/1169639). +// `executionContextId` will be removed in the future. func (a *AddBindingArgs) SetExecutionContextID(executionContextID ExecutionContextID) *AddBindingArgs { a.ExecutionContextID = &executionContextID return a @@ -677,3 +755,20 @@ func NewRemoveBindingArgs(name string) *RemoveBindingArgs { args.Name = name return args } + +// GetExceptionDetailsArgs represents the arguments for GetExceptionDetails in the Runtime domain. +type GetExceptionDetailsArgs struct { + ErrorObjectID RemoteObjectID `json:"errorObjectId"` // The error object for which to resolve the exception details. +} + +// NewGetExceptionDetailsArgs initializes GetExceptionDetailsArgs with the required arguments. +func NewGetExceptionDetailsArgs(errorObjectID RemoteObjectID) *GetExceptionDetailsArgs { + args := new(GetExceptionDetailsArgs) + args.ErrorObjectID = errorObjectID + return args +} + +// GetExceptionDetailsReply represents the return values for GetExceptionDetails in the Runtime domain. +type GetExceptionDetailsReply struct { + ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // No description. +} diff --git a/protocol/runtime/domain.go b/protocol/runtime/domain.go index 85e8691..457d967 100644 --- a/protocol/runtime/domain.go +++ b/protocol/runtime/domain.go @@ -310,6 +310,23 @@ func (d *domainClient) RemoveBinding(ctx context.Context, args *RemoveBindingArg return } +// GetExceptionDetails invokes the Runtime method. This method tries to lookup +// and populate exception details for a JavaScript Error object. Note that the +// stackTrace portion of the resulting exceptionDetails will only be populated +// if the Runtime domain was enabled at the time when the Error was thrown. +func (d *domainClient) GetExceptionDetails(ctx context.Context, args *GetExceptionDetailsArgs) (reply *GetExceptionDetailsReply, err error) { + reply = new(GetExceptionDetailsReply) + if args != nil { + err = rpcc.Invoke(ctx, "Runtime.getExceptionDetails", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "Runtime.getExceptionDetails", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Runtime", Op: "GetExceptionDetails", Err: err} + } + return +} + func (d *domainClient) BindingCalled(ctx context.Context) (BindingCalledClient, error) { s, err := rpcc.NewStream(ctx, "Runtime.bindingCalled", d.conn) if err != nil { diff --git a/protocol/runtime/event.go b/protocol/runtime/event.go index 35853c2..88e3d58 100644 --- a/protocol/runtime/event.go +++ b/protocol/runtime/event.go @@ -136,4 +136,9 @@ type InspectRequestedClient interface { type InspectRequestedReply struct { Object RemoteObject `json:"object"` // No description. Hints json.RawMessage `json:"hints"` // No description. + // ExecutionContextID Identifier of the context where the call was + // made. + // + // Note: This property is experimental. + ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` } diff --git a/protocol/runtime/types.go b/protocol/runtime/types.go index 4a775a6..62b1052 100644 --- a/protocol/runtime/types.go +++ b/protocol/runtime/types.go @@ -11,6 +11,17 @@ import ( // ScriptID Unique script identifier. type ScriptID string +// WebDriverValue Represents the value serialiazed by the WebDriver BiDi +// specification https://w3c.github.io/webdriver-bidi. +type WebDriverValue struct { + // Type + // + // Values: "undefined", "null", "string", "number", "boolean", "bigint", "regexp", "date", "symbol", "array", "object", "function", "map", "set", "weakmap", "weakset", "error", "proxy", "promise", "typedarray", "arraybuffer", "node", "window". + Type string `json:"type"` + Value json.RawMessage `json:"value,omitempty"` // No description. + ObjectID *string `json:"objectId,omitempty"` // No description. +} + // RemoteObjectID Unique object identifier. type RemoteObjectID string @@ -34,7 +45,11 @@ type RemoteObject struct { Value json.RawMessage `json:"value,omitempty"` // Remote object value in case of primitive values or JSON values (if it was requested). UnserializableValue *UnserializableValue `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified does not have `value`, but gets this property. Description *string `json:"description,omitempty"` // String representation of the object. - ObjectID *RemoteObjectID `json:"objectId,omitempty"` // Unique object identifier (for non-primitive values). + // WebDriverValue WebDriver BiDi representation of the value. + // + // Note: This property is experimental. + WebDriverValue *WebDriverValue `json:"webDriverValue,omitempty"` + ObjectID *RemoteObjectID `json:"objectId,omitempty"` // Unique object identifier (for non-primitive values). // Preview Preview containing abbreviated property values. Specified // for `object` type values only. // @@ -170,6 +185,12 @@ type ExceptionDetails struct { StackTrace *StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace if available. Exception *RemoteObject `json:"exception,omitempty"` // Exception object if available. ExecutionContextID *ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where exception happened. + // ExceptionMetaData Dictionary with entries of meta data that the + // client associated with this exception, such as information about + // associated network requests, etc. + // + // Note: This property is experimental. + ExceptionMetaData json.RawMessage `json:"exceptionMetaData,omitempty"` } // Timestamp Number of milliseconds since epoch. diff --git a/protocol/security/event.go b/protocol/security/event.go index 19a8d26..0c5f66b 100644 --- a/protocol/security/event.go +++ b/protocol/security/event.go @@ -41,7 +41,7 @@ type VisibleSecurityStateChangedReply struct { } // StateChangedClient is a client for SecurityStateChanged events. The -// security state of the page changed. +// security state of the page changed. No longer being sent. type StateChangedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. @@ -56,11 +56,19 @@ type StateChangedReply struct { // // Deprecated: True if the page was loaded over cryptographic // transport such as HTTPS. - SchemeIsCryptographic bool `json:"schemeIsCryptographic"` - Explanations []StateExplanation `json:"explanations"` // List of explanations for the security state. If the overall security state is `insecure` or `warning`, at least one corresponding explanation should be included. + SchemeIsCryptographic bool `json:"schemeIsCryptographic"` + // Explanations is deprecated. + // + // Deprecated: Previously a list of explanations for the security + // state. Now always empty. + Explanations []StateExplanation `json:"explanations"` // InsecureContentStatus is deprecated. // // Deprecated: Information about insecure content on the page. InsecureContentStatus InsecureContentStatus `json:"insecureContentStatus"` - Summary *string `json:"summary,omitempty"` // Overrides user-visible description of the state. + // Summary is deprecated. + // + // Deprecated: Overrides user-visible description of the state. Always + // omitted. + Summary *string `json:"summary,omitempty"` } diff --git a/protocol/storage/command.go b/protocol/storage/command.go index a27703e..b6d5655 100644 --- a/protocol/storage/command.go +++ b/protocol/storage/command.go @@ -199,3 +199,34 @@ func NewClearTrustTokensArgs(issuerOrigin string) *ClearTrustTokensArgs { type ClearTrustTokensReply struct { DidDeleteTokens bool `json:"didDeleteTokens"` // True if any tokens were deleted, false otherwise. } + +// GetInterestGroupDetailsArgs represents the arguments for GetInterestGroupDetails in the Storage domain. +type GetInterestGroupDetailsArgs struct { + OwnerOrigin string `json:"ownerOrigin"` // No description. + Name string `json:"name"` // No description. +} + +// NewGetInterestGroupDetailsArgs initializes GetInterestGroupDetailsArgs with the required arguments. +func NewGetInterestGroupDetailsArgs(ownerOrigin string, name string) *GetInterestGroupDetailsArgs { + args := new(GetInterestGroupDetailsArgs) + args.OwnerOrigin = ownerOrigin + args.Name = name + return args +} + +// GetInterestGroupDetailsReply represents the return values for GetInterestGroupDetails in the Storage domain. +type GetInterestGroupDetailsReply struct { + Details InterestGroupDetails `json:"details"` // No description. +} + +// SetInterestGroupTrackingArgs represents the arguments for SetInterestGroupTracking in the Storage domain. +type SetInterestGroupTrackingArgs struct { + Enable bool `json:"enable"` // No description. +} + +// NewSetInterestGroupTrackingArgs initializes SetInterestGroupTrackingArgs with the required arguments. +func NewSetInterestGroupTrackingArgs(enable bool) *SetInterestGroupTrackingArgs { + args := new(SetInterestGroupTrackingArgs) + args.Enable = enable + return args +} diff --git a/protocol/storage/domain.go b/protocol/storage/domain.go index c05443c..2f24b85 100644 --- a/protocol/storage/domain.go +++ b/protocol/storage/domain.go @@ -183,6 +183,35 @@ func (d *domainClient) ClearTrustTokens(ctx context.Context, args *ClearTrustTok return } +// GetInterestGroupDetails invokes the Storage method. Gets details for a +// named interest group. +func (d *domainClient) GetInterestGroupDetails(ctx context.Context, args *GetInterestGroupDetailsArgs) (reply *GetInterestGroupDetailsReply, err error) { + reply = new(GetInterestGroupDetailsReply) + if args != nil { + err = rpcc.Invoke(ctx, "Storage.getInterestGroupDetails", args, reply, d.conn) + } else { + err = rpcc.Invoke(ctx, "Storage.getInterestGroupDetails", nil, reply, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Storage", Op: "GetInterestGroupDetails", Err: err} + } + return +} + +// SetInterestGroupTracking invokes the Storage method. Enables/Disables +// issuing of interestGroupAccessed events. +func (d *domainClient) SetInterestGroupTracking(ctx context.Context, args *SetInterestGroupTrackingArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Storage.setInterestGroupTracking", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Storage.setInterestGroupTracking", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Storage", Op: "SetInterestGroupTracking", Err: err} + } + return +} + func (d *domainClient) CacheStorageContentUpdated(ctx context.Context) (CacheStorageContentUpdatedClient, error) { s, err := rpcc.NewStream(ctx, "Storage.cacheStorageContentUpdated", d.conn) if err != nil { @@ -266,3 +295,24 @@ func (c *indexedDBListUpdatedClient) Recv() (*IndexedDBListUpdatedReply, error) } return event, nil } + +func (d *domainClient) InterestGroupAccessed(ctx context.Context) (InterestGroupAccessedClient, error) { + s, err := rpcc.NewStream(ctx, "Storage.interestGroupAccessed", d.conn) + if err != nil { + return nil, err + } + return &interestGroupAccessedClient{Stream: s}, nil +} + +type interestGroupAccessedClient struct{ rpcc.Stream } + +// GetStream returns the original Stream for use with cdp.Sync. +func (c *interestGroupAccessedClient) GetStream() rpcc.Stream { return c.Stream } + +func (c *interestGroupAccessedClient) Recv() (*InterestGroupAccessedReply, error) { + event := new(InterestGroupAccessedReply) + if err := c.RecvMsg(event); err != nil { + return nil, &internal.OpError{Domain: "Storage", Op: "InterestGroupAccessed Recv", Err: err} + } + return event, nil +} diff --git a/protocol/storage/event.go b/protocol/storage/event.go index 80229ce..f633a49 100644 --- a/protocol/storage/event.go +++ b/protocol/storage/event.go @@ -3,6 +3,7 @@ package storage import ( + "github.com/mafredri/cdp/protocol/network" "github.com/mafredri/cdp/rpcc" ) @@ -64,3 +65,20 @@ type IndexedDBListUpdatedClient interface { type IndexedDBListUpdatedReply struct { Origin string `json:"origin"` // Origin to update. } + +// InterestGroupAccessedClient is a client for InterestGroupAccessed events. +// One of the interest groups was accessed by the associated page. +type InterestGroupAccessedClient interface { + // Recv calls RecvMsg on rpcc.Stream, blocks until the event is + // triggered, context canceled or connection closed. + Recv() (*InterestGroupAccessedReply, error) + rpcc.Stream +} + +// InterestGroupAccessedReply is the reply for InterestGroupAccessed events. +type InterestGroupAccessedReply struct { + AccessTime network.TimeSinceEpoch `json:"accessTime"` // No description. + Type InterestGroupAccessType `json:"type"` // No description. + OwnerOrigin string `json:"ownerOrigin"` // No description. + Name string `json:"name"` // No description. +} diff --git a/protocol/storage/types.go b/protocol/storage/types.go index da9eae0..8d4350b 100644 --- a/protocol/storage/types.go +++ b/protocol/storage/types.go @@ -2,6 +2,13 @@ package storage +import ( + "github.com/mafredri/cdp/protocol/network" +) + +// SerializedStorageKey +type SerializedStorageKey string + // Type Enum of possible storage types. type Type string @@ -17,13 +24,14 @@ const ( TypeWebsql Type = "websql" TypeServiceWorkers Type = "service_workers" TypeCacheStorage Type = "cache_storage" + TypeInterestGroups Type = "interest_groups" TypeAll Type = "all" TypeOther Type = "other" ) func (e Type) Valid() bool { switch e { - case "appcache", "cookies", "file_systems", "indexeddb", "local_storage", "shader_cache", "websql", "service_workers", "cache_storage", "all", "other": + case "appcache", "cookies", "file_systems", "indexeddb", "local_storage", "shader_cache", "websql", "service_workers", "cache_storage", "interest_groups", "all", "other": return true default: return false @@ -48,3 +56,51 @@ type TrustTokens struct { IssuerOrigin string `json:"issuerOrigin"` // No description. Count float64 `json:"count"` // No description. } + +// InterestGroupAccessType Enum of interest group access types. +type InterestGroupAccessType string + +// InterestGroupAccessType as enums. +const ( + InterestGroupAccessTypeNotSet InterestGroupAccessType = "" + InterestGroupAccessTypeJoin InterestGroupAccessType = "join" + InterestGroupAccessTypeLeave InterestGroupAccessType = "leave" + InterestGroupAccessTypeUpdate InterestGroupAccessType = "update" + InterestGroupAccessTypeBid InterestGroupAccessType = "bid" + InterestGroupAccessTypeWin InterestGroupAccessType = "win" +) + +func (e InterestGroupAccessType) Valid() bool { + switch e { + case "join", "leave", "update", "bid", "win": + return true + default: + return false + } +} + +func (e InterestGroupAccessType) String() string { + return string(e) +} + +// InterestGroupAd Ad advertising element inside an interest group. +type InterestGroupAd struct { + RenderURL string `json:"renderUrl"` // No description. + Metadata *string `json:"metadata,omitempty"` // No description. +} + +// InterestGroupDetails The full details of an interest group. +type InterestGroupDetails struct { + OwnerOrigin string `json:"ownerOrigin"` // No description. + Name string `json:"name"` // No description. + ExpirationTime network.TimeSinceEpoch `json:"expirationTime"` // No description. + JoiningOrigin string `json:"joiningOrigin"` // No description. + BiddingURL *string `json:"biddingUrl,omitempty"` // No description. + BiddingWASMHelperURL *string `json:"biddingWasmHelperUrl,omitempty"` // No description. + UpdateURL *string `json:"updateUrl,omitempty"` // No description. + TrustedBiddingSignalsURL *string `json:"trustedBiddingSignalsUrl,omitempty"` // No description. + TrustedBiddingSignalsKeys []string `json:"trustedBiddingSignalsKeys"` // No description. + UserBiddingSignals *string `json:"userBiddingSignals,omitempty"` // No description. + Ads []InterestGroupAd `json:"ads"` // No description. + AdComponents []InterestGroupAd `json:"adComponents"` // No description. +} diff --git a/protocol/target/command.go b/protocol/target/command.go index 4f67c52..423e412 100644 --- a/protocol/target/command.go +++ b/protocol/target/command.go @@ -93,9 +93,10 @@ func (a *ExposeDevToolsProtocolArgs) SetBindingName(bindingName string) *ExposeD // CreateBrowserContextArgs represents the arguments for CreateBrowserContext in the Target domain. type CreateBrowserContextArgs struct { - DisposeOnDetach *bool `json:"disposeOnDetach,omitempty"` // If specified, disposes this context when debugging session disconnects. - ProxyServer *string `json:"proxyServer,omitempty"` // Proxy server, similar to the one passed to --proxy-server - ProxyBypassList *string `json:"proxyBypassList,omitempty"` // Proxy bypass list, similar to the one passed to --proxy-bypass-list + DisposeOnDetach *bool `json:"disposeOnDetach,omitempty"` // If specified, disposes this context when debugging session disconnects. + ProxyServer *string `json:"proxyServer,omitempty"` // Proxy server, similar to the one passed to --proxy-server + ProxyBypassList *string `json:"proxyBypassList,omitempty"` // Proxy bypass list, similar to the one passed to --proxy-bypass-list + OriginsWithUniversalNetworkAccess []string `json:"originsWithUniversalNetworkAccess,omitempty"` // An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored. } // NewCreateBrowserContextArgs initializes CreateBrowserContextArgs with the required arguments. @@ -126,6 +127,15 @@ func (a *CreateBrowserContextArgs) SetProxyBypassList(proxyBypassList string) *C return a } +// SetOriginsWithUniversalNetworkAccess sets the OriginsWithUniversalNetworkAccess optional argument. +// An optional list of origins to grant unlimited cross-origin access +// to. Parts of the URL other than those constituting origin are +// ignored. +func (a *CreateBrowserContextArgs) SetOriginsWithUniversalNetworkAccess(originsWithUniversalNetworkAccess []string) *CreateBrowserContextArgs { + a.OriginsWithUniversalNetworkAccess = originsWithUniversalNetworkAccess + return a +} + // CreateBrowserContextReply represents the return values for CreateBrowserContext in the Target domain. type CreateBrowserContextReply struct { BrowserContextID internal.BrowserContextID `json:"browserContextId"` // The id of the context created. @@ -138,10 +148,13 @@ type GetBrowserContextsReply struct { // CreateTargetArgs represents the arguments for CreateTarget in the Target domain. type CreateTargetArgs struct { - URL string `json:"url"` // The initial URL the page will be navigated to. An empty string indicates about:blank. - Width *int `json:"width,omitempty"` // Frame width in DIP (headless chrome only). - Height *int `json:"height,omitempty"` // Frame height in DIP (headless chrome only). - BrowserContextID *internal.BrowserContextID `json:"browserContextId,omitempty"` // The browser context to create the page in. + URL string `json:"url"` // The initial URL the page will be navigated to. An empty string indicates about:blank. + Width *int `json:"width,omitempty"` // Frame width in DIP (headless chrome only). + Height *int `json:"height,omitempty"` // Frame height in DIP (headless chrome only). + // BrowserContextID The browser context to create the page in. + // + // Note: This property is experimental. + BrowserContextID *internal.BrowserContextID `json:"browserContextId,omitempty"` // EnableBeginFrameControl Whether BeginFrames for this target will be // controlled via DevTools (headless chrome only, not supported on // MacOS yet, false by default). @@ -175,6 +188,8 @@ func (a *CreateTargetArgs) SetHeight(height int) *CreateTargetArgs { // SetBrowserContextID sets the BrowserContextID optional argument. // The browser context to create the page in. +// +// Note: This property is experimental. func (a *CreateTargetArgs) SetBrowserContextID(browserContextID internal.BrowserContextID) *CreateTargetArgs { a.BrowserContextID = &browserContextID return a @@ -338,6 +353,20 @@ func (a *SetAutoAttachArgs) SetFlatten(flatten bool) *SetAutoAttachArgs { return a } +// AutoAttachRelatedArgs represents the arguments for AutoAttachRelated in the Target domain. +type AutoAttachRelatedArgs struct { + TargetID ID `json:"targetId"` // No description. + WaitForDebuggerOnStart bool `json:"waitForDebuggerOnStart"` // Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger` to run paused targets. +} + +// NewAutoAttachRelatedArgs initializes AutoAttachRelatedArgs with the required arguments. +func NewAutoAttachRelatedArgs(targetID ID, waitForDebuggerOnStart bool) *AutoAttachRelatedArgs { + args := new(AutoAttachRelatedArgs) + args.TargetID = targetID + args.WaitForDebuggerOnStart = waitForDebuggerOnStart + return args +} + // SetDiscoverTargetsArgs represents the arguments for SetDiscoverTargets in the Target domain. type SetDiscoverTargetsArgs struct { Discover bool `json:"discover"` // Whether to discover available targets. diff --git a/protocol/target/domain.go b/protocol/target/domain.go index e870cb5..7a68ff7 100644 --- a/protocol/target/domain.go +++ b/protocol/target/domain.go @@ -209,7 +209,9 @@ func (d *domainClient) SendMessageToTarget(ctx context.Context, args *SendMessag // SetAutoAttach invokes the Target method. Controls whether to automatically // attach to new targets which are considered to be related to this one. When // turned on, attaches to all existing related targets as well. When turned -// off, automatically detaches from all currently attached targets. +// off, automatically detaches from all currently attached targets. This also +// clears all targets added by `autoAttachRelated` from the list of targets to +// watch for creation of related targets. func (d *domainClient) SetAutoAttach(ctx context.Context, args *SetAutoAttachArgs) (err error) { if args != nil { err = rpcc.Invoke(ctx, "Target.setAutoAttach", args, nil, d.conn) @@ -222,6 +224,25 @@ func (d *domainClient) SetAutoAttach(ctx context.Context, args *SetAutoAttachArg return } +// AutoAttachRelated invokes the Target method. Adds the specified target to +// the list of targets that will be monitored for any related target creation +// (such as child frames, child workers and new versions of service worker) and +// reported through `attachedToTarget`. The specified target is also +// auto-attached. This cancels the effect of any previous `setAutoAttach` and +// is also canceled by subsequent `setAutoAttach`. Only available at the +// Browser target. +func (d *domainClient) AutoAttachRelated(ctx context.Context, args *AutoAttachRelatedArgs) (err error) { + if args != nil { + err = rpcc.Invoke(ctx, "Target.autoAttachRelated", args, nil, d.conn) + } else { + err = rpcc.Invoke(ctx, "Target.autoAttachRelated", nil, nil, d.conn) + } + if err != nil { + err = &internal.OpError{Domain: "Target", Op: "AutoAttachRelated", Err: err} + } + return +} + // SetDiscoverTargets invokes the Target method. Controls whether to discover // available targets and notify via // `targetCreated/targetInfoChanged/targetDestroyed` events. diff --git a/protocol/webauthn/types.go b/protocol/webauthn/types.go index 29739d5..4f30f15 100644 --- a/protocol/webauthn/types.go +++ b/protocol/webauthn/types.go @@ -86,6 +86,7 @@ type VirtualAuthenticatorOptions struct { 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. + HasMinPinLength *bool `json:"hasMinPinLength,omitempty"` // If set to true, the authenticator will support the minPinLength extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-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. }