// Package page provides the Chrome DevTools Protocol // commands, types, and events for the Page domain. // // Actions and events related to the inspected page belong to the page // domain. // // Generated by the cdproto-gen command.
package page // Code generated by cdproto-gen. DO NOT EDIT. import ( ) // AddScriptToEvaluateOnNewDocumentParams evaluates given script in every // frame upon creation (before loading frame's scripts). type AddScriptToEvaluateOnNewDocumentParams struct { Source string `json:"source"` WorldName string `json:"worldName,omitempty"` // If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted. IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"` // Specifies whether command line API should be available to the script, defaults to false. RunImmediately bool `json:"runImmediately,omitempty"` // If true, runs the script immediately on existing execution contexts or worlds. Default: false. } // AddScriptToEvaluateOnNewDocument evaluates given script in every frame // upon creation (before loading frame's scripts). // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-addScriptToEvaluateOnNewDocument // // parameters: // // source func ( string) *AddScriptToEvaluateOnNewDocumentParams { return &AddScriptToEvaluateOnNewDocumentParams{ Source: , } } // WithWorldName if specified, creates an isolated world with the given name // and evaluates given script in it. This world name will be used as the // ExecutionContextDescription::name when the corresponding event is emitted. func ( AddScriptToEvaluateOnNewDocumentParams) ( string) *AddScriptToEvaluateOnNewDocumentParams { .WorldName = return & } // WithIncludeCommandLineAPI specifies whether command line API should be // available to the script, defaults to false. func ( AddScriptToEvaluateOnNewDocumentParams) ( bool) *AddScriptToEvaluateOnNewDocumentParams { .IncludeCommandLineAPI = return & } // WithRunImmediately if true, runs the script immediately on existing // execution contexts or worlds. Default: false. func ( AddScriptToEvaluateOnNewDocumentParams) ( bool) *AddScriptToEvaluateOnNewDocumentParams { .RunImmediately = return & } // AddScriptToEvaluateOnNewDocumentReturns return values. type AddScriptToEvaluateOnNewDocumentReturns struct { Identifier ScriptIdentifier `json:"identifier,omitempty"` // Identifier of the added script. } // Do executes Page.addScriptToEvaluateOnNewDocument against the provided context. // // returns: // // identifier - Identifier of the added script. func ( *AddScriptToEvaluateOnNewDocumentParams) ( context.Context) ( ScriptIdentifier, error) { // execute var AddScriptToEvaluateOnNewDocumentReturns = cdp.Execute(, CommandAddScriptToEvaluateOnNewDocument, , &) if != nil { return "", } return .Identifier, nil } // BringToFrontParams brings page to front (activates tab). type BringToFrontParams struct{} // BringToFront brings page to front (activates tab). // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-bringToFront func () *BringToFrontParams { return &BringToFrontParams{} } // Do executes Page.bringToFront against the provided context. func ( *BringToFrontParams) ( context.Context) ( error) { return cdp.Execute(, CommandBringToFront, nil, nil) } // CaptureScreenshotParams capture page screenshot. type CaptureScreenshotParams struct { Format CaptureScreenshotFormat `json:"format,omitempty"` // Image compression format (defaults to png). Quality int64 `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only). Clip *Viewport `json:"clip,omitempty"` // Capture the screenshot of a given region only. FromSurface bool `json:"fromSurface,omitempty"` // Capture the screenshot from the surface, rather than the view. Defaults to true. CaptureBeyondViewport bool `json:"captureBeyondViewport,omitempty"` // Capture the screenshot beyond the viewport. Defaults to false. OptimizeForSpeed bool `json:"optimizeForSpeed,omitempty"` // Optimize image encoding for speed, not for resulting size (defaults to false) } // CaptureScreenshot capture page screenshot. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-captureScreenshot // // parameters: func () *CaptureScreenshotParams { return &CaptureScreenshotParams{} } // WithFormat image compression format (defaults to png). func ( CaptureScreenshotParams) ( CaptureScreenshotFormat) *CaptureScreenshotParams { .Format = return & } // WithQuality compression quality from range [0..100] (jpeg only). func ( CaptureScreenshotParams) ( int64) *CaptureScreenshotParams { .Quality = return & } // WithClip capture the screenshot of a given region only. func ( CaptureScreenshotParams) ( *Viewport) *CaptureScreenshotParams { .Clip = return & } // WithFromSurface capture the screenshot from the surface, rather than the // view. Defaults to true. func ( CaptureScreenshotParams) ( bool) *CaptureScreenshotParams { .FromSurface = return & } // WithCaptureBeyondViewport capture the screenshot beyond the viewport. // Defaults to false. func ( CaptureScreenshotParams) ( bool) *CaptureScreenshotParams { .CaptureBeyondViewport = return & } // WithOptimizeForSpeed optimize image encoding for speed, not for resulting // size (defaults to false). func ( CaptureScreenshotParams) ( bool) *CaptureScreenshotParams { .OptimizeForSpeed = return & } // CaptureScreenshotReturns return values. type CaptureScreenshotReturns struct { Data string `json:"data,omitempty"` // Base64-encoded image data. } // Do executes Page.captureScreenshot against the provided context. // // returns: // // data - Base64-encoded image data. func ( *CaptureScreenshotParams) ( context.Context) ( []byte, error) { // execute var CaptureScreenshotReturns = cdp.Execute(, CommandCaptureScreenshot, , &) if != nil { return nil, } // decode var []byte , = base64.StdEncoding.DecodeString(.Data) if != nil { return nil, } return , nil } // CaptureSnapshotParams returns a snapshot of the page as a string. For // MHTML format, the serialization includes iframes, shadow DOM, external // resources, and element-inline styles. type CaptureSnapshotParams struct { Format CaptureSnapshotFormat `json:"format,omitempty"` // Format (defaults to mhtml). } // CaptureSnapshot returns a snapshot of the page as a string. For MHTML // format, the serialization includes iframes, shadow DOM, external resources, // and element-inline styles. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-captureSnapshot // // parameters: func () *CaptureSnapshotParams { return &CaptureSnapshotParams{} } // WithFormat format (defaults to mhtml). func ( CaptureSnapshotParams) ( CaptureSnapshotFormat) *CaptureSnapshotParams { .Format = return & } // CaptureSnapshotReturns return values. type CaptureSnapshotReturns struct { Data string `json:"data,omitempty"` // Serialized page data. } // Do executes Page.captureSnapshot against the provided context. // // returns: // // data - Serialized page data. func ( *CaptureSnapshotParams) ( context.Context) ( string, error) { // execute var CaptureSnapshotReturns = cdp.Execute(, CommandCaptureSnapshot, , &) if != nil { return "", } return .Data, nil } // CreateIsolatedWorldParams creates an isolated world for the given frame. type CreateIsolatedWorldParams struct { FrameID cdp.FrameID `json:"frameId"` // Id of the frame in which the isolated world should be created. WorldName string `json:"worldName,omitempty"` // An optional name which is reported in the Execution Context. GrantUniveralAccess bool `json:"grantUniveralAccess,omitempty"` // Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution. } // CreateIsolatedWorld creates an isolated world for the given frame. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-createIsolatedWorld // // parameters: // // frameID - Id of the frame in which the isolated world should be created. func ( cdp.FrameID) *CreateIsolatedWorldParams { return &CreateIsolatedWorldParams{ FrameID: , } } // WithWorldName an optional name which is reported in the Execution Context. func ( CreateIsolatedWorldParams) ( string) *CreateIsolatedWorldParams { .WorldName = return & } // WithGrantUniveralAccess whether or not universal access should be granted // to the isolated world. This is a powerful option, use with caution. func ( CreateIsolatedWorldParams) ( bool) *CreateIsolatedWorldParams { .GrantUniveralAccess = return & } // CreateIsolatedWorldReturns return values. type CreateIsolatedWorldReturns struct { ExecutionContextID runtime.ExecutionContextID `json:"executionContextId,omitempty"` // Execution context of the isolated world. } // Do executes Page.createIsolatedWorld against the provided context. // // returns: // // executionContextID - Execution context of the isolated world. func ( *CreateIsolatedWorldParams) ( context.Context) ( runtime.ExecutionContextID, error) { // execute var CreateIsolatedWorldReturns = cdp.Execute(, CommandCreateIsolatedWorld, , &) if != nil { return 0, } return .ExecutionContextID, nil } // DisableParams disables page domain notifications. type DisableParams struct{} // Disable disables page domain notifications. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-disable func () *DisableParams { return &DisableParams{} } // Do executes Page.disable against the provided context. func ( *DisableParams) ( context.Context) ( error) { return cdp.Execute(, CommandDisable, nil, nil) } // EnableParams enables page domain notifications. type EnableParams struct{} // Enable enables page domain notifications. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-enable func () *EnableParams { return &EnableParams{} } // Do executes Page.enable against the provided context. func ( *EnableParams) ( context.Context) ( error) { return cdp.Execute(, CommandEnable, nil, nil) } // GetAppManifestParams [no description]. type GetAppManifestParams struct{} // GetAppManifest [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getAppManifest func () *GetAppManifestParams { return &GetAppManifestParams{} } // GetAppManifestReturns return values. type GetAppManifestReturns struct { URL string `json:"url,omitempty"` // Manifest location. Errors []*AppManifestError `json:"errors,omitempty"` Data string `json:"data,omitempty"` // Manifest content. Parsed *AppManifestParsedProperties `json:"parsed,omitempty"` // Parsed manifest properties } // Do executes Page.getAppManifest against the provided context. // // returns: // // url - Manifest location. // errors // data - Manifest content. // parsed - Parsed manifest properties func ( *GetAppManifestParams) ( context.Context) ( string, []*AppManifestError, string, *AppManifestParsedProperties, error) { // execute var GetAppManifestReturns = cdp.Execute(, CommandGetAppManifest, nil, &) if != nil { return "", nil, "", nil, } return .URL, .Errors, .Data, .Parsed, nil } // GetInstallabilityErrorsParams [no description]. type GetInstallabilityErrorsParams struct{} // GetInstallabilityErrors [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getInstallabilityErrors func () *GetInstallabilityErrorsParams { return &GetInstallabilityErrorsParams{} } // GetInstallabilityErrorsReturns return values. type GetInstallabilityErrorsReturns struct { InstallabilityErrors []*InstallabilityError `json:"installabilityErrors,omitempty"` } // Do executes Page.getInstallabilityErrors against the provided context. // // returns: // // installabilityErrors func ( *GetInstallabilityErrorsParams) ( context.Context) ( []*InstallabilityError, error) { // execute var GetInstallabilityErrorsReturns = cdp.Execute(, CommandGetInstallabilityErrors, nil, &) if != nil { return nil, } return .InstallabilityErrors, nil } // GetAppIDParams returns the unique (PWA) app id. Only returns values if the // feature flag 'WebAppEnableManifestId' is enabled. type GetAppIDParams struct{} // GetAppID returns the unique (PWA) app id. Only returns values if the // feature flag 'WebAppEnableManifestId' is enabled. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getAppId func () *GetAppIDParams { return &GetAppIDParams{} } // GetAppIDReturns return values. type GetAppIDReturns 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 } // Do executes Page.getAppId against the provided context. // // returns: // // appID - App id, either from manifest's id attribute or computed from start_url // recommendedID - Recommendation for manifest's id attribute to match current id computed from start_url func ( *GetAppIDParams) ( context.Context) ( string, string, error) { // execute var GetAppIDReturns = cdp.Execute(, CommandGetAppID, nil, &) if != nil { return "", "", } return .AppID, .RecommendedID, nil } // GetAdScriptIDParams [no description]. type GetAdScriptIDParams struct { FrameID cdp.FrameID `json:"frameId"` } // GetAdScriptID [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getAdScriptId // // parameters: // // frameID func ( cdp.FrameID) *GetAdScriptIDParams { return &GetAdScriptIDParams{ FrameID: , } } // GetAdScriptIDReturns return values. type GetAdScriptIDReturns struct { AdScriptID *AdScriptID `json:"adScriptId,omitempty"` // Identifies the bottom-most script which caused the frame to be labelled as an ad. Only sent if frame is labelled as an ad and id is available. } // Do executes Page.getAdScriptId against the provided context. // // returns: // // adScriptID - Identifies the bottom-most script which caused the frame to be labelled as an ad. Only sent if frame is labelled as an ad and id is available. func ( *GetAdScriptIDParams) ( context.Context) ( *AdScriptID, error) { // execute var GetAdScriptIDReturns = cdp.Execute(, CommandGetAdScriptID, , &) if != nil { return nil, } return .AdScriptID, nil } // GetFrameTreeParams returns present frame tree structure. type GetFrameTreeParams struct{} // GetFrameTree returns present frame tree structure. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getFrameTree func () *GetFrameTreeParams { return &GetFrameTreeParams{} } // GetFrameTreeReturns return values. type GetFrameTreeReturns struct { FrameTree *FrameTree `json:"frameTree,omitempty"` // Present frame tree structure. } // Do executes Page.getFrameTree against the provided context. // // returns: // // frameTree - Present frame tree structure. func ( *GetFrameTreeParams) ( context.Context) ( *FrameTree, error) { // execute var GetFrameTreeReturns = cdp.Execute(, CommandGetFrameTree, nil, &) if != nil { return nil, } return .FrameTree, nil } // GetLayoutMetricsParams returns metrics relating to the layouting of the // page, such as viewport bounds/scale. type GetLayoutMetricsParams struct{} // GetLayoutMetrics returns metrics relating to the layouting of the page, // such as viewport bounds/scale. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getLayoutMetrics func () *GetLayoutMetricsParams { return &GetLayoutMetricsParams{} } // GetLayoutMetricsReturns return values. type GetLayoutMetricsReturns struct { LayoutViewport *LayoutViewport `json:"layoutViewport"` // Deprecated metrics relating to the layout viewport. Is in device pixels. Use cssLayoutViewport instead. VisualViewport *VisualViewport `json:"visualViewport"` // Deprecated metrics relating to the visual viewport. Is in device pixels. Use cssVisualViewport instead. ContentSize *dom.Rect `json:"contentSize"` // Deprecated size of scrollable area. Is in DP. Use cssContentSize instead. CSSLayoutViewport *LayoutViewport `json:"cssLayoutViewport"` // Metrics relating to the layout viewport in CSS pixels. CSSVisualViewport *VisualViewport `json:"cssVisualViewport"` // Metrics relating to the visual viewport in CSS pixels. CSSContentSize *dom.Rect `json:"cssContentSize"` // Size of scrollable area in CSS pixels. } // Do executes Page.getLayoutMetrics against the provided context. // // returns: // // layoutViewport - Deprecated metrics relating to the layout viewport. Is in device pixels. Use cssLayoutViewport instead. // visualViewport - Deprecated metrics relating to the visual viewport. Is in device pixels. Use cssVisualViewport instead. // contentSize - Deprecated size of scrollable area. Is in DP. Use cssContentSize instead. // cssLayoutViewport - Metrics relating to the layout viewport in CSS pixels. // cssVisualViewport - Metrics relating to the visual viewport in CSS pixels. // cssContentSize - Size of scrollable area in CSS pixels. func ( *GetLayoutMetricsParams) ( context.Context) ( *LayoutViewport, *VisualViewport, *dom.Rect, *LayoutViewport, *VisualViewport, *dom.Rect, error) { // execute var GetLayoutMetricsReturns = cdp.Execute(, CommandGetLayoutMetrics, nil, &) if != nil { return nil, nil, nil, nil, nil, nil, } return .LayoutViewport, .VisualViewport, .ContentSize, .CSSLayoutViewport, .CSSVisualViewport, .CSSContentSize, nil } // GetNavigationHistoryParams returns navigation history for the current // page. type GetNavigationHistoryParams struct{} // GetNavigationHistory returns navigation history for the current page. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getNavigationHistory func () *GetNavigationHistoryParams { return &GetNavigationHistoryParams{} } // GetNavigationHistoryReturns return values. type GetNavigationHistoryReturns struct { CurrentIndex int64 `json:"currentIndex,omitempty"` // Index of the current navigation history entry. Entries []*NavigationEntry `json:"entries,omitempty"` // Array of navigation history entries. } // Do executes Page.getNavigationHistory against the provided context. // // returns: // // currentIndex - Index of the current navigation history entry. // entries - Array of navigation history entries. func ( *GetNavigationHistoryParams) ( context.Context) ( int64, []*NavigationEntry, error) { // execute var GetNavigationHistoryReturns = cdp.Execute(, CommandGetNavigationHistory, nil, &) if != nil { return 0, nil, } return .CurrentIndex, .Entries, nil } // ResetNavigationHistoryParams resets navigation history for the current // page. type ResetNavigationHistoryParams struct{} // ResetNavigationHistory resets navigation history for the current page. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-resetNavigationHistory func () *ResetNavigationHistoryParams { return &ResetNavigationHistoryParams{} } // Do executes Page.resetNavigationHistory against the provided context. func ( *ResetNavigationHistoryParams) ( context.Context) ( error) { return cdp.Execute(, CommandResetNavigationHistory, nil, nil) } // GetResourceContentParams returns content of the given resource. type GetResourceContentParams struct { FrameID cdp.FrameID `json:"frameId"` // Frame id to get resource for. URL string `json:"url"` // URL of the resource to get content for. } // GetResourceContent returns content of the given resource. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getResourceContent // // parameters: // // frameID - Frame id to get resource for. // url - URL of the resource to get content for. func ( cdp.FrameID, string) *GetResourceContentParams { return &GetResourceContentParams{ FrameID: , URL: , } } // GetResourceContentReturns return values. type GetResourceContentReturns struct { Content string `json:"content,omitempty"` // Resource content. Base64encoded bool `json:"base64Encoded,omitempty"` // True, if content was served as base64. } // Do executes Page.getResourceContent against the provided context. // // returns: // // content - Resource content. func ( *GetResourceContentParams) ( context.Context) ( []byte, error) { // execute var GetResourceContentReturns = cdp.Execute(, CommandGetResourceContent, , &) if != nil { return nil, } // decode var []byte if .Base64encoded { , = base64.StdEncoding.DecodeString(.Content) if != nil { return nil, } } else { = []byte(.Content) } return , nil } // GetResourceTreeParams returns present frame / resource tree structure. type GetResourceTreeParams struct{} // GetResourceTree returns present frame / resource tree structure. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getResourceTree func () *GetResourceTreeParams { return &GetResourceTreeParams{} } // GetResourceTreeReturns return values. type GetResourceTreeReturns struct { FrameTree *FrameResourceTree `json:"frameTree,omitempty"` // Present frame / resource tree structure. } // Do executes Page.getResourceTree against the provided context. // // returns: // // frameTree - Present frame / resource tree structure. func ( *GetResourceTreeParams) ( context.Context) ( *FrameResourceTree, error) { // execute var GetResourceTreeReturns = cdp.Execute(, CommandGetResourceTree, nil, &) if != nil { return nil, } return .FrameTree, nil } // HandleJavaScriptDialogParams accepts or dismisses a JavaScript initiated // dialog (alert, confirm, prompt, or onbeforeunload). type HandleJavaScriptDialogParams struct { Accept bool `json:"accept"` // Whether to accept or dismiss the dialog. PromptText string `json:"promptText,omitempty"` // The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog. } // HandleJavaScriptDialog accepts or dismisses a JavaScript initiated dialog // (alert, confirm, prompt, or onbeforeunload). // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-handleJavaScriptDialog // // parameters: // // accept - Whether to accept or dismiss the dialog. func ( bool) *HandleJavaScriptDialogParams { return &HandleJavaScriptDialogParams{ Accept: , } } // WithPromptText the text to enter into the dialog prompt before accepting. // Used only if this is a prompt dialog. func ( HandleJavaScriptDialogParams) ( string) *HandleJavaScriptDialogParams { .PromptText = return & } // Do executes Page.handleJavaScriptDialog against the provided context. func ( *HandleJavaScriptDialogParams) ( context.Context) ( error) { return cdp.Execute(, CommandHandleJavaScriptDialog, , nil) } // NavigateParams navigates current page to the given URL. type NavigateParams struct { URL string `json:"url"` // URL to navigate the page to. Referrer string `json:"referrer,omitempty"` // Referrer URL. TransitionType TransitionType `json:"transitionType,omitempty"` // Intended transition type. FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame id to navigate, if not specified navigates the top frame. ReferrerPolicy ReferrerPolicy `json:"referrerPolicy,omitempty"` // Referrer-policy used for the navigation. } // Navigate navigates current page to the given URL. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-navigate // // parameters: // // url - URL to navigate the page to. func ( string) *NavigateParams { return &NavigateParams{ URL: , } } // WithReferrer referrer URL. func ( NavigateParams) ( string) *NavigateParams { .Referrer = return & } // WithTransitionType intended transition type. func ( NavigateParams) ( TransitionType) *NavigateParams { .TransitionType = return & } // WithFrameID frame id to navigate, if not specified navigates the top // frame. func ( NavigateParams) ( cdp.FrameID) *NavigateParams { .FrameID = return & } // WithReferrerPolicy referrer-policy used for the navigation. func ( NavigateParams) ( ReferrerPolicy) *NavigateParams { .ReferrerPolicy = return & } // NavigateReturns return values. type NavigateReturns struct { FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame id that has navigated (or failed to navigate) LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // Loader identifier. This is omitted in case of same-document navigation, as the previously committed loaderId would not change. ErrorText string `json:"errorText,omitempty"` // User friendly error message, present if and only if navigation has failed. } // Do executes Page.navigate against the provided context. // // returns: // // frameID - Frame id that has navigated (or failed to navigate) // loaderID - Loader identifier. This is omitted in case of same-document navigation, as the previously committed loaderId would not change. // errorText - User friendly error message, present if and only if navigation has failed. func ( *NavigateParams) ( context.Context) ( cdp.FrameID, cdp.LoaderID, string, error) { // execute var NavigateReturns = cdp.Execute(, CommandNavigate, , &) if != nil { return "", "", "", } return .FrameID, .LoaderID, .ErrorText, nil } // NavigateToHistoryEntryParams navigates current page to the given history // entry. type NavigateToHistoryEntryParams struct { EntryID int64 `json:"entryId"` // Unique id of the entry to navigate to. } // NavigateToHistoryEntry navigates current page to the given history entry. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-navigateToHistoryEntry // // parameters: // // entryID - Unique id of the entry to navigate to. func ( int64) *NavigateToHistoryEntryParams { return &NavigateToHistoryEntryParams{ EntryID: , } } // Do executes Page.navigateToHistoryEntry against the provided context. func ( *NavigateToHistoryEntryParams) ( context.Context) ( error) { return cdp.Execute(, CommandNavigateToHistoryEntry, , nil) } // PrintToPDFParams print page as PDF. type PrintToPDFParams 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"` // Top margin in inches. Defaults to 1cm (~0.4 inches). MarginBottom float64 `json:"marginBottom"` // Bottom margin in inches. Defaults to 1cm (~0.4 inches). MarginLeft float64 `json:"marginLeft"` // Left margin in inches. Defaults to 1cm (~0.4 inches). MarginRight float64 `json:"marginRight"` // 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, <span class=title></span> 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 PrintToPDFTransferMode `json:"transferMode,omitempty"` // return as stream GenerateTaggedPDF bool `json:"generateTaggedPDF,omitempty"` // Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice. } // PrintToPDF print page as PDF. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-printToPDF // // parameters: func () *PrintToPDFParams { return &PrintToPDFParams{} } // WithLandscape paper orientation. Defaults to false. func ( PrintToPDFParams) ( bool) *PrintToPDFParams { .Landscape = return & } // WithDisplayHeaderFooter display header and footer. Defaults to false. func ( PrintToPDFParams) ( bool) *PrintToPDFParams { .DisplayHeaderFooter = return & } // WithPrintBackground print background graphics. Defaults to false. func ( PrintToPDFParams) ( bool) *PrintToPDFParams { .PrintBackground = return & } // WithScale scale of the webpage rendering. Defaults to 1. func ( PrintToPDFParams) ( float64) *PrintToPDFParams { .Scale = return & } // WithPaperWidth paper width in inches. Defaults to 8.5 inches. func ( PrintToPDFParams) ( float64) *PrintToPDFParams { .PaperWidth = return & } // WithPaperHeight paper height in inches. Defaults to 11 inches. func ( PrintToPDFParams) ( float64) *PrintToPDFParams { .PaperHeight = return & } // WithMarginTop top margin in inches. Defaults to 1cm (~0.4 inches). func ( PrintToPDFParams) ( float64) *PrintToPDFParams { .MarginTop = return & } // WithMarginBottom bottom margin in inches. Defaults to 1cm (~0.4 inches). func ( PrintToPDFParams) ( float64) *PrintToPDFParams { .MarginBottom = return & } // WithMarginLeft left margin in inches. Defaults to 1cm (~0.4 inches). func ( PrintToPDFParams) ( float64) *PrintToPDFParams { .MarginLeft = return & } // WithMarginRight right margin in inches. Defaults to 1cm (~0.4 inches). func ( PrintToPDFParams) ( float64) *PrintToPDFParams { .MarginRight = return & } // WithPageRanges 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. func ( PrintToPDFParams) ( string) *PrintToPDFParams { .PageRanges = return & } // WithHeaderTemplate 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, <span class=title></span> would generate span containing the // title. func ( PrintToPDFParams) ( string) *PrintToPDFParams { .HeaderTemplate = return & } // WithFooterTemplate HTML template for the print footer. Should use the same // format as the headerTemplate. func ( PrintToPDFParams) ( string) *PrintToPDFParams { .FooterTemplate = return & } // WithPreferCSSPageSize 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. func ( PrintToPDFParams) ( bool) *PrintToPDFParams { .PreferCSSPageSize = return & } // WithTransferMode return as stream. func ( PrintToPDFParams) ( PrintToPDFTransferMode) *PrintToPDFParams { .TransferMode = return & } // WithGenerateTaggedPDF whether or not to generate tagged (accessible) PDF. // Defaults to embedder choice. func ( PrintToPDFParams) ( bool) *PrintToPDFParams { .GenerateTaggedPDF = return & } // PrintToPDFReturns return values. type PrintToPDFReturns struct { Data string `json:"data,omitempty"` // Base64-encoded pdf data. Empty if |returnAsStream| is specified. Stream io.StreamHandle `json:"stream,omitempty"` // A handle of the stream that holds resulting PDF data. } // Do executes Page.printToPDF against the provided context. // // returns: // // data - Base64-encoded pdf data. Empty if |returnAsStream| is specified. // stream - A handle of the stream that holds resulting PDF data. func ( *PrintToPDFParams) ( context.Context) ( []byte, io.StreamHandle, error) { // execute var PrintToPDFReturns = cdp.Execute(, CommandPrintToPDF, , &) if != nil { return nil, "", } // decode var []byte , = base64.StdEncoding.DecodeString(.Data) if != nil { return nil, "", } return , .Stream, nil } // ReloadParams reloads given page optionally ignoring the cache. type ReloadParams struct { IgnoreCache bool `json:"ignoreCache,omitempty"` // If true, browser cache is ignored (as if the user pressed Shift+refresh). ScriptToEvaluateOnLoad string `json:"scriptToEvaluateOnLoad,omitempty"` // If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin. } // Reload reloads given page optionally ignoring the cache. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-reload // // parameters: func () *ReloadParams { return &ReloadParams{} } // WithIgnoreCache if true, browser cache is ignored (as if the user pressed // Shift+refresh). func ( ReloadParams) ( bool) *ReloadParams { .IgnoreCache = return & } // WithScriptToEvaluateOnLoad if set, the script will be injected into all // frames of the inspected page after reload. Argument will be ignored if // reloading dataURL origin. func ( ReloadParams) ( string) *ReloadParams { .ScriptToEvaluateOnLoad = return & } // Do executes Page.reload against the provided context. func ( *ReloadParams) ( context.Context) ( error) { return cdp.Execute(, CommandReload, , nil) } // RemoveScriptToEvaluateOnNewDocumentParams removes given script from the // list. type RemoveScriptToEvaluateOnNewDocumentParams struct { Identifier ScriptIdentifier `json:"identifier"` } // RemoveScriptToEvaluateOnNewDocument removes given script from the list. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-removeScriptToEvaluateOnNewDocument // // parameters: // // identifier func ( ScriptIdentifier) *RemoveScriptToEvaluateOnNewDocumentParams { return &RemoveScriptToEvaluateOnNewDocumentParams{ Identifier: , } } // Do executes Page.removeScriptToEvaluateOnNewDocument against the provided context. func ( *RemoveScriptToEvaluateOnNewDocumentParams) ( context.Context) ( error) { return cdp.Execute(, CommandRemoveScriptToEvaluateOnNewDocument, , nil) } // ScreencastFrameAckParams acknowledges that a screencast frame has been // received by the frontend. type ScreencastFrameAckParams struct { SessionID int64 `json:"sessionId"` // Frame number. } // ScreencastFrameAck acknowledges that a screencast frame has been received // by the frontend. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-screencastFrameAck // // parameters: // // sessionID - Frame number. func ( int64) *ScreencastFrameAckParams { return &ScreencastFrameAckParams{ SessionID: , } } // Do executes Page.screencastFrameAck against the provided context. func ( *ScreencastFrameAckParams) ( context.Context) ( error) { return cdp.Execute(, CommandScreencastFrameAck, , nil) } // SearchInResourceParams searches for given string in resource content. type SearchInResourceParams struct { FrameID cdp.FrameID `json:"frameId"` // Frame id for resource to search in. URL string `json:"url"` // URL of the resource to search in. Query string `json:"query"` // String to search for. CaseSensitive bool `json:"caseSensitive,omitempty"` // If true, search is case sensitive. IsRegex bool `json:"isRegex,omitempty"` // If true, treats string parameter as regex. } // SearchInResource searches for given string in resource content. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-searchInResource // // parameters: // // frameID - Frame id for resource to search in. // url - URL of the resource to search in. // query - String to search for. func ( cdp.FrameID, string, string) *SearchInResourceParams { return &SearchInResourceParams{ FrameID: , URL: , Query: , } } // WithCaseSensitive if true, search is case sensitive. func ( SearchInResourceParams) ( bool) *SearchInResourceParams { .CaseSensitive = return & } // WithIsRegex if true, treats string parameter as regex. func ( SearchInResourceParams) ( bool) *SearchInResourceParams { .IsRegex = return & } // SearchInResourceReturns return values. type SearchInResourceReturns struct { Result []*debugger.SearchMatch `json:"result,omitempty"` // List of search matches. } // Do executes Page.searchInResource against the provided context. // // returns: // // result - List of search matches. func ( *SearchInResourceParams) ( context.Context) ( []*debugger.SearchMatch, error) { // execute var SearchInResourceReturns = cdp.Execute(, CommandSearchInResource, , &) if != nil { return nil, } return .Result, nil } // SetAdBlockingEnabledParams enable Chrome's experimental ad filter on all // sites. type SetAdBlockingEnabledParams struct { Enabled bool `json:"enabled"` // Whether to block ads. } // SetAdBlockingEnabled enable Chrome's experimental ad filter on all sites. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setAdBlockingEnabled // // parameters: // // enabled - Whether to block ads. func ( bool) *SetAdBlockingEnabledParams { return &SetAdBlockingEnabledParams{ Enabled: , } } // Do executes Page.setAdBlockingEnabled against the provided context. func ( *SetAdBlockingEnabledParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetAdBlockingEnabled, , nil) } // SetBypassCSPParams enable page Content Security Policy by-passing. type SetBypassCSPParams struct { Enabled bool `json:"enabled"` // Whether to bypass page CSP. } // SetBypassCSP enable page Content Security Policy by-passing. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setBypassCSP // // parameters: // // enabled - Whether to bypass page CSP. func ( bool) *SetBypassCSPParams { return &SetBypassCSPParams{ Enabled: , } } // Do executes Page.setBypassCSP against the provided context. func ( *SetBypassCSPParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetBypassCSP, , nil) } // GetPermissionsPolicyStateParams get Permissions Policy state on given // frame. type GetPermissionsPolicyStateParams struct { FrameID cdp.FrameID `json:"frameId"` } // GetPermissionsPolicyState get Permissions Policy state on given frame. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getPermissionsPolicyState // // parameters: // // frameID func ( cdp.FrameID) *GetPermissionsPolicyStateParams { return &GetPermissionsPolicyStateParams{ FrameID: , } } // GetPermissionsPolicyStateReturns return values. type GetPermissionsPolicyStateReturns struct { States []*PermissionsPolicyFeatureState `json:"states,omitempty"` } // Do executes Page.getPermissionsPolicyState against the provided context. // // returns: // // states func ( *GetPermissionsPolicyStateParams) ( context.Context) ( []*PermissionsPolicyFeatureState, error) { // execute var GetPermissionsPolicyStateReturns = cdp.Execute(, CommandGetPermissionsPolicyState, , &) if != nil { return nil, } return .States, nil } // GetOriginTrialsParams get Origin Trials on given frame. type GetOriginTrialsParams struct { FrameID cdp.FrameID `json:"frameId"` } // GetOriginTrials get Origin Trials on given frame. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getOriginTrials // // parameters: // // frameID func ( cdp.FrameID) *GetOriginTrialsParams { return &GetOriginTrialsParams{ FrameID: , } } // GetOriginTrialsReturns return values. type GetOriginTrialsReturns struct { OriginTrials []*cdp.OriginTrial `json:"originTrials,omitempty"` } // Do executes Page.getOriginTrials against the provided context. // // returns: // // originTrials func ( *GetOriginTrialsParams) ( context.Context) ( []*cdp.OriginTrial, error) { // execute var GetOriginTrialsReturns = cdp.Execute(, CommandGetOriginTrials, , &) if != nil { return nil, } return .OriginTrials, nil } // SetFontFamiliesParams set generic font families. type SetFontFamiliesParams struct { 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. } // SetFontFamilies set generic font families. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setFontFamilies // // parameters: // // fontFamilies - Specifies font families to set. If a font family is not specified, it won't be changed. func ( *FontFamilies) *SetFontFamiliesParams { return &SetFontFamiliesParams{ FontFamilies: , } } // WithForScripts specifies font families to set for individual scripts. func ( SetFontFamiliesParams) ( []*ScriptFontFamilies) *SetFontFamiliesParams { .ForScripts = return & } // Do executes Page.setFontFamilies against the provided context. func ( *SetFontFamiliesParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetFontFamilies, , nil) } // SetFontSizesParams set default font sizes. type SetFontSizesParams struct { FontSizes *FontSizes `json:"fontSizes"` // Specifies font sizes to set. If a font size is not specified, it won't be changed. } // SetFontSizes set default font sizes. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setFontSizes // // parameters: // // fontSizes - Specifies font sizes to set. If a font size is not specified, it won't be changed. func ( *FontSizes) *SetFontSizesParams { return &SetFontSizesParams{ FontSizes: , } } // Do executes Page.setFontSizes against the provided context. func ( *SetFontSizesParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetFontSizes, , nil) } // SetDocumentContentParams sets given markup as the document's HTML. type SetDocumentContentParams struct { FrameID cdp.FrameID `json:"frameId"` // Frame id to set HTML for. HTML string `json:"html"` // HTML content to set. } // SetDocumentContent sets given markup as the document's HTML. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDocumentContent // // parameters: // // frameID - Frame id to set HTML for. // html - HTML content to set. func ( cdp.FrameID, string) *SetDocumentContentParams { return &SetDocumentContentParams{ FrameID: , HTML: , } } // Do executes Page.setDocumentContent against the provided context. func ( *SetDocumentContentParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetDocumentContent, , nil) } // SetLifecycleEventsEnabledParams controls whether page will emit lifecycle // events. type SetLifecycleEventsEnabledParams struct { Enabled bool `json:"enabled"` // If true, starts emitting lifecycle events. } // SetLifecycleEventsEnabled controls whether page will emit lifecycle // events. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setLifecycleEventsEnabled // // parameters: // // enabled - If true, starts emitting lifecycle events. func ( bool) *SetLifecycleEventsEnabledParams { return &SetLifecycleEventsEnabledParams{ Enabled: , } } // Do executes Page.setLifecycleEventsEnabled against the provided context. func ( *SetLifecycleEventsEnabledParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetLifecycleEventsEnabled, , nil) } // StartScreencastParams starts sending each frame using the screencastFrame // event. type StartScreencastParams struct { Format ScreencastFormat `json:"format,omitempty"` // Image compression format. Quality int64 `json:"quality,omitempty"` // Compression quality from range [0..100]. MaxWidth int64 `json:"maxWidth,omitempty"` // Maximum screenshot width. MaxHeight int64 `json:"maxHeight,omitempty"` // Maximum screenshot height. EveryNthFrame int64 `json:"everyNthFrame,omitempty"` // Send every n-th frame. } // StartScreencast starts sending each frame using the screencastFrame event. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-startScreencast // // parameters: func () *StartScreencastParams { return &StartScreencastParams{} } // WithFormat image compression format. func ( StartScreencastParams) ( ScreencastFormat) *StartScreencastParams { .Format = return & } // WithQuality compression quality from range [0..100]. func ( StartScreencastParams) ( int64) *StartScreencastParams { .Quality = return & } // WithMaxWidth maximum screenshot width. func ( StartScreencastParams) ( int64) *StartScreencastParams { .MaxWidth = return & } // WithMaxHeight maximum screenshot height. func ( StartScreencastParams) ( int64) *StartScreencastParams { .MaxHeight = return & } // WithEveryNthFrame send every n-th frame. func ( StartScreencastParams) ( int64) *StartScreencastParams { .EveryNthFrame = return & } // Do executes Page.startScreencast against the provided context. func ( *StartScreencastParams) ( context.Context) ( error) { return cdp.Execute(, CommandStartScreencast, , nil) } // StopLoadingParams force the page stop all navigations and pending resource // fetches. type StopLoadingParams struct{} // StopLoading force the page stop all navigations and pending resource // fetches. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-stopLoading func () *StopLoadingParams { return &StopLoadingParams{} } // Do executes Page.stopLoading against the provided context. func ( *StopLoadingParams) ( context.Context) ( error) { return cdp.Execute(, CommandStopLoading, nil, nil) } // CrashParams crashes renderer on the IO thread, generates minidumps. type CrashParams struct{} // Crash crashes renderer on the IO thread, generates minidumps. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-crash func () *CrashParams { return &CrashParams{} } // Do executes Page.crash against the provided context. func ( *CrashParams) ( context.Context) ( error) { return cdp.Execute(, CommandCrash, nil, nil) } // CloseParams tries to close page, running its beforeunload hooks, if any. type CloseParams struct{} // Close tries to close page, running its beforeunload hooks, if any. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-close func () *CloseParams { return &CloseParams{} } // Do executes Page.close against the provided context. func ( *CloseParams) ( context.Context) ( error) { return cdp.Execute(, CommandClose, nil, nil) } // SetWebLifecycleStateParams tries to update the web lifecycle state of the // page. It will transition the page to the given state according to: // https://github.com/WICG/web-lifecycle/. type SetWebLifecycleStateParams struct { State SetWebLifecycleStateState `json:"state"` // Target lifecycle state } // SetWebLifecycleState tries to update the web lifecycle state of the page. // It will transition the page to the given state according to: // https://github.com/WICG/web-lifecycle/. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setWebLifecycleState // // parameters: // // state - Target lifecycle state func ( SetWebLifecycleStateState) *SetWebLifecycleStateParams { return &SetWebLifecycleStateParams{ State: , } } // Do executes Page.setWebLifecycleState against the provided context. func ( *SetWebLifecycleStateParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetWebLifecycleState, , nil) } // StopScreencastParams stops sending each frame in the screencastFrame. type StopScreencastParams struct{} // StopScreencast stops sending each frame in the screencastFrame. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-stopScreencast func () *StopScreencastParams { return &StopScreencastParams{} } // Do executes Page.stopScreencast against the provided context. func ( *StopScreencastParams) ( context.Context) ( error) { return cdp.Execute(, CommandStopScreencast, nil, nil) } // ProduceCompilationCacheParams requests backend to 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. type ProduceCompilationCacheParams struct { Scripts []*CompilationCacheParams `json:"scripts"` } // ProduceCompilationCache requests backend to 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. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-produceCompilationCache // // parameters: // // scripts func ( []*CompilationCacheParams) *ProduceCompilationCacheParams { return &ProduceCompilationCacheParams{ Scripts: , } } // Do executes Page.produceCompilationCache against the provided context. func ( *ProduceCompilationCacheParams) ( context.Context) ( error) { return cdp.Execute(, CommandProduceCompilationCache, , nil) } // AddCompilationCacheParams seeds compilation cache for given url. // Compilation cache does not survive cross-process navigation. type AddCompilationCacheParams struct { URL string `json:"url"` Data string `json:"data"` // Base64-encoded data } // AddCompilationCache seeds compilation cache for given url. Compilation // cache does not survive cross-process navigation. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-addCompilationCache // // parameters: // // url // data - Base64-encoded data func ( string, string) *AddCompilationCacheParams { return &AddCompilationCacheParams{ URL: , Data: , } } // Do executes Page.addCompilationCache against the provided context. func ( *AddCompilationCacheParams) ( context.Context) ( error) { return cdp.Execute(, CommandAddCompilationCache, , nil) } // ClearCompilationCacheParams clears seeded compilation cache. type ClearCompilationCacheParams struct{} // ClearCompilationCache clears seeded compilation cache. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-clearCompilationCache func () *ClearCompilationCacheParams { return &ClearCompilationCacheParams{} } // Do executes Page.clearCompilationCache against the provided context. func ( *ClearCompilationCacheParams) ( context.Context) ( error) { return cdp.Execute(, CommandClearCompilationCache, nil, nil) } // SetSPCTransactionModeParams sets the Secure Payment Confirmation // transaction mode. // https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode. type SetSPCTransactionModeParams struct { Mode AutoResponseMode `json:"mode"` } // SetSPCTransactionMode sets the Secure Payment Confirmation transaction // mode. // https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setSPCTransactionMode // // parameters: // // mode func ( AutoResponseMode) *SetSPCTransactionModeParams { return &SetSPCTransactionModeParams{ Mode: , } } // Do executes Page.setSPCTransactionMode against the provided context. func ( *SetSPCTransactionModeParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetSPCTransactionMode, , nil) } // SetRPHRegistrationModeParams extensions for Custom Handlers API: // https://html.spec.whatwg.org/multipage/system-state.html#rph-automation. type SetRPHRegistrationModeParams struct { Mode AutoResponseMode `json:"mode"` } // SetRPHRegistrationMode extensions for Custom Handlers API: // https://html.spec.whatwg.org/multipage/system-state.html#rph-automation. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setRPHRegistrationMode // // parameters: // // mode func ( AutoResponseMode) *SetRPHRegistrationModeParams { return &SetRPHRegistrationModeParams{ Mode: , } } // Do executes Page.setRPHRegistrationMode against the provided context. func ( *SetRPHRegistrationModeParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetRPHRegistrationMode, , nil) } // GenerateTestReportParams generates a report for testing. type GenerateTestReportParams struct { Message string `json:"message"` // Message to be displayed in the report. Group string `json:"group,omitempty"` // Specifies the endpoint group to deliver the report to. } // GenerateTestReport generates a report for testing. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-generateTestReport // // parameters: // // message - Message to be displayed in the report. func ( string) *GenerateTestReportParams { return &GenerateTestReportParams{ Message: , } } // WithGroup specifies the endpoint group to deliver the report to. func ( GenerateTestReportParams) ( string) *GenerateTestReportParams { .Group = return & } // Do executes Page.generateTestReport against the provided context. func ( *GenerateTestReportParams) ( context.Context) ( error) { return cdp.Execute(, CommandGenerateTestReport, , nil) } // WaitForDebuggerParams pauses page execution. Can be resumed using generic // Runtime.runIfWaitingForDebugger. type WaitForDebuggerParams struct{} // WaitForDebugger pauses page execution. Can be resumed using generic // Runtime.runIfWaitingForDebugger. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-waitForDebugger func () *WaitForDebuggerParams { return &WaitForDebuggerParams{} } // Do executes Page.waitForDebugger against the provided context. func ( *WaitForDebuggerParams) ( context.Context) ( error) { return cdp.Execute(, CommandWaitForDebugger, nil, nil) } // SetInterceptFileChooserDialogParams intercept file chooser requests and // transfer control to protocol clients. When file chooser interception is // enabled, native file chooser dialog is not shown. Instead, a protocol event // Page.fileChooserOpened is emitted. type SetInterceptFileChooserDialogParams struct { Enabled bool `json:"enabled"` } // SetInterceptFileChooserDialog intercept file chooser requests and transfer // control to protocol clients. When file chooser interception is enabled, // native file chooser dialog is not shown. Instead, a protocol event // Page.fileChooserOpened is emitted. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setInterceptFileChooserDialog // // parameters: // // enabled func ( bool) *SetInterceptFileChooserDialogParams { return &SetInterceptFileChooserDialogParams{ Enabled: , } } // Do executes Page.setInterceptFileChooserDialog against the provided context. func ( *SetInterceptFileChooserDialogParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetInterceptFileChooserDialog, , nil) } // SetPrerenderingAllowedParams enable/disable prerendering manually. This // command is a short-term solution for https://crbug.com/1440085. See // https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA // for more details. TODO(https://crbug.com/1440085): Remove this once Puppeteer // supports tab targets. type SetPrerenderingAllowedParams struct { IsAllowed bool `json:"isAllowed"` } // SetPrerenderingAllowed enable/disable prerendering manually. This command // is a short-term solution for https://crbug.com/1440085. See // https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA // for more details. TODO(https://crbug.com/1440085): Remove this once Puppeteer // supports tab targets. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setPrerenderingAllowed // // parameters: // // isAllowed func ( bool) *SetPrerenderingAllowedParams { return &SetPrerenderingAllowedParams{ IsAllowed: , } } // Do executes Page.setPrerenderingAllowed against the provided context. func ( *SetPrerenderingAllowedParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetPrerenderingAllowed, , nil) } // Command names. const ( CommandAddScriptToEvaluateOnNewDocument = "Page.addScriptToEvaluateOnNewDocument" CommandBringToFront = "Page.bringToFront" CommandCaptureScreenshot = "Page.captureScreenshot" CommandCaptureSnapshot = "Page.captureSnapshot" CommandCreateIsolatedWorld = "Page.createIsolatedWorld" CommandDisable = "Page.disable" CommandEnable = "Page.enable" CommandGetAppManifest = "Page.getAppManifest" CommandGetInstallabilityErrors = "Page.getInstallabilityErrors" CommandGetAppID = "Page.getAppId" CommandGetAdScriptID = "Page.getAdScriptId" CommandGetFrameTree = "Page.getFrameTree" CommandGetLayoutMetrics = "Page.getLayoutMetrics" CommandGetNavigationHistory = "Page.getNavigationHistory" CommandResetNavigationHistory = "Page.resetNavigationHistory" CommandGetResourceContent = "Page.getResourceContent" CommandGetResourceTree = "Page.getResourceTree" CommandHandleJavaScriptDialog = "Page.handleJavaScriptDialog" CommandNavigate = "Page.navigate" CommandNavigateToHistoryEntry = "Page.navigateToHistoryEntry" CommandPrintToPDF = "Page.printToPDF" CommandReload = "Page.reload" CommandRemoveScriptToEvaluateOnNewDocument = "Page.removeScriptToEvaluateOnNewDocument" CommandScreencastFrameAck = "Page.screencastFrameAck" CommandSearchInResource = "Page.searchInResource" CommandSetAdBlockingEnabled = "Page.setAdBlockingEnabled" CommandSetBypassCSP = "Page.setBypassCSP" CommandGetPermissionsPolicyState = "Page.getPermissionsPolicyState" CommandGetOriginTrials = "Page.getOriginTrials" CommandSetFontFamilies = "Page.setFontFamilies" CommandSetFontSizes = "Page.setFontSizes" CommandSetDocumentContent = "Page.setDocumentContent" CommandSetLifecycleEventsEnabled = "Page.setLifecycleEventsEnabled" CommandStartScreencast = "Page.startScreencast" CommandStopLoading = "Page.stopLoading" CommandCrash = "Page.crash" CommandClose = "Page.close" CommandSetWebLifecycleState = "Page.setWebLifecycleState" CommandStopScreencast = "Page.stopScreencast" CommandProduceCompilationCache = "Page.produceCompilationCache" CommandAddCompilationCache = "Page.addCompilationCache" CommandClearCompilationCache = "Page.clearCompilationCache" CommandSetSPCTransactionMode = "Page.setSPCTransactionMode" CommandSetRPHRegistrationMode = "Page.setRPHRegistrationMode" CommandGenerateTestReport = "Page.generateTestReport" CommandWaitForDebugger = "Page.waitForDebugger" CommandSetInterceptFileChooserDialog = "Page.setInterceptFileChooserDialog" CommandSetPrerenderingAllowed = "Page.setPrerenderingAllowed" )