diff --git a/cdp/animation/animation.go b/cdp/animation/animation.go index f61dd7c..d831c6f 100644 --- a/cdp/animation/animation.go +++ b/cdp/animation/animation.go @@ -13,20 +13,6 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) -// EnableParams enables animation domain notifications. -type EnableParams struct{} - -// Enable enables animation domain notifications. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Animation.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandAnimationEnable, nil, nil) -} - // DisableParams disables animation domain notifications. type DisableParams struct{} @@ -41,54 +27,18 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandAnimationDisable, nil, nil) } -// GetPlaybackRateParams gets the playback rate of the document timeline. -type GetPlaybackRateParams struct{} +// EnableParams enables animation domain notifications. +type EnableParams struct{} -// GetPlaybackRate gets the playback rate of the document timeline. -func GetPlaybackRate() *GetPlaybackRateParams { - return &GetPlaybackRateParams{} +// Enable enables animation domain notifications. +func Enable() *EnableParams { + return &EnableParams{} } -// GetPlaybackRateReturns return values. -type GetPlaybackRateReturns struct { - PlaybackRate float64 `json:"playbackRate,omitempty"` // Playback rate for animations on page. -} - -// Do executes Animation.getPlaybackRate against the provided context and +// Do executes Animation.enable against the provided context and // target handler. -// -// returns: -// playbackRate - Playback rate for animations on page. -func (p *GetPlaybackRateParams) Do(ctxt context.Context, h cdp.Handler) (playbackRate float64, err error) { - // execute - var res GetPlaybackRateReturns - err = h.Execute(ctxt, cdp.CommandAnimationGetPlaybackRate, nil, &res) - if err != nil { - return 0, err - } - - return res.PlaybackRate, nil -} - -// SetPlaybackRateParams sets the playback rate of the document timeline. -type SetPlaybackRateParams struct { - PlaybackRate float64 `json:"playbackRate"` // Playback rate for animations on page -} - -// SetPlaybackRate sets the playback rate of the document timeline. -// -// parameters: -// playbackRate - Playback rate for animations on page -func SetPlaybackRate(playbackRate float64) *SetPlaybackRateParams { - return &SetPlaybackRateParams{ - PlaybackRate: playbackRate, - } -} - -// Do executes Animation.setPlaybackRate against the provided context and -// target handler. -func (p *SetPlaybackRateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandAnimationSetPlaybackRate, p, nil) +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandAnimationEnable, nil, nil) } // GetCurrentTimeParams returns the current time of the an animation. @@ -127,81 +77,33 @@ func (p *GetCurrentTimeParams) Do(ctxt context.Context, h cdp.Handler) (currentT return res.CurrentTime, nil } -// SetPausedParams sets the paused state of a set of animations. -type SetPausedParams struct { - Animations []string `json:"animations"` // Animations to set the pause state of. - Paused bool `json:"paused"` // Paused state to set to. +// GetPlaybackRateParams gets the playback rate of the document timeline. +type GetPlaybackRateParams struct{} + +// GetPlaybackRate gets the playback rate of the document timeline. +func GetPlaybackRate() *GetPlaybackRateParams { + return &GetPlaybackRateParams{} } -// SetPaused sets the paused state of a set of animations. -// -// parameters: -// animations - Animations to set the pause state of. -// paused - Paused state to set to. -func SetPaused(animations []string, paused bool) *SetPausedParams { - return &SetPausedParams{ - Animations: animations, - Paused: paused, - } +// GetPlaybackRateReturns return values. +type GetPlaybackRateReturns struct { + PlaybackRate float64 `json:"playbackRate,omitempty"` // Playback rate for animations on page. } -// Do executes Animation.setPaused against the provided context and +// Do executes Animation.getPlaybackRate against the provided context and // target handler. -func (p *SetPausedParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandAnimationSetPaused, p, nil) -} - -// SetTimingParams sets the timing of an animation node. -type SetTimingParams struct { - AnimationID string `json:"animationId"` // Animation id. - Duration float64 `json:"duration"` // Duration of the animation. - Delay float64 `json:"delay"` // Delay of the animation. -} - -// SetTiming sets the timing of an animation node. // -// parameters: -// animationID - Animation id. -// duration - Duration of the animation. -// delay - Delay of the animation. -func SetTiming(animationID string, duration float64, delay float64) *SetTimingParams { - return &SetTimingParams{ - AnimationID: animationID, - Duration: duration, - Delay: delay, +// returns: +// playbackRate - Playback rate for animations on page. +func (p *GetPlaybackRateParams) Do(ctxt context.Context, h cdp.Handler) (playbackRate float64, err error) { + // execute + var res GetPlaybackRateReturns + err = h.Execute(ctxt, cdp.CommandAnimationGetPlaybackRate, nil, &res) + if err != nil { + return 0, err } -} -// Do executes Animation.setTiming against the provided context and -// target handler. -func (p *SetTimingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandAnimationSetTiming, p, nil) -} - -// SeekAnimationsParams seek a set of animations to a particular time within -// each animation. -type SeekAnimationsParams struct { - Animations []string `json:"animations"` // List of animation ids to seek. - CurrentTime float64 `json:"currentTime"` // Set the current time of each animation. -} - -// SeekAnimations seek a set of animations to a particular time within each -// animation. -// -// parameters: -// animations - List of animation ids to seek. -// currentTime - Set the current time of each animation. -func SeekAnimations(animations []string, currentTime float64) *SeekAnimationsParams { - return &SeekAnimationsParams{ - Animations: animations, - CurrentTime: currentTime, - } -} - -// Do executes Animation.seekAnimations against the provided context and -// target handler. -func (p *SeekAnimationsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandAnimationSeekAnimations, p, nil) + return res.PlaybackRate, nil } // ReleaseAnimationsParams releases a set of animations to no longer be @@ -262,3 +164,101 @@ func (p *ResolveAnimationParams) Do(ctxt context.Context, h cdp.Handler) (remote return res.RemoteObject, nil } + +// SeekAnimationsParams seek a set of animations to a particular time within +// each animation. +type SeekAnimationsParams struct { + Animations []string `json:"animations"` // List of animation ids to seek. + CurrentTime float64 `json:"currentTime"` // Set the current time of each animation. +} + +// SeekAnimations seek a set of animations to a particular time within each +// animation. +// +// parameters: +// animations - List of animation ids to seek. +// currentTime - Set the current time of each animation. +func SeekAnimations(animations []string, currentTime float64) *SeekAnimationsParams { + return &SeekAnimationsParams{ + Animations: animations, + CurrentTime: currentTime, + } +} + +// Do executes Animation.seekAnimations against the provided context and +// target handler. +func (p *SeekAnimationsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandAnimationSeekAnimations, p, nil) +} + +// SetPausedParams sets the paused state of a set of animations. +type SetPausedParams struct { + Animations []string `json:"animations"` // Animations to set the pause state of. + Paused bool `json:"paused"` // Paused state to set to. +} + +// SetPaused sets the paused state of a set of animations. +// +// parameters: +// animations - Animations to set the pause state of. +// paused - Paused state to set to. +func SetPaused(animations []string, paused bool) *SetPausedParams { + return &SetPausedParams{ + Animations: animations, + Paused: paused, + } +} + +// Do executes Animation.setPaused against the provided context and +// target handler. +func (p *SetPausedParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandAnimationSetPaused, p, nil) +} + +// SetPlaybackRateParams sets the playback rate of the document timeline. +type SetPlaybackRateParams struct { + PlaybackRate float64 `json:"playbackRate"` // Playback rate for animations on page +} + +// SetPlaybackRate sets the playback rate of the document timeline. +// +// parameters: +// playbackRate - Playback rate for animations on page +func SetPlaybackRate(playbackRate float64) *SetPlaybackRateParams { + return &SetPlaybackRateParams{ + PlaybackRate: playbackRate, + } +} + +// Do executes Animation.setPlaybackRate against the provided context and +// target handler. +func (p *SetPlaybackRateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandAnimationSetPlaybackRate, p, nil) +} + +// SetTimingParams sets the timing of an animation node. +type SetTimingParams struct { + AnimationID string `json:"animationId"` // Animation id. + Duration float64 `json:"duration"` // Duration of the animation. + Delay float64 `json:"delay"` // Delay of the animation. +} + +// SetTiming sets the timing of an animation node. +// +// parameters: +// animationID - Animation id. +// duration - Duration of the animation. +// delay - Delay of the animation. +func SetTiming(animationID string, duration float64, delay float64) *SetTimingParams { + return &SetTimingParams{ + AnimationID: animationID, + Duration: duration, + Delay: delay, + } +} + +// Do executes Animation.setTiming against the provided context and +// target handler. +func (p *SetTimingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandAnimationSetTiming, p, nil) +} diff --git a/cdp/animation/events.go b/cdp/animation/events.go index 4dec6da..1647719 100644 --- a/cdp/animation/events.go +++ b/cdp/animation/events.go @@ -6,6 +6,11 @@ import ( cdp "github.com/knq/chromedp/cdp" ) +// EventAnimationCanceled event for when an animation has been cancelled. +type EventAnimationCanceled struct { + ID string `json:"id"` // Id of the animation that was cancelled. +} + // EventAnimationCreated event for each animation that has been created. type EventAnimationCreated struct { ID string `json:"id"` // Id of the animation that was created. @@ -16,14 +21,9 @@ type EventAnimationStarted struct { Animation *Animation `json:"animation"` // Animation that was started. } -// EventAnimationCanceled event for when an animation has been cancelled. -type EventAnimationCanceled struct { - ID string `json:"id"` // Id of the animation that was cancelled. -} - // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ + cdp.EventAnimationAnimationCanceled, cdp.EventAnimationAnimationCreated, cdp.EventAnimationAnimationStarted, - cdp.EventAnimationAnimationCanceled, } diff --git a/cdp/applicationcache/applicationcache.go b/cdp/applicationcache/applicationcache.go index 0a4dd6f..d34a944 100644 --- a/cdp/applicationcache/applicationcache.go +++ b/cdp/applicationcache/applicationcache.go @@ -12,39 +12,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// GetFramesWithManifestsParams returns array of frame identifiers with -// manifest urls for each frame containing a document associated with some -// application cache. -type GetFramesWithManifestsParams struct{} - -// GetFramesWithManifests returns array of frame identifiers with manifest -// urls for each frame containing a document associated with some application -// cache. -func GetFramesWithManifests() *GetFramesWithManifestsParams { - return &GetFramesWithManifestsParams{} -} - -// GetFramesWithManifestsReturns return values. -type GetFramesWithManifestsReturns struct { - FrameIds []*FrameWithManifest `json:"frameIds,omitempty"` // Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache. -} - -// Do executes ApplicationCache.getFramesWithManifests against the provided context and -// target handler. -// -// returns: -// frameIds - Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache. -func (p *GetFramesWithManifestsParams) Do(ctxt context.Context, h cdp.Handler) (frameIds []*FrameWithManifest, err error) { - // execute - var res GetFramesWithManifestsReturns - err = h.Execute(ctxt, cdp.CommandApplicationCacheGetFramesWithManifests, nil, &res) - if err != nil { - return nil, err - } - - return res.FrameIds, nil -} - // EnableParams enables application cache domain notifications. type EnableParams struct{} @@ -59,43 +26,6 @@ func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandApplicationCacheEnable, nil, nil) } -// GetManifestForFrameParams returns manifest URL for document in the given -// frame. -type GetManifestForFrameParams struct { - FrameID cdp.FrameID `json:"frameId"` // Identifier of the frame containing document whose manifest is retrieved. -} - -// GetManifestForFrame returns manifest URL for document in the given frame. -// -// parameters: -// frameID - Identifier of the frame containing document whose manifest is retrieved. -func GetManifestForFrame(frameID cdp.FrameID) *GetManifestForFrameParams { - return &GetManifestForFrameParams{ - FrameID: frameID, - } -} - -// GetManifestForFrameReturns return values. -type GetManifestForFrameReturns struct { - ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL for document in the given frame. -} - -// Do executes ApplicationCache.getManifestForFrame against the provided context and -// target handler. -// -// returns: -// manifestURL - Manifest URL for document in the given frame. -func (p *GetManifestForFrameParams) Do(ctxt context.Context, h cdp.Handler) (manifestURL string, err error) { - // execute - var res GetManifestForFrameReturns - err = h.Execute(ctxt, cdp.CommandApplicationCacheGetManifestForFrame, p, &res) - if err != nil { - return "", err - } - - return res.ManifestURL, nil -} - // GetApplicationCacheForFrameParams returns relevant application cache data // for the document in given frame. type GetApplicationCacheForFrameParams struct { @@ -133,3 +63,73 @@ func (p *GetApplicationCacheForFrameParams) Do(ctxt context.Context, h cdp.Handl return res.ApplicationCache, nil } + +// GetFramesWithManifestsParams returns array of frame identifiers with +// manifest urls for each frame containing a document associated with some +// application cache. +type GetFramesWithManifestsParams struct{} + +// GetFramesWithManifests returns array of frame identifiers with manifest +// urls for each frame containing a document associated with some application +// cache. +func GetFramesWithManifests() *GetFramesWithManifestsParams { + return &GetFramesWithManifestsParams{} +} + +// GetFramesWithManifestsReturns return values. +type GetFramesWithManifestsReturns struct { + FrameIds []*FrameWithManifest `json:"frameIds,omitempty"` // Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache. +} + +// Do executes ApplicationCache.getFramesWithManifests against the provided context and +// target handler. +// +// returns: +// frameIds - Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache. +func (p *GetFramesWithManifestsParams) Do(ctxt context.Context, h cdp.Handler) (frameIds []*FrameWithManifest, err error) { + // execute + var res GetFramesWithManifestsReturns + err = h.Execute(ctxt, cdp.CommandApplicationCacheGetFramesWithManifests, nil, &res) + if err != nil { + return nil, err + } + + return res.FrameIds, nil +} + +// GetManifestForFrameParams returns manifest URL for document in the given +// frame. +type GetManifestForFrameParams struct { + FrameID cdp.FrameID `json:"frameId"` // Identifier of the frame containing document whose manifest is retrieved. +} + +// GetManifestForFrame returns manifest URL for document in the given frame. +// +// parameters: +// frameID - Identifier of the frame containing document whose manifest is retrieved. +func GetManifestForFrame(frameID cdp.FrameID) *GetManifestForFrameParams { + return &GetManifestForFrameParams{ + FrameID: frameID, + } +} + +// GetManifestForFrameReturns return values. +type GetManifestForFrameReturns struct { + ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL for document in the given frame. +} + +// Do executes ApplicationCache.getManifestForFrame against the provided context and +// target handler. +// +// returns: +// manifestURL - Manifest URL for document in the given frame. +func (p *GetManifestForFrameParams) Do(ctxt context.Context, h cdp.Handler) (manifestURL string, err error) { + // execute + var res GetManifestForFrameReturns + err = h.Execute(ctxt, cdp.CommandApplicationCacheGetManifestForFrame, p, &res) + if err != nil { + return "", err + } + + return res.ManifestURL, nil +} diff --git a/cdp/browser/browser.go b/cdp/browser/browser.go index 6a3b371..3773531 100644 --- a/cdp/browser/browser.go +++ b/cdp/browser/browser.go @@ -29,6 +29,79 @@ func (p *CloseParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandBrowserClose, nil, nil) } +// GetVersionParams returns version information. +type GetVersionParams struct{} + +// GetVersion returns version information. +func GetVersion() *GetVersionParams { + return &GetVersionParams{} +} + +// GetVersionReturns return values. +type GetVersionReturns struct { + ProtocolVersion string `json:"protocolVersion,omitempty"` // Protocol version. + Product string `json:"product,omitempty"` // Product name. + Revision string `json:"revision,omitempty"` // Product revision. + UserAgent string `json:"userAgent,omitempty"` // User-Agent. + JsVersion string `json:"jsVersion,omitempty"` // V8 version. +} + +// Do executes Browser.getVersion against the provided context and +// target handler. +// +// returns: +// protocolVersion - Protocol version. +// product - Product name. +// revision - Product revision. +// userAgent - User-Agent. +// jsVersion - V8 version. +func (p *GetVersionParams) Do(ctxt context.Context, h cdp.Handler) (protocolVersion string, product string, revision string, userAgent string, jsVersion string, err error) { + // execute + var res GetVersionReturns + err = h.Execute(ctxt, cdp.CommandBrowserGetVersion, nil, &res) + if err != nil { + return "", "", "", "", "", err + } + + return res.ProtocolVersion, res.Product, res.Revision, res.UserAgent, res.JsVersion, nil +} + +// GetWindowBoundsParams get position and size of the browser window. +type GetWindowBoundsParams struct { + WindowID WindowID `json:"windowId"` // Browser window id. +} + +// GetWindowBounds get position and size of the browser window. +// +// parameters: +// windowID - Browser window id. +func GetWindowBounds(windowID WindowID) *GetWindowBoundsParams { + return &GetWindowBoundsParams{ + WindowID: windowID, + } +} + +// GetWindowBoundsReturns return values. +type GetWindowBoundsReturns struct { + Bounds *Bounds `json:"bounds,omitempty"` // Bounds information of the window. When window state is 'minimized', the restored window position and size are returned. +} + +// Do executes Browser.getWindowBounds against the provided context and +// target handler. +// +// returns: +// bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned. +func (p *GetWindowBoundsParams) Do(ctxt context.Context, h cdp.Handler) (bounds *Bounds, err error) { + // execute + var res GetWindowBoundsReturns + err = h.Execute(ctxt, cdp.CommandBrowserGetWindowBounds, p, &res) + if err != nil { + return nil, err + } + + return res.Bounds, nil +} + // GetWindowForTargetParams get the browser window that contains the devtools // target. type GetWindowForTargetParams struct { @@ -69,43 +142,6 @@ func (p *GetWindowForTargetParams) Do(ctxt context.Context, h cdp.Handler) (wind return res.WindowID, res.Bounds, nil } -// GetVersionParams returns version information. -type GetVersionParams struct{} - -// GetVersion returns version information. -func GetVersion() *GetVersionParams { - return &GetVersionParams{} -} - -// GetVersionReturns return values. -type GetVersionReturns struct { - ProtocolVersion string `json:"protocolVersion,omitempty"` // Protocol version. - Product string `json:"product,omitempty"` // Product name. - Revision string `json:"revision,omitempty"` // Product revision. - UserAgent string `json:"userAgent,omitempty"` // User-Agent. - JsVersion string `json:"jsVersion,omitempty"` // V8 version. -} - -// Do executes Browser.getVersion against the provided context and -// target handler. -// -// returns: -// protocolVersion - Protocol version. -// product - Product name. -// revision - Product revision. -// userAgent - User-Agent. -// jsVersion - V8 version. -func (p *GetVersionParams) Do(ctxt context.Context, h cdp.Handler) (protocolVersion string, product string, revision string, userAgent string, jsVersion string, err error) { - // execute - var res GetVersionReturns - err = h.Execute(ctxt, cdp.CommandBrowserGetVersion, nil, &res) - if err != nil { - return "", "", "", "", "", err - } - - return res.ProtocolVersion, res.Product, res.Revision, res.UserAgent, res.JsVersion, nil -} - // SetWindowBoundsParams set position and/or size of the browser window. type SetWindowBoundsParams struct { WindowID WindowID `json:"windowId"` // Browser window id. @@ -129,39 +165,3 @@ func SetWindowBounds(windowID WindowID, bounds *Bounds) *SetWindowBoundsParams { func (p *SetWindowBoundsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandBrowserSetWindowBounds, p, nil) } - -// GetWindowBoundsParams get position and size of the browser window. -type GetWindowBoundsParams struct { - WindowID WindowID `json:"windowId"` // Browser window id. -} - -// GetWindowBounds get position and size of the browser window. -// -// parameters: -// windowID - Browser window id. -func GetWindowBounds(windowID WindowID) *GetWindowBoundsParams { - return &GetWindowBoundsParams{ - WindowID: windowID, - } -} - -// GetWindowBoundsReturns return values. -type GetWindowBoundsReturns struct { - Bounds *Bounds `json:"bounds,omitempty"` // Bounds information of the window. When window state is 'minimized', the restored window position and size are returned. -} - -// Do executes Browser.getWindowBounds against the provided context and -// target handler. -// -// returns: -// bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned. -func (p *GetWindowBoundsParams) Do(ctxt context.Context, h cdp.Handler) (bounds *Bounds, err error) { - // execute - var res GetWindowBoundsReturns - err = h.Execute(ctxt, cdp.CommandBrowserGetWindowBounds, p, &res) - if err != nil { - return nil, err - } - - return res.Bounds, nil -} diff --git a/cdp/cachestorage/cachestorage.go b/cdp/cachestorage/cachestorage.go index c54b82d..864c99d 100644 --- a/cdp/cachestorage/cachestorage.go +++ b/cdp/cachestorage/cachestorage.go @@ -12,86 +12,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// RequestCacheNamesParams requests cache names. -type RequestCacheNamesParams struct { - SecurityOrigin string `json:"securityOrigin"` // Security origin. -} - -// RequestCacheNames requests cache names. -// -// parameters: -// securityOrigin - Security origin. -func RequestCacheNames(securityOrigin string) *RequestCacheNamesParams { - return &RequestCacheNamesParams{ - SecurityOrigin: securityOrigin, - } -} - -// RequestCacheNamesReturns return values. -type RequestCacheNamesReturns struct { - Caches []*Cache `json:"caches,omitempty"` // Caches for the security origin. -} - -// Do executes CacheStorage.requestCacheNames against the provided context and -// target handler. -// -// returns: -// caches - Caches for the security origin. -func (p *RequestCacheNamesParams) Do(ctxt context.Context, h cdp.Handler) (caches []*Cache, err error) { - // execute - var res RequestCacheNamesReturns - err = h.Execute(ctxt, cdp.CommandCacheStorageRequestCacheNames, p, &res) - if err != nil { - return nil, err - } - - return res.Caches, nil -} - -// RequestEntriesParams requests data from cache. -type RequestEntriesParams struct { - CacheID CacheID `json:"cacheId"` // ID of cache to get entries from. - SkipCount int64 `json:"skipCount"` // Number of records to skip. - PageSize int64 `json:"pageSize"` // Number of records to fetch. -} - -// RequestEntries requests data from cache. -// -// parameters: -// cacheID - ID of cache to get entries from. -// skipCount - Number of records to skip. -// pageSize - Number of records to fetch. -func RequestEntries(cacheID CacheID, skipCount int64, pageSize int64) *RequestEntriesParams { - return &RequestEntriesParams{ - CacheID: cacheID, - SkipCount: skipCount, - PageSize: pageSize, - } -} - -// RequestEntriesReturns return values. -type RequestEntriesReturns struct { - CacheDataEntries []*DataEntry `json:"cacheDataEntries,omitempty"` // Array of object store data entries. - HasMore bool `json:"hasMore,omitempty"` // If true, there are more entries to fetch in the given range. -} - -// Do executes CacheStorage.requestEntries against the provided context and -// target handler. -// -// returns: -// cacheDataEntries - Array of object store data entries. -// hasMore - If true, there are more entries to fetch in the given range. -func (p *RequestEntriesParams) Do(ctxt context.Context, h cdp.Handler) (cacheDataEntries []*DataEntry, hasMore bool, err error) { - // execute - var res RequestEntriesReturns - err = h.Execute(ctxt, cdp.CommandCacheStorageRequestEntries, p, &res) - if err != nil { - return nil, false, err - } - - return res.CacheDataEntries, res.HasMore, nil -} - // DeleteCacheParams deletes a cache. type DeleteCacheParams struct { CacheID CacheID `json:"cacheId"` // Id of cache for deletion. @@ -137,6 +57,42 @@ func (p *DeleteEntryParams) Do(ctxt context.Context, h cdp.Handler) (err error) return h.Execute(ctxt, cdp.CommandCacheStorageDeleteEntry, p, nil) } +// RequestCacheNamesParams requests cache names. +type RequestCacheNamesParams struct { + SecurityOrigin string `json:"securityOrigin"` // Security origin. +} + +// RequestCacheNames requests cache names. +// +// parameters: +// securityOrigin - Security origin. +func RequestCacheNames(securityOrigin string) *RequestCacheNamesParams { + return &RequestCacheNamesParams{ + SecurityOrigin: securityOrigin, + } +} + +// RequestCacheNamesReturns return values. +type RequestCacheNamesReturns struct { + Caches []*Cache `json:"caches,omitempty"` // Caches for the security origin. +} + +// Do executes CacheStorage.requestCacheNames against the provided context and +// target handler. +// +// returns: +// caches - Caches for the security origin. +func (p *RequestCacheNamesParams) Do(ctxt context.Context, h cdp.Handler) (caches []*Cache, err error) { + // execute + var res RequestCacheNamesReturns + err = h.Execute(ctxt, cdp.CommandCacheStorageRequestCacheNames, p, &res) + if err != nil { + return nil, err + } + + return res.Caches, nil +} + // RequestCachedResponseParams fetches cache entry. type RequestCachedResponseParams struct { CacheID CacheID `json:"cacheId"` // Id of cache that contains the enty. @@ -175,3 +131,47 @@ func (p *RequestCachedResponseParams) Do(ctxt context.Context, h cdp.Handler) (r return res.Response, nil } + +// RequestEntriesParams requests data from cache. +type RequestEntriesParams struct { + CacheID CacheID `json:"cacheId"` // ID of cache to get entries from. + SkipCount int64 `json:"skipCount"` // Number of records to skip. + PageSize int64 `json:"pageSize"` // Number of records to fetch. +} + +// RequestEntries requests data from cache. +// +// parameters: +// cacheID - ID of cache to get entries from. +// skipCount - Number of records to skip. +// pageSize - Number of records to fetch. +func RequestEntries(cacheID CacheID, skipCount int64, pageSize int64) *RequestEntriesParams { + return &RequestEntriesParams{ + CacheID: cacheID, + SkipCount: skipCount, + PageSize: pageSize, + } +} + +// RequestEntriesReturns return values. +type RequestEntriesReturns struct { + CacheDataEntries []*DataEntry `json:"cacheDataEntries,omitempty"` // Array of object store data entries. + HasMore bool `json:"hasMore,omitempty"` // If true, there are more entries to fetch in the given range. +} + +// Do executes CacheStorage.requestEntries against the provided context and +// target handler. +// +// returns: +// cacheDataEntries - Array of object store data entries. +// hasMore - If true, there are more entries to fetch in the given range. +func (p *RequestEntriesParams) Do(ctxt context.Context, h cdp.Handler) (cacheDataEntries []*DataEntry, hasMore bool, err error) { + // execute + var res RequestEntriesReturns + err = h.Execute(ctxt, cdp.CommandCacheStorageRequestEntries, p, &res) + if err != nil { + return nil, false, err + } + + return res.CacheDataEntries, res.HasMore, nil +} diff --git a/cdp/cdp.go b/cdp/cdp.go index 5bb945e..1c04cce 100644 --- a/cdp/cdp.go +++ b/cdp/cdp.go @@ -17,1678 +17,6 @@ import ( // Code generated by chromedp-gen. DO NOT EDIT. -// MessageError message error type. -type MessageError struct { - Code int64 `json:"code"` // Error code. - Message string `json:"message"` // Error message. -} - -// Error satisfies error interface. -func (e *MessageError) Error() string { - return fmt.Sprintf("%s (%d)", e.Message, e.Code) -} - -// Message chrome Debugging Protocol message sent to/read over websocket -// connection. -type Message struct { - ID int64 `json:"id,omitempty"` // Unique message identifier. - Method MethodType `json:"method,omitempty"` // Event or command type. - Params easyjson.RawMessage `json:"params,omitempty"` // Event or command parameters. - Result easyjson.RawMessage `json:"result,omitempty"` // Command return values. - Error *MessageError `json:"error,omitempty"` // Error message. -} - -// MethodType chrome Debugging Protocol method type (ie, event and command -// names). -type MethodType string - -// String returns the MethodType as string value. -func (t MethodType) String() string { - return string(t) -} - -// MethodType values. -const ( - EventInspectorDetached MethodType = "Inspector.detached" - EventInspectorTargetCrashed MethodType = "Inspector.targetCrashed" - CommandInspectorEnable MethodType = "Inspector.enable" - CommandInspectorDisable MethodType = "Inspector.disable" - CommandMemoryGetDOMCounters MethodType = "Memory.getDOMCounters" - CommandMemoryPrepareForLeakDetection MethodType = "Memory.prepareForLeakDetection" - CommandMemorySetPressureNotificationsSuppressed MethodType = "Memory.setPressureNotificationsSuppressed" - CommandMemorySimulatePressureNotification MethodType = "Memory.simulatePressureNotification" - EventPerformanceMetrics MethodType = "Performance.metrics" - CommandPerformanceEnable MethodType = "Performance.enable" - CommandPerformanceDisable MethodType = "Performance.disable" - CommandPerformanceGetMetrics MethodType = "Performance.getMetrics" - EventPageDomContentEventFired MethodType = "Page.domContentEventFired" - EventPageLoadEventFired MethodType = "Page.loadEventFired" - EventPageLifecycleEvent MethodType = "Page.lifecycleEvent" - EventPageFrameAttached MethodType = "Page.frameAttached" - EventPageFrameNavigated MethodType = "Page.frameNavigated" - EventPageFrameDetached MethodType = "Page.frameDetached" - EventPageFrameStartedLoading MethodType = "Page.frameStartedLoading" - EventPageFrameStoppedLoading MethodType = "Page.frameStoppedLoading" - EventPageFrameScheduledNavigation MethodType = "Page.frameScheduledNavigation" - EventPageFrameClearedScheduledNavigation MethodType = "Page.frameClearedScheduledNavigation" - EventPageFrameResized MethodType = "Page.frameResized" - EventPageJavascriptDialogOpening MethodType = "Page.javascriptDialogOpening" - EventPageJavascriptDialogClosed MethodType = "Page.javascriptDialogClosed" - EventPageScreencastFrame MethodType = "Page.screencastFrame" - EventPageScreencastVisibilityChanged MethodType = "Page.screencastVisibilityChanged" - EventPageInterstitialShown MethodType = "Page.interstitialShown" - EventPageInterstitialHidden MethodType = "Page.interstitialHidden" - EventPageWindowOpen MethodType = "Page.windowOpen" - CommandPageEnable MethodType = "Page.enable" - CommandPageDisable MethodType = "Page.disable" - CommandPageAddScriptToEvaluateOnNewDocument MethodType = "Page.addScriptToEvaluateOnNewDocument" - CommandPageRemoveScriptToEvaluateOnNewDocument MethodType = "Page.removeScriptToEvaluateOnNewDocument" - CommandPageSetAutoAttachToCreatedPages MethodType = "Page.setAutoAttachToCreatedPages" - CommandPageSetLifecycleEventsEnabled MethodType = "Page.setLifecycleEventsEnabled" - CommandPageReload MethodType = "Page.reload" - CommandPageSetAdBlockingEnabled MethodType = "Page.setAdBlockingEnabled" - CommandPageNavigate MethodType = "Page.navigate" - CommandPageStopLoading MethodType = "Page.stopLoading" - CommandPageGetNavigationHistory MethodType = "Page.getNavigationHistory" - CommandPageNavigateToHistoryEntry MethodType = "Page.navigateToHistoryEntry" - CommandPageGetResourceTree MethodType = "Page.getResourceTree" - CommandPageGetFrameTree MethodType = "Page.getFrameTree" - CommandPageGetResourceContent MethodType = "Page.getResourceContent" - CommandPageSearchInResource MethodType = "Page.searchInResource" - CommandPageSetDocumentContent MethodType = "Page.setDocumentContent" - CommandPageCaptureScreenshot MethodType = "Page.captureScreenshot" - CommandPagePrintToPDF MethodType = "Page.printToPDF" - CommandPageStartScreencast MethodType = "Page.startScreencast" - CommandPageStopScreencast MethodType = "Page.stopScreencast" - CommandPageScreencastFrameAck MethodType = "Page.screencastFrameAck" - CommandPageHandleJavaScriptDialog MethodType = "Page.handleJavaScriptDialog" - CommandPageGetAppManifest MethodType = "Page.getAppManifest" - CommandPageRequestAppBanner MethodType = "Page.requestAppBanner" - CommandPageGetLayoutMetrics MethodType = "Page.getLayoutMetrics" - CommandPageCreateIsolatedWorld MethodType = "Page.createIsolatedWorld" - CommandPageBringToFront MethodType = "Page.bringToFront" - CommandPageSetDownloadBehavior MethodType = "Page.setDownloadBehavior" - EventOverlayNodeHighlightRequested MethodType = "Overlay.nodeHighlightRequested" - EventOverlayInspectNodeRequested MethodType = "Overlay.inspectNodeRequested" - EventOverlayScreenshotRequested MethodType = "Overlay.screenshotRequested" - CommandOverlayEnable MethodType = "Overlay.enable" - CommandOverlayDisable MethodType = "Overlay.disable" - CommandOverlaySetShowPaintRects MethodType = "Overlay.setShowPaintRects" - CommandOverlaySetShowDebugBorders MethodType = "Overlay.setShowDebugBorders" - CommandOverlaySetShowFPSCounter MethodType = "Overlay.setShowFPSCounter" - CommandOverlaySetShowScrollBottleneckRects MethodType = "Overlay.setShowScrollBottleneckRects" - CommandOverlaySetShowViewportSizeOnResize MethodType = "Overlay.setShowViewportSizeOnResize" - CommandOverlaySetPausedInDebuggerMessage MethodType = "Overlay.setPausedInDebuggerMessage" - CommandOverlaySetSuspended MethodType = "Overlay.setSuspended" - CommandOverlaySetInspectMode MethodType = "Overlay.setInspectMode" - CommandOverlayHighlightRect MethodType = "Overlay.highlightRect" - CommandOverlayHighlightQuad MethodType = "Overlay.highlightQuad" - CommandOverlayHighlightNode MethodType = "Overlay.highlightNode" - CommandOverlayHighlightFrame MethodType = "Overlay.highlightFrame" - CommandOverlayHideHighlight MethodType = "Overlay.hideHighlight" - CommandOverlayGetHighlightObjectForTest MethodType = "Overlay.getHighlightObjectForTest" - EventEmulationVirtualTimeBudgetExpired MethodType = "Emulation.virtualTimeBudgetExpired" - EventEmulationVirtualTimeAdvanced MethodType = "Emulation.virtualTimeAdvanced" - EventEmulationVirtualTimePaused MethodType = "Emulation.virtualTimePaused" - CommandEmulationSetDeviceMetricsOverride MethodType = "Emulation.setDeviceMetricsOverride" - CommandEmulationClearDeviceMetricsOverride MethodType = "Emulation.clearDeviceMetricsOverride" - CommandEmulationResetPageScaleFactor MethodType = "Emulation.resetPageScaleFactor" - CommandEmulationSetPageScaleFactor MethodType = "Emulation.setPageScaleFactor" - CommandEmulationSetScriptExecutionDisabled MethodType = "Emulation.setScriptExecutionDisabled" - CommandEmulationSetGeolocationOverride MethodType = "Emulation.setGeolocationOverride" - CommandEmulationClearGeolocationOverride MethodType = "Emulation.clearGeolocationOverride" - CommandEmulationSetTouchEmulationEnabled MethodType = "Emulation.setTouchEmulationEnabled" - CommandEmulationSetEmitTouchEventsForMouse MethodType = "Emulation.setEmitTouchEventsForMouse" - CommandEmulationSetEmulatedMedia MethodType = "Emulation.setEmulatedMedia" - CommandEmulationSetCPUThrottlingRate MethodType = "Emulation.setCPUThrottlingRate" - CommandEmulationCanEmulate MethodType = "Emulation.canEmulate" - CommandEmulationSetVirtualTimePolicy MethodType = "Emulation.setVirtualTimePolicy" - CommandEmulationSetNavigatorOverrides MethodType = "Emulation.setNavigatorOverrides" - CommandEmulationSetDefaultBackgroundColorOverride MethodType = "Emulation.setDefaultBackgroundColorOverride" - EventSecuritySecurityStateChanged MethodType = "Security.securityStateChanged" - EventSecurityCertificateError MethodType = "Security.certificateError" - CommandSecurityEnable MethodType = "Security.enable" - CommandSecurityDisable MethodType = "Security.disable" - CommandSecurityHandleCertificateError MethodType = "Security.handleCertificateError" - CommandSecuritySetOverrideCertificateErrors MethodType = "Security.setOverrideCertificateErrors" - CommandAuditsGetEncodedResponse MethodType = "Audits.getEncodedResponse" - EventNetworkResourceChangedPriority MethodType = "Network.resourceChangedPriority" - EventNetworkRequestWillBeSent MethodType = "Network.requestWillBeSent" - EventNetworkRequestServedFromCache MethodType = "Network.requestServedFromCache" - EventNetworkResponseReceived MethodType = "Network.responseReceived" - EventNetworkDataReceived MethodType = "Network.dataReceived" - EventNetworkLoadingFinished MethodType = "Network.loadingFinished" - EventNetworkLoadingFailed MethodType = "Network.loadingFailed" - EventNetworkWebSocketWillSendHandshakeRequest MethodType = "Network.webSocketWillSendHandshakeRequest" - EventNetworkWebSocketHandshakeResponseReceived MethodType = "Network.webSocketHandshakeResponseReceived" - EventNetworkWebSocketCreated MethodType = "Network.webSocketCreated" - EventNetworkWebSocketClosed MethodType = "Network.webSocketClosed" - EventNetworkWebSocketFrameReceived MethodType = "Network.webSocketFrameReceived" - EventNetworkWebSocketFrameError MethodType = "Network.webSocketFrameError" - EventNetworkWebSocketFrameSent MethodType = "Network.webSocketFrameSent" - EventNetworkEventSourceMessageReceived MethodType = "Network.eventSourceMessageReceived" - EventNetworkRequestIntercepted MethodType = "Network.requestIntercepted" - CommandNetworkEnable MethodType = "Network.enable" - CommandNetworkDisable MethodType = "Network.disable" - CommandNetworkSetUserAgentOverride MethodType = "Network.setUserAgentOverride" - CommandNetworkSearchInResponseBody MethodType = "Network.searchInResponseBody" - CommandNetworkSetExtraHTTPHeaders MethodType = "Network.setExtraHTTPHeaders" - CommandNetworkGetResponseBody MethodType = "Network.getResponseBody" - CommandNetworkSetBlockedURLS MethodType = "Network.setBlockedURLs" - CommandNetworkReplayXHR MethodType = "Network.replayXHR" - CommandNetworkClearBrowserCache MethodType = "Network.clearBrowserCache" - CommandNetworkClearBrowserCookies MethodType = "Network.clearBrowserCookies" - CommandNetworkGetCookies MethodType = "Network.getCookies" - CommandNetworkGetAllCookies MethodType = "Network.getAllCookies" - CommandNetworkDeleteCookies MethodType = "Network.deleteCookies" - CommandNetworkSetCookie MethodType = "Network.setCookie" - CommandNetworkSetCookies MethodType = "Network.setCookies" - CommandNetworkEmulateNetworkConditions MethodType = "Network.emulateNetworkConditions" - CommandNetworkSetCacheDisabled MethodType = "Network.setCacheDisabled" - CommandNetworkSetBypassServiceWorker MethodType = "Network.setBypassServiceWorker" - CommandNetworkSetDataSizeLimitsForTest MethodType = "Network.setDataSizeLimitsForTest" - CommandNetworkGetCertificate MethodType = "Network.getCertificate" - CommandNetworkSetRequestInterception MethodType = "Network.setRequestInterception" - CommandNetworkContinueInterceptedRequest MethodType = "Network.continueInterceptedRequest" - CommandNetworkGetResponseBodyForInterception MethodType = "Network.getResponseBodyForInterception" - EventDatabaseAddDatabase MethodType = "Database.addDatabase" - CommandDatabaseEnable MethodType = "Database.enable" - CommandDatabaseDisable MethodType = "Database.disable" - CommandDatabaseGetDatabaseTableNames MethodType = "Database.getDatabaseTableNames" - CommandDatabaseExecuteSQL MethodType = "Database.executeSQL" - CommandIndexedDBEnable MethodType = "IndexedDB.enable" - CommandIndexedDBDisable MethodType = "IndexedDB.disable" - CommandIndexedDBRequestDatabaseNames MethodType = "IndexedDB.requestDatabaseNames" - CommandIndexedDBRequestDatabase MethodType = "IndexedDB.requestDatabase" - CommandIndexedDBRequestData MethodType = "IndexedDB.requestData" - CommandIndexedDBClearObjectStore MethodType = "IndexedDB.clearObjectStore" - CommandIndexedDBDeleteDatabase MethodType = "IndexedDB.deleteDatabase" - CommandCacheStorageRequestCacheNames MethodType = "CacheStorage.requestCacheNames" - CommandCacheStorageRequestEntries MethodType = "CacheStorage.requestEntries" - CommandCacheStorageDeleteCache MethodType = "CacheStorage.deleteCache" - CommandCacheStorageDeleteEntry MethodType = "CacheStorage.deleteEntry" - CommandCacheStorageRequestCachedResponse MethodType = "CacheStorage.requestCachedResponse" - EventDOMStorageDomStorageItemsCleared MethodType = "DOMStorage.domStorageItemsCleared" - EventDOMStorageDomStorageItemRemoved MethodType = "DOMStorage.domStorageItemRemoved" - EventDOMStorageDomStorageItemAdded MethodType = "DOMStorage.domStorageItemAdded" - EventDOMStorageDomStorageItemUpdated MethodType = "DOMStorage.domStorageItemUpdated" - CommandDOMStorageEnable MethodType = "DOMStorage.enable" - CommandDOMStorageDisable MethodType = "DOMStorage.disable" - CommandDOMStorageClear MethodType = "DOMStorage.clear" - CommandDOMStorageGetDOMStorageItems MethodType = "DOMStorage.getDOMStorageItems" - CommandDOMStorageSetDOMStorageItem MethodType = "DOMStorage.setDOMStorageItem" - CommandDOMStorageRemoveDOMStorageItem MethodType = "DOMStorage.removeDOMStorageItem" - EventApplicationCacheApplicationCacheStatusUpdated MethodType = "ApplicationCache.applicationCacheStatusUpdated" - EventApplicationCacheNetworkStateUpdated MethodType = "ApplicationCache.networkStateUpdated" - CommandApplicationCacheGetFramesWithManifests MethodType = "ApplicationCache.getFramesWithManifests" - CommandApplicationCacheEnable MethodType = "ApplicationCache.enable" - CommandApplicationCacheGetManifestForFrame MethodType = "ApplicationCache.getManifestForFrame" - CommandApplicationCacheGetApplicationCacheForFrame MethodType = "ApplicationCache.getApplicationCacheForFrame" - EventDOMDocumentUpdated MethodType = "DOM.documentUpdated" - EventDOMSetChildNodes MethodType = "DOM.setChildNodes" - EventDOMAttributeModified MethodType = "DOM.attributeModified" - EventDOMAttributeRemoved MethodType = "DOM.attributeRemoved" - EventDOMInlineStyleInvalidated MethodType = "DOM.inlineStyleInvalidated" - EventDOMCharacterDataModified MethodType = "DOM.characterDataModified" - EventDOMChildNodeCountUpdated MethodType = "DOM.childNodeCountUpdated" - EventDOMChildNodeInserted MethodType = "DOM.childNodeInserted" - EventDOMChildNodeRemoved MethodType = "DOM.childNodeRemoved" - EventDOMShadowRootPushed MethodType = "DOM.shadowRootPushed" - EventDOMShadowRootPopped MethodType = "DOM.shadowRootPopped" - EventDOMPseudoElementAdded MethodType = "DOM.pseudoElementAdded" - EventDOMPseudoElementRemoved MethodType = "DOM.pseudoElementRemoved" - EventDOMDistributedNodesUpdated MethodType = "DOM.distributedNodesUpdated" - CommandDOMEnable MethodType = "DOM.enable" - CommandDOMDisable MethodType = "DOM.disable" - CommandDOMGetDocument MethodType = "DOM.getDocument" - CommandDOMGetFlattenedDocument MethodType = "DOM.getFlattenedDocument" - CommandDOMCollectClassNamesFromSubtree MethodType = "DOM.collectClassNamesFromSubtree" - CommandDOMRequestChildNodes MethodType = "DOM.requestChildNodes" - CommandDOMQuerySelector MethodType = "DOM.querySelector" - CommandDOMQuerySelectorAll MethodType = "DOM.querySelectorAll" - CommandDOMSetNodeName MethodType = "DOM.setNodeName" - CommandDOMSetNodeValue MethodType = "DOM.setNodeValue" - CommandDOMRemoveNode MethodType = "DOM.removeNode" - CommandDOMSetAttributeValue MethodType = "DOM.setAttributeValue" - CommandDOMSetAttributesAsText MethodType = "DOM.setAttributesAsText" - CommandDOMRemoveAttribute MethodType = "DOM.removeAttribute" - CommandDOMGetOuterHTML MethodType = "DOM.getOuterHTML" - CommandDOMSetOuterHTML MethodType = "DOM.setOuterHTML" - CommandDOMPerformSearch MethodType = "DOM.performSearch" - CommandDOMGetSearchResults MethodType = "DOM.getSearchResults" - CommandDOMDiscardSearchResults MethodType = "DOM.discardSearchResults" - CommandDOMRequestNode MethodType = "DOM.requestNode" - CommandDOMPushNodeByPathToFrontend MethodType = "DOM.pushNodeByPathToFrontend" - CommandDOMPushNodesByBackendIdsToFrontend MethodType = "DOM.pushNodesByBackendIdsToFrontend" - CommandDOMSetInspectedNode MethodType = "DOM.setInspectedNode" - CommandDOMResolveNode MethodType = "DOM.resolveNode" - CommandDOMGetAttributes MethodType = "DOM.getAttributes" - CommandDOMCopyTo MethodType = "DOM.copyTo" - CommandDOMMoveTo MethodType = "DOM.moveTo" - CommandDOMUndo MethodType = "DOM.undo" - CommandDOMRedo MethodType = "DOM.redo" - CommandDOMMarkUndoableState MethodType = "DOM.markUndoableState" - CommandDOMFocus MethodType = "DOM.focus" - CommandDOMSetFileInputFiles MethodType = "DOM.setFileInputFiles" - CommandDOMGetBoxModel MethodType = "DOM.getBoxModel" - CommandDOMGetNodeForLocation MethodType = "DOM.getNodeForLocation" - CommandDOMGetRelayoutBoundary MethodType = "DOM.getRelayoutBoundary" - CommandDOMDescribeNode MethodType = "DOM.describeNode" - EventCSSMediaQueryResultChanged MethodType = "CSS.mediaQueryResultChanged" - EventCSSFontsUpdated MethodType = "CSS.fontsUpdated" - EventCSSStyleSheetChanged MethodType = "CSS.styleSheetChanged" - EventCSSStyleSheetAdded MethodType = "CSS.styleSheetAdded" - EventCSSStyleSheetRemoved MethodType = "CSS.styleSheetRemoved" - CommandCSSEnable MethodType = "CSS.enable" - CommandCSSDisable MethodType = "CSS.disable" - CommandCSSGetMatchedStylesForNode MethodType = "CSS.getMatchedStylesForNode" - CommandCSSGetInlineStylesForNode MethodType = "CSS.getInlineStylesForNode" - CommandCSSGetComputedStyleForNode MethodType = "CSS.getComputedStyleForNode" - CommandCSSGetPlatformFontsForNode MethodType = "CSS.getPlatformFontsForNode" - CommandCSSGetStyleSheetText MethodType = "CSS.getStyleSheetText" - CommandCSSCollectClassNames MethodType = "CSS.collectClassNames" - CommandCSSSetStyleSheetText MethodType = "CSS.setStyleSheetText" - CommandCSSSetRuleSelector MethodType = "CSS.setRuleSelector" - CommandCSSSetKeyframeKey MethodType = "CSS.setKeyframeKey" - CommandCSSSetStyleTexts MethodType = "CSS.setStyleTexts" - CommandCSSSetMediaText MethodType = "CSS.setMediaText" - CommandCSSCreateStyleSheet MethodType = "CSS.createStyleSheet" - CommandCSSAddRule MethodType = "CSS.addRule" - CommandCSSForcePseudoState MethodType = "CSS.forcePseudoState" - CommandCSSGetMediaQueries MethodType = "CSS.getMediaQueries" - CommandCSSSetEffectivePropertyValueForNode MethodType = "CSS.setEffectivePropertyValueForNode" - CommandCSSGetBackgroundColors MethodType = "CSS.getBackgroundColors" - CommandCSSStartRuleUsageTracking MethodType = "CSS.startRuleUsageTracking" - CommandCSSTakeCoverageDelta MethodType = "CSS.takeCoverageDelta" - CommandCSSStopRuleUsageTracking MethodType = "CSS.stopRuleUsageTracking" - CommandDOMSnapshotGetSnapshot MethodType = "DOMSnapshot.getSnapshot" - CommandIORead MethodType = "IO.read" - CommandIOClose MethodType = "IO.close" - CommandIOResolveBlob MethodType = "IO.resolveBlob" - CommandDOMDebuggerSetDOMBreakpoint MethodType = "DOMDebugger.setDOMBreakpoint" - CommandDOMDebuggerRemoveDOMBreakpoint MethodType = "DOMDebugger.removeDOMBreakpoint" - CommandDOMDebuggerSetEventListenerBreakpoint MethodType = "DOMDebugger.setEventListenerBreakpoint" - CommandDOMDebuggerRemoveEventListenerBreakpoint MethodType = "DOMDebugger.removeEventListenerBreakpoint" - CommandDOMDebuggerSetInstrumentationBreakpoint MethodType = "DOMDebugger.setInstrumentationBreakpoint" - CommandDOMDebuggerRemoveInstrumentationBreakpoint MethodType = "DOMDebugger.removeInstrumentationBreakpoint" - CommandDOMDebuggerSetXHRBreakpoint MethodType = "DOMDebugger.setXHRBreakpoint" - CommandDOMDebuggerRemoveXHRBreakpoint MethodType = "DOMDebugger.removeXHRBreakpoint" - CommandDOMDebuggerGetEventListeners MethodType = "DOMDebugger.getEventListeners" - EventTargetTargetCreated MethodType = "Target.targetCreated" - EventTargetTargetInfoChanged MethodType = "Target.targetInfoChanged" - EventTargetTargetDestroyed MethodType = "Target.targetDestroyed" - EventTargetAttachedToTarget MethodType = "Target.attachedToTarget" - EventTargetDetachedFromTarget MethodType = "Target.detachedFromTarget" - EventTargetReceivedMessageFromTarget MethodType = "Target.receivedMessageFromTarget" - CommandTargetSetDiscoverTargets MethodType = "Target.setDiscoverTargets" - CommandTargetSetAutoAttach MethodType = "Target.setAutoAttach" - CommandTargetSetAttachToFrames MethodType = "Target.setAttachToFrames" - CommandTargetSetRemoteLocations MethodType = "Target.setRemoteLocations" - CommandTargetSendMessageToTarget MethodType = "Target.sendMessageToTarget" - CommandTargetGetTargetInfo MethodType = "Target.getTargetInfo" - CommandTargetActivateTarget MethodType = "Target.activateTarget" - CommandTargetCloseTarget MethodType = "Target.closeTarget" - CommandTargetAttachToTarget MethodType = "Target.attachToTarget" - CommandTargetDetachFromTarget MethodType = "Target.detachFromTarget" - CommandTargetCreateBrowserContext MethodType = "Target.createBrowserContext" - CommandTargetDisposeBrowserContext MethodType = "Target.disposeBrowserContext" - CommandTargetCreateTarget MethodType = "Target.createTarget" - CommandTargetGetTargets MethodType = "Target.getTargets" - EventHeadlessExperimentalNeedsBeginFramesChanged MethodType = "HeadlessExperimental.needsBeginFramesChanged" - EventHeadlessExperimentalMainFrameReadyForScreenshots MethodType = "HeadlessExperimental.mainFrameReadyForScreenshots" - CommandHeadlessExperimentalEnable MethodType = "HeadlessExperimental.enable" - CommandHeadlessExperimentalDisable MethodType = "HeadlessExperimental.disable" - CommandHeadlessExperimentalBeginFrame MethodType = "HeadlessExperimental.beginFrame" - EventServiceWorkerWorkerRegistrationUpdated MethodType = "ServiceWorker.workerRegistrationUpdated" - EventServiceWorkerWorkerVersionUpdated MethodType = "ServiceWorker.workerVersionUpdated" - EventServiceWorkerWorkerErrorReported MethodType = "ServiceWorker.workerErrorReported" - CommandServiceWorkerEnable MethodType = "ServiceWorker.enable" - CommandServiceWorkerDisable MethodType = "ServiceWorker.disable" - CommandServiceWorkerUnregister MethodType = "ServiceWorker.unregister" - CommandServiceWorkerUpdateRegistration MethodType = "ServiceWorker.updateRegistration" - CommandServiceWorkerStartWorker MethodType = "ServiceWorker.startWorker" - CommandServiceWorkerSkipWaiting MethodType = "ServiceWorker.skipWaiting" - CommandServiceWorkerStopWorker MethodType = "ServiceWorker.stopWorker" - CommandServiceWorkerStopAllWorkers MethodType = "ServiceWorker.stopAllWorkers" - CommandServiceWorkerInspectWorker MethodType = "ServiceWorker.inspectWorker" - CommandServiceWorkerSetForceUpdateOnPageLoad MethodType = "ServiceWorker.setForceUpdateOnPageLoad" - CommandServiceWorkerDeliverPushMessage MethodType = "ServiceWorker.deliverPushMessage" - CommandServiceWorkerDispatchSyncEvent MethodType = "ServiceWorker.dispatchSyncEvent" - CommandInputSetIgnoreInputEvents MethodType = "Input.setIgnoreInputEvents" - CommandInputDispatchKeyEvent MethodType = "Input.dispatchKeyEvent" - CommandInputDispatchMouseEvent MethodType = "Input.dispatchMouseEvent" - CommandInputDispatchTouchEvent MethodType = "Input.dispatchTouchEvent" - CommandInputEmulateTouchFromMouseEvent MethodType = "Input.emulateTouchFromMouseEvent" - CommandInputSynthesizePinchGesture MethodType = "Input.synthesizePinchGesture" - CommandInputSynthesizeScrollGesture MethodType = "Input.synthesizeScrollGesture" - CommandInputSynthesizeTapGesture MethodType = "Input.synthesizeTapGesture" - EventLayerTreeLayerTreeDidChange MethodType = "LayerTree.layerTreeDidChange" - EventLayerTreeLayerPainted MethodType = "LayerTree.layerPainted" - CommandLayerTreeEnable MethodType = "LayerTree.enable" - CommandLayerTreeDisable MethodType = "LayerTree.disable" - CommandLayerTreeCompositingReasons MethodType = "LayerTree.compositingReasons" - CommandLayerTreeMakeSnapshot MethodType = "LayerTree.makeSnapshot" - CommandLayerTreeLoadSnapshot MethodType = "LayerTree.loadSnapshot" - CommandLayerTreeReleaseSnapshot MethodType = "LayerTree.releaseSnapshot" - CommandLayerTreeProfileSnapshot MethodType = "LayerTree.profileSnapshot" - CommandLayerTreeReplaySnapshot MethodType = "LayerTree.replaySnapshot" - CommandLayerTreeSnapshotCommandLog MethodType = "LayerTree.snapshotCommandLog" - CommandDeviceOrientationSetDeviceOrientationOverride MethodType = "DeviceOrientation.setDeviceOrientationOverride" - CommandDeviceOrientationClearDeviceOrientationOverride MethodType = "DeviceOrientation.clearDeviceOrientationOverride" - EventTracingDataCollected MethodType = "Tracing.dataCollected" - EventTracingTracingComplete MethodType = "Tracing.tracingComplete" - EventTracingBufferUsage MethodType = "Tracing.bufferUsage" - CommandTracingStart MethodType = "Tracing.start" - CommandTracingEnd MethodType = "Tracing.end" - CommandTracingGetCategories MethodType = "Tracing.getCategories" - CommandTracingRequestMemoryDump MethodType = "Tracing.requestMemoryDump" - CommandTracingRecordClockSyncMarker MethodType = "Tracing.recordClockSyncMarker" - EventAnimationAnimationCreated MethodType = "Animation.animationCreated" - EventAnimationAnimationStarted MethodType = "Animation.animationStarted" - EventAnimationAnimationCanceled MethodType = "Animation.animationCanceled" - CommandAnimationEnable MethodType = "Animation.enable" - CommandAnimationDisable MethodType = "Animation.disable" - CommandAnimationGetPlaybackRate MethodType = "Animation.getPlaybackRate" - CommandAnimationSetPlaybackRate MethodType = "Animation.setPlaybackRate" - CommandAnimationGetCurrentTime MethodType = "Animation.getCurrentTime" - CommandAnimationSetPaused MethodType = "Animation.setPaused" - CommandAnimationSetTiming MethodType = "Animation.setTiming" - CommandAnimationSeekAnimations MethodType = "Animation.seekAnimations" - CommandAnimationReleaseAnimations MethodType = "Animation.releaseAnimations" - CommandAnimationResolveAnimation MethodType = "Animation.resolveAnimation" - CommandAccessibilityGetPartialAXTree MethodType = "Accessibility.getPartialAXTree" - EventStorageCacheStorageListUpdated MethodType = "Storage.cacheStorageListUpdated" - EventStorageCacheStorageContentUpdated MethodType = "Storage.cacheStorageContentUpdated" - EventStorageIndexedDBListUpdated MethodType = "Storage.indexedDBListUpdated" - EventStorageIndexedDBContentUpdated MethodType = "Storage.indexedDBContentUpdated" - CommandStorageClearDataForOrigin MethodType = "Storage.clearDataForOrigin" - CommandStorageGetUsageAndQuota MethodType = "Storage.getUsageAndQuota" - CommandStorageTrackCacheStorageForOrigin MethodType = "Storage.trackCacheStorageForOrigin" - CommandStorageUntrackCacheStorageForOrigin MethodType = "Storage.untrackCacheStorageForOrigin" - CommandStorageTrackIndexedDBForOrigin MethodType = "Storage.trackIndexedDBForOrigin" - CommandStorageUntrackIndexedDBForOrigin MethodType = "Storage.untrackIndexedDBForOrigin" - EventLogEntryAdded MethodType = "Log.entryAdded" - CommandLogEnable MethodType = "Log.enable" - CommandLogDisable MethodType = "Log.disable" - CommandLogClear MethodType = "Log.clear" - CommandLogStartViolationsReport MethodType = "Log.startViolationsReport" - CommandLogStopViolationsReport MethodType = "Log.stopViolationsReport" - CommandSystemInfoGetInfo MethodType = "SystemInfo.getInfo" - EventTetheringAccepted MethodType = "Tethering.accepted" - CommandTetheringBind MethodType = "Tethering.bind" - CommandTetheringUnbind MethodType = "Tethering.unbind" - CommandBrowserClose MethodType = "Browser.close" - CommandBrowserGetWindowForTarget MethodType = "Browser.getWindowForTarget" - CommandBrowserGetVersion MethodType = "Browser.getVersion" - CommandBrowserSetWindowBounds MethodType = "Browser.setWindowBounds" - CommandBrowserGetWindowBounds MethodType = "Browser.getWindowBounds" - EventRuntimeExecutionContextCreated MethodType = "Runtime.executionContextCreated" - EventRuntimeExecutionContextDestroyed MethodType = "Runtime.executionContextDestroyed" - EventRuntimeExecutionContextsCleared MethodType = "Runtime.executionContextsCleared" - EventRuntimeExceptionThrown MethodType = "Runtime.exceptionThrown" - EventRuntimeExceptionRevoked MethodType = "Runtime.exceptionRevoked" - EventRuntimeConsoleAPICalled MethodType = "Runtime.consoleAPICalled" - EventRuntimeInspectRequested MethodType = "Runtime.inspectRequested" - CommandRuntimeEvaluate MethodType = "Runtime.evaluate" - CommandRuntimeAwaitPromise MethodType = "Runtime.awaitPromise" - CommandRuntimeCallFunctionOn MethodType = "Runtime.callFunctionOn" - CommandRuntimeGetProperties MethodType = "Runtime.getProperties" - CommandRuntimeReleaseObject MethodType = "Runtime.releaseObject" - CommandRuntimeReleaseObjectGroup MethodType = "Runtime.releaseObjectGroup" - CommandRuntimeRunIfWaitingForDebugger MethodType = "Runtime.runIfWaitingForDebugger" - CommandRuntimeEnable MethodType = "Runtime.enable" - CommandRuntimeDisable MethodType = "Runtime.disable" - CommandRuntimeDiscardConsoleEntries MethodType = "Runtime.discardConsoleEntries" - CommandRuntimeSetCustomObjectFormatterEnabled MethodType = "Runtime.setCustomObjectFormatterEnabled" - CommandRuntimeCompileScript MethodType = "Runtime.compileScript" - CommandRuntimeRunScript MethodType = "Runtime.runScript" - CommandRuntimeQueryObjects MethodType = "Runtime.queryObjects" - CommandRuntimeGlobalLexicalScopeNames MethodType = "Runtime.globalLexicalScopeNames" - EventDebuggerScriptParsed MethodType = "Debugger.scriptParsed" - EventDebuggerScriptFailedToParse MethodType = "Debugger.scriptFailedToParse" - EventDebuggerBreakpointResolved MethodType = "Debugger.breakpointResolved" - EventDebuggerPaused MethodType = "Debugger.paused" - EventDebuggerResumed MethodType = "Debugger.resumed" - CommandDebuggerEnable MethodType = "Debugger.enable" - CommandDebuggerDisable MethodType = "Debugger.disable" - CommandDebuggerSetBreakpointsActive MethodType = "Debugger.setBreakpointsActive" - CommandDebuggerSetSkipAllPauses MethodType = "Debugger.setSkipAllPauses" - CommandDebuggerSetBreakpointByURL MethodType = "Debugger.setBreakpointByUrl" - CommandDebuggerSetBreakpoint MethodType = "Debugger.setBreakpoint" - CommandDebuggerRemoveBreakpoint MethodType = "Debugger.removeBreakpoint" - CommandDebuggerGetPossibleBreakpoints MethodType = "Debugger.getPossibleBreakpoints" - CommandDebuggerContinueToLocation MethodType = "Debugger.continueToLocation" - CommandDebuggerPauseOnAsyncCall MethodType = "Debugger.pauseOnAsyncCall" - CommandDebuggerStepOver MethodType = "Debugger.stepOver" - CommandDebuggerStepInto MethodType = "Debugger.stepInto" - CommandDebuggerStepOut MethodType = "Debugger.stepOut" - CommandDebuggerPause MethodType = "Debugger.pause" - CommandDebuggerScheduleStepIntoAsync MethodType = "Debugger.scheduleStepIntoAsync" - CommandDebuggerResume MethodType = "Debugger.resume" - CommandDebuggerGetStackTrace MethodType = "Debugger.getStackTrace" - CommandDebuggerSearchInContent MethodType = "Debugger.searchInContent" - CommandDebuggerSetScriptSource MethodType = "Debugger.setScriptSource" - CommandDebuggerRestartFrame MethodType = "Debugger.restartFrame" - CommandDebuggerGetScriptSource MethodType = "Debugger.getScriptSource" - CommandDebuggerSetPauseOnExceptions MethodType = "Debugger.setPauseOnExceptions" - CommandDebuggerEvaluateOnCallFrame MethodType = "Debugger.evaluateOnCallFrame" - CommandDebuggerSetVariableValue MethodType = "Debugger.setVariableValue" - CommandDebuggerSetReturnValue MethodType = "Debugger.setReturnValue" - CommandDebuggerSetAsyncCallStackDepth MethodType = "Debugger.setAsyncCallStackDepth" - CommandDebuggerSetBlackboxPatterns MethodType = "Debugger.setBlackboxPatterns" - CommandDebuggerSetBlackboxedRanges MethodType = "Debugger.setBlackboxedRanges" - EventProfilerConsoleProfileStarted MethodType = "Profiler.consoleProfileStarted" - EventProfilerConsoleProfileFinished MethodType = "Profiler.consoleProfileFinished" - CommandProfilerEnable MethodType = "Profiler.enable" - CommandProfilerDisable MethodType = "Profiler.disable" - CommandProfilerSetSamplingInterval MethodType = "Profiler.setSamplingInterval" - CommandProfilerStart MethodType = "Profiler.start" - CommandProfilerStop MethodType = "Profiler.stop" - CommandProfilerStartPreciseCoverage MethodType = "Profiler.startPreciseCoverage" - CommandProfilerStopPreciseCoverage MethodType = "Profiler.stopPreciseCoverage" - CommandProfilerTakePreciseCoverage MethodType = "Profiler.takePreciseCoverage" - CommandProfilerGetBestEffortCoverage MethodType = "Profiler.getBestEffortCoverage" - CommandProfilerStartTypeProfile MethodType = "Profiler.startTypeProfile" - CommandProfilerStopTypeProfile MethodType = "Profiler.stopTypeProfile" - CommandProfilerTakeTypeProfile MethodType = "Profiler.takeTypeProfile" - EventHeapProfilerAddHeapSnapshotChunk MethodType = "HeapProfiler.addHeapSnapshotChunk" - EventHeapProfilerResetProfiles MethodType = "HeapProfiler.resetProfiles" - EventHeapProfilerReportHeapSnapshotProgress MethodType = "HeapProfiler.reportHeapSnapshotProgress" - EventHeapProfilerLastSeenObjectID MethodType = "HeapProfiler.lastSeenObjectId" - EventHeapProfilerHeapStatsUpdate MethodType = "HeapProfiler.heapStatsUpdate" - CommandHeapProfilerEnable MethodType = "HeapProfiler.enable" - CommandHeapProfilerDisable MethodType = "HeapProfiler.disable" - CommandHeapProfilerStartTrackingHeapObjects MethodType = "HeapProfiler.startTrackingHeapObjects" - CommandHeapProfilerStopTrackingHeapObjects MethodType = "HeapProfiler.stopTrackingHeapObjects" - CommandHeapProfilerTakeHeapSnapshot MethodType = "HeapProfiler.takeHeapSnapshot" - CommandHeapProfilerCollectGarbage MethodType = "HeapProfiler.collectGarbage" - CommandHeapProfilerGetObjectByHeapObjectID MethodType = "HeapProfiler.getObjectByHeapObjectId" - CommandHeapProfilerAddInspectedHeapObject MethodType = "HeapProfiler.addInspectedHeapObject" - CommandHeapProfilerGetHeapObjectID MethodType = "HeapProfiler.getHeapObjectId" - CommandHeapProfilerStartSampling MethodType = "HeapProfiler.startSampling" - CommandHeapProfilerStopSampling MethodType = "HeapProfiler.stopSampling" - CommandHeapProfilerGetSamplingProfile MethodType = "HeapProfiler.getSamplingProfile" -) - -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t MethodType) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t MethodType) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) { - switch MethodType(in.String()) { - case EventInspectorDetached: - *t = EventInspectorDetached - case EventInspectorTargetCrashed: - *t = EventInspectorTargetCrashed - case CommandInspectorEnable: - *t = CommandInspectorEnable - case CommandInspectorDisable: - *t = CommandInspectorDisable - case CommandMemoryGetDOMCounters: - *t = CommandMemoryGetDOMCounters - case CommandMemoryPrepareForLeakDetection: - *t = CommandMemoryPrepareForLeakDetection - case CommandMemorySetPressureNotificationsSuppressed: - *t = CommandMemorySetPressureNotificationsSuppressed - case CommandMemorySimulatePressureNotification: - *t = CommandMemorySimulatePressureNotification - case EventPerformanceMetrics: - *t = EventPerformanceMetrics - case CommandPerformanceEnable: - *t = CommandPerformanceEnable - case CommandPerformanceDisable: - *t = CommandPerformanceDisable - case CommandPerformanceGetMetrics: - *t = CommandPerformanceGetMetrics - case EventPageDomContentEventFired: - *t = EventPageDomContentEventFired - case EventPageLoadEventFired: - *t = EventPageLoadEventFired - case EventPageLifecycleEvent: - *t = EventPageLifecycleEvent - case EventPageFrameAttached: - *t = EventPageFrameAttached - case EventPageFrameNavigated: - *t = EventPageFrameNavigated - case EventPageFrameDetached: - *t = EventPageFrameDetached - case EventPageFrameStartedLoading: - *t = EventPageFrameStartedLoading - case EventPageFrameStoppedLoading: - *t = EventPageFrameStoppedLoading - case EventPageFrameScheduledNavigation: - *t = EventPageFrameScheduledNavigation - case EventPageFrameClearedScheduledNavigation: - *t = EventPageFrameClearedScheduledNavigation - case EventPageFrameResized: - *t = EventPageFrameResized - case EventPageJavascriptDialogOpening: - *t = EventPageJavascriptDialogOpening - case EventPageJavascriptDialogClosed: - *t = EventPageJavascriptDialogClosed - case EventPageScreencastFrame: - *t = EventPageScreencastFrame - case EventPageScreencastVisibilityChanged: - *t = EventPageScreencastVisibilityChanged - case EventPageInterstitialShown: - *t = EventPageInterstitialShown - case EventPageInterstitialHidden: - *t = EventPageInterstitialHidden - case EventPageWindowOpen: - *t = EventPageWindowOpen - case CommandPageEnable: - *t = CommandPageEnable - case CommandPageDisable: - *t = CommandPageDisable - case CommandPageAddScriptToEvaluateOnNewDocument: - *t = CommandPageAddScriptToEvaluateOnNewDocument - case CommandPageRemoveScriptToEvaluateOnNewDocument: - *t = CommandPageRemoveScriptToEvaluateOnNewDocument - case CommandPageSetAutoAttachToCreatedPages: - *t = CommandPageSetAutoAttachToCreatedPages - case CommandPageSetLifecycleEventsEnabled: - *t = CommandPageSetLifecycleEventsEnabled - case CommandPageReload: - *t = CommandPageReload - case CommandPageSetAdBlockingEnabled: - *t = CommandPageSetAdBlockingEnabled - case CommandPageNavigate: - *t = CommandPageNavigate - case CommandPageStopLoading: - *t = CommandPageStopLoading - case CommandPageGetNavigationHistory: - *t = CommandPageGetNavigationHistory - case CommandPageNavigateToHistoryEntry: - *t = CommandPageNavigateToHistoryEntry - case CommandPageGetResourceTree: - *t = CommandPageGetResourceTree - case CommandPageGetFrameTree: - *t = CommandPageGetFrameTree - case CommandPageGetResourceContent: - *t = CommandPageGetResourceContent - case CommandPageSearchInResource: - *t = CommandPageSearchInResource - case CommandPageSetDocumentContent: - *t = CommandPageSetDocumentContent - case CommandPageCaptureScreenshot: - *t = CommandPageCaptureScreenshot - case CommandPagePrintToPDF: - *t = CommandPagePrintToPDF - case CommandPageStartScreencast: - *t = CommandPageStartScreencast - case CommandPageStopScreencast: - *t = CommandPageStopScreencast - case CommandPageScreencastFrameAck: - *t = CommandPageScreencastFrameAck - case CommandPageHandleJavaScriptDialog: - *t = CommandPageHandleJavaScriptDialog - case CommandPageGetAppManifest: - *t = CommandPageGetAppManifest - case CommandPageRequestAppBanner: - *t = CommandPageRequestAppBanner - case CommandPageGetLayoutMetrics: - *t = CommandPageGetLayoutMetrics - case CommandPageCreateIsolatedWorld: - *t = CommandPageCreateIsolatedWorld - case CommandPageBringToFront: - *t = CommandPageBringToFront - case CommandPageSetDownloadBehavior: - *t = CommandPageSetDownloadBehavior - case EventOverlayNodeHighlightRequested: - *t = EventOverlayNodeHighlightRequested - case EventOverlayInspectNodeRequested: - *t = EventOverlayInspectNodeRequested - case EventOverlayScreenshotRequested: - *t = EventOverlayScreenshotRequested - case CommandOverlayEnable: - *t = CommandOverlayEnable - case CommandOverlayDisable: - *t = CommandOverlayDisable - case CommandOverlaySetShowPaintRects: - *t = CommandOverlaySetShowPaintRects - case CommandOverlaySetShowDebugBorders: - *t = CommandOverlaySetShowDebugBorders - case CommandOverlaySetShowFPSCounter: - *t = CommandOverlaySetShowFPSCounter - case CommandOverlaySetShowScrollBottleneckRects: - *t = CommandOverlaySetShowScrollBottleneckRects - case CommandOverlaySetShowViewportSizeOnResize: - *t = CommandOverlaySetShowViewportSizeOnResize - case CommandOverlaySetPausedInDebuggerMessage: - *t = CommandOverlaySetPausedInDebuggerMessage - case CommandOverlaySetSuspended: - *t = CommandOverlaySetSuspended - case CommandOverlaySetInspectMode: - *t = CommandOverlaySetInspectMode - case CommandOverlayHighlightRect: - *t = CommandOverlayHighlightRect - case CommandOverlayHighlightQuad: - *t = CommandOverlayHighlightQuad - case CommandOverlayHighlightNode: - *t = CommandOverlayHighlightNode - case CommandOverlayHighlightFrame: - *t = CommandOverlayHighlightFrame - case CommandOverlayHideHighlight: - *t = CommandOverlayHideHighlight - case CommandOverlayGetHighlightObjectForTest: - *t = CommandOverlayGetHighlightObjectForTest - case EventEmulationVirtualTimeBudgetExpired: - *t = EventEmulationVirtualTimeBudgetExpired - case EventEmulationVirtualTimeAdvanced: - *t = EventEmulationVirtualTimeAdvanced - case EventEmulationVirtualTimePaused: - *t = EventEmulationVirtualTimePaused - case CommandEmulationSetDeviceMetricsOverride: - *t = CommandEmulationSetDeviceMetricsOverride - case CommandEmulationClearDeviceMetricsOverride: - *t = CommandEmulationClearDeviceMetricsOverride - case CommandEmulationResetPageScaleFactor: - *t = CommandEmulationResetPageScaleFactor - case CommandEmulationSetPageScaleFactor: - *t = CommandEmulationSetPageScaleFactor - case CommandEmulationSetScriptExecutionDisabled: - *t = CommandEmulationSetScriptExecutionDisabled - case CommandEmulationSetGeolocationOverride: - *t = CommandEmulationSetGeolocationOverride - case CommandEmulationClearGeolocationOverride: - *t = CommandEmulationClearGeolocationOverride - case CommandEmulationSetTouchEmulationEnabled: - *t = CommandEmulationSetTouchEmulationEnabled - case CommandEmulationSetEmitTouchEventsForMouse: - *t = CommandEmulationSetEmitTouchEventsForMouse - case CommandEmulationSetEmulatedMedia: - *t = CommandEmulationSetEmulatedMedia - case CommandEmulationSetCPUThrottlingRate: - *t = CommandEmulationSetCPUThrottlingRate - case CommandEmulationCanEmulate: - *t = CommandEmulationCanEmulate - case CommandEmulationSetVirtualTimePolicy: - *t = CommandEmulationSetVirtualTimePolicy - case CommandEmulationSetNavigatorOverrides: - *t = CommandEmulationSetNavigatorOverrides - case CommandEmulationSetDefaultBackgroundColorOverride: - *t = CommandEmulationSetDefaultBackgroundColorOverride - case EventSecuritySecurityStateChanged: - *t = EventSecuritySecurityStateChanged - case EventSecurityCertificateError: - *t = EventSecurityCertificateError - case CommandSecurityEnable: - *t = CommandSecurityEnable - case CommandSecurityDisable: - *t = CommandSecurityDisable - case CommandSecurityHandleCertificateError: - *t = CommandSecurityHandleCertificateError - case CommandSecuritySetOverrideCertificateErrors: - *t = CommandSecuritySetOverrideCertificateErrors - case CommandAuditsGetEncodedResponse: - *t = CommandAuditsGetEncodedResponse - case EventNetworkResourceChangedPriority: - *t = EventNetworkResourceChangedPriority - case EventNetworkRequestWillBeSent: - *t = EventNetworkRequestWillBeSent - case EventNetworkRequestServedFromCache: - *t = EventNetworkRequestServedFromCache - case EventNetworkResponseReceived: - *t = EventNetworkResponseReceived - case EventNetworkDataReceived: - *t = EventNetworkDataReceived - case EventNetworkLoadingFinished: - *t = EventNetworkLoadingFinished - case EventNetworkLoadingFailed: - *t = EventNetworkLoadingFailed - case EventNetworkWebSocketWillSendHandshakeRequest: - *t = EventNetworkWebSocketWillSendHandshakeRequest - case EventNetworkWebSocketHandshakeResponseReceived: - *t = EventNetworkWebSocketHandshakeResponseReceived - case EventNetworkWebSocketCreated: - *t = EventNetworkWebSocketCreated - case EventNetworkWebSocketClosed: - *t = EventNetworkWebSocketClosed - case EventNetworkWebSocketFrameReceived: - *t = EventNetworkWebSocketFrameReceived - case EventNetworkWebSocketFrameError: - *t = EventNetworkWebSocketFrameError - case EventNetworkWebSocketFrameSent: - *t = EventNetworkWebSocketFrameSent - case EventNetworkEventSourceMessageReceived: - *t = EventNetworkEventSourceMessageReceived - case EventNetworkRequestIntercepted: - *t = EventNetworkRequestIntercepted - case CommandNetworkEnable: - *t = CommandNetworkEnable - case CommandNetworkDisable: - *t = CommandNetworkDisable - case CommandNetworkSetUserAgentOverride: - *t = CommandNetworkSetUserAgentOverride - case CommandNetworkSearchInResponseBody: - *t = CommandNetworkSearchInResponseBody - case CommandNetworkSetExtraHTTPHeaders: - *t = CommandNetworkSetExtraHTTPHeaders - case CommandNetworkGetResponseBody: - *t = CommandNetworkGetResponseBody - case CommandNetworkSetBlockedURLS: - *t = CommandNetworkSetBlockedURLS - case CommandNetworkReplayXHR: - *t = CommandNetworkReplayXHR - case CommandNetworkClearBrowserCache: - *t = CommandNetworkClearBrowserCache - case CommandNetworkClearBrowserCookies: - *t = CommandNetworkClearBrowserCookies - case CommandNetworkGetCookies: - *t = CommandNetworkGetCookies - case CommandNetworkGetAllCookies: - *t = CommandNetworkGetAllCookies - case CommandNetworkDeleteCookies: - *t = CommandNetworkDeleteCookies - case CommandNetworkSetCookie: - *t = CommandNetworkSetCookie - case CommandNetworkSetCookies: - *t = CommandNetworkSetCookies - case CommandNetworkEmulateNetworkConditions: - *t = CommandNetworkEmulateNetworkConditions - case CommandNetworkSetCacheDisabled: - *t = CommandNetworkSetCacheDisabled - case CommandNetworkSetBypassServiceWorker: - *t = CommandNetworkSetBypassServiceWorker - case CommandNetworkSetDataSizeLimitsForTest: - *t = CommandNetworkSetDataSizeLimitsForTest - case CommandNetworkGetCertificate: - *t = CommandNetworkGetCertificate - case CommandNetworkSetRequestInterception: - *t = CommandNetworkSetRequestInterception - case CommandNetworkContinueInterceptedRequest: - *t = CommandNetworkContinueInterceptedRequest - case CommandNetworkGetResponseBodyForInterception: - *t = CommandNetworkGetResponseBodyForInterception - case EventDatabaseAddDatabase: - *t = EventDatabaseAddDatabase - case CommandDatabaseEnable: - *t = CommandDatabaseEnable - case CommandDatabaseDisable: - *t = CommandDatabaseDisable - case CommandDatabaseGetDatabaseTableNames: - *t = CommandDatabaseGetDatabaseTableNames - case CommandDatabaseExecuteSQL: - *t = CommandDatabaseExecuteSQL - case CommandIndexedDBEnable: - *t = CommandIndexedDBEnable - case CommandIndexedDBDisable: - *t = CommandIndexedDBDisable - case CommandIndexedDBRequestDatabaseNames: - *t = CommandIndexedDBRequestDatabaseNames - case CommandIndexedDBRequestDatabase: - *t = CommandIndexedDBRequestDatabase - case CommandIndexedDBRequestData: - *t = CommandIndexedDBRequestData - case CommandIndexedDBClearObjectStore: - *t = CommandIndexedDBClearObjectStore - case CommandIndexedDBDeleteDatabase: - *t = CommandIndexedDBDeleteDatabase - case CommandCacheStorageRequestCacheNames: - *t = CommandCacheStorageRequestCacheNames - case CommandCacheStorageRequestEntries: - *t = CommandCacheStorageRequestEntries - case CommandCacheStorageDeleteCache: - *t = CommandCacheStorageDeleteCache - case CommandCacheStorageDeleteEntry: - *t = CommandCacheStorageDeleteEntry - case CommandCacheStorageRequestCachedResponse: - *t = CommandCacheStorageRequestCachedResponse - case EventDOMStorageDomStorageItemsCleared: - *t = EventDOMStorageDomStorageItemsCleared - case EventDOMStorageDomStorageItemRemoved: - *t = EventDOMStorageDomStorageItemRemoved - case EventDOMStorageDomStorageItemAdded: - *t = EventDOMStorageDomStorageItemAdded - case EventDOMStorageDomStorageItemUpdated: - *t = EventDOMStorageDomStorageItemUpdated - case CommandDOMStorageEnable: - *t = CommandDOMStorageEnable - case CommandDOMStorageDisable: - *t = CommandDOMStorageDisable - case CommandDOMStorageClear: - *t = CommandDOMStorageClear - case CommandDOMStorageGetDOMStorageItems: - *t = CommandDOMStorageGetDOMStorageItems - case CommandDOMStorageSetDOMStorageItem: - *t = CommandDOMStorageSetDOMStorageItem - case CommandDOMStorageRemoveDOMStorageItem: - *t = CommandDOMStorageRemoveDOMStorageItem - case EventApplicationCacheApplicationCacheStatusUpdated: - *t = EventApplicationCacheApplicationCacheStatusUpdated - case EventApplicationCacheNetworkStateUpdated: - *t = EventApplicationCacheNetworkStateUpdated - case CommandApplicationCacheGetFramesWithManifests: - *t = CommandApplicationCacheGetFramesWithManifests - case CommandApplicationCacheEnable: - *t = CommandApplicationCacheEnable - case CommandApplicationCacheGetManifestForFrame: - *t = CommandApplicationCacheGetManifestForFrame - case CommandApplicationCacheGetApplicationCacheForFrame: - *t = CommandApplicationCacheGetApplicationCacheForFrame - case EventDOMDocumentUpdated: - *t = EventDOMDocumentUpdated - case EventDOMSetChildNodes: - *t = EventDOMSetChildNodes - case EventDOMAttributeModified: - *t = EventDOMAttributeModified - case EventDOMAttributeRemoved: - *t = EventDOMAttributeRemoved - case EventDOMInlineStyleInvalidated: - *t = EventDOMInlineStyleInvalidated - case EventDOMCharacterDataModified: - *t = EventDOMCharacterDataModified - case EventDOMChildNodeCountUpdated: - *t = EventDOMChildNodeCountUpdated - case EventDOMChildNodeInserted: - *t = EventDOMChildNodeInserted - case EventDOMChildNodeRemoved: - *t = EventDOMChildNodeRemoved - case EventDOMShadowRootPushed: - *t = EventDOMShadowRootPushed - case EventDOMShadowRootPopped: - *t = EventDOMShadowRootPopped - case EventDOMPseudoElementAdded: - *t = EventDOMPseudoElementAdded - case EventDOMPseudoElementRemoved: - *t = EventDOMPseudoElementRemoved - case EventDOMDistributedNodesUpdated: - *t = EventDOMDistributedNodesUpdated - case CommandDOMEnable: - *t = CommandDOMEnable - case CommandDOMDisable: - *t = CommandDOMDisable - case CommandDOMGetDocument: - *t = CommandDOMGetDocument - case CommandDOMGetFlattenedDocument: - *t = CommandDOMGetFlattenedDocument - case CommandDOMCollectClassNamesFromSubtree: - *t = CommandDOMCollectClassNamesFromSubtree - case CommandDOMRequestChildNodes: - *t = CommandDOMRequestChildNodes - case CommandDOMQuerySelector: - *t = CommandDOMQuerySelector - case CommandDOMQuerySelectorAll: - *t = CommandDOMQuerySelectorAll - case CommandDOMSetNodeName: - *t = CommandDOMSetNodeName - case CommandDOMSetNodeValue: - *t = CommandDOMSetNodeValue - case CommandDOMRemoveNode: - *t = CommandDOMRemoveNode - case CommandDOMSetAttributeValue: - *t = CommandDOMSetAttributeValue - case CommandDOMSetAttributesAsText: - *t = CommandDOMSetAttributesAsText - case CommandDOMRemoveAttribute: - *t = CommandDOMRemoveAttribute - case CommandDOMGetOuterHTML: - *t = CommandDOMGetOuterHTML - case CommandDOMSetOuterHTML: - *t = CommandDOMSetOuterHTML - case CommandDOMPerformSearch: - *t = CommandDOMPerformSearch - case CommandDOMGetSearchResults: - *t = CommandDOMGetSearchResults - case CommandDOMDiscardSearchResults: - *t = CommandDOMDiscardSearchResults - case CommandDOMRequestNode: - *t = CommandDOMRequestNode - case CommandDOMPushNodeByPathToFrontend: - *t = CommandDOMPushNodeByPathToFrontend - case CommandDOMPushNodesByBackendIdsToFrontend: - *t = CommandDOMPushNodesByBackendIdsToFrontend - case CommandDOMSetInspectedNode: - *t = CommandDOMSetInspectedNode - case CommandDOMResolveNode: - *t = CommandDOMResolveNode - case CommandDOMGetAttributes: - *t = CommandDOMGetAttributes - case CommandDOMCopyTo: - *t = CommandDOMCopyTo - case CommandDOMMoveTo: - *t = CommandDOMMoveTo - case CommandDOMUndo: - *t = CommandDOMUndo - case CommandDOMRedo: - *t = CommandDOMRedo - case CommandDOMMarkUndoableState: - *t = CommandDOMMarkUndoableState - case CommandDOMFocus: - *t = CommandDOMFocus - case CommandDOMSetFileInputFiles: - *t = CommandDOMSetFileInputFiles - case CommandDOMGetBoxModel: - *t = CommandDOMGetBoxModel - case CommandDOMGetNodeForLocation: - *t = CommandDOMGetNodeForLocation - case CommandDOMGetRelayoutBoundary: - *t = CommandDOMGetRelayoutBoundary - case CommandDOMDescribeNode: - *t = CommandDOMDescribeNode - case EventCSSMediaQueryResultChanged: - *t = EventCSSMediaQueryResultChanged - case EventCSSFontsUpdated: - *t = EventCSSFontsUpdated - case EventCSSStyleSheetChanged: - *t = EventCSSStyleSheetChanged - case EventCSSStyleSheetAdded: - *t = EventCSSStyleSheetAdded - case EventCSSStyleSheetRemoved: - *t = EventCSSStyleSheetRemoved - case CommandCSSEnable: - *t = CommandCSSEnable - case CommandCSSDisable: - *t = CommandCSSDisable - case CommandCSSGetMatchedStylesForNode: - *t = CommandCSSGetMatchedStylesForNode - case CommandCSSGetInlineStylesForNode: - *t = CommandCSSGetInlineStylesForNode - case CommandCSSGetComputedStyleForNode: - *t = CommandCSSGetComputedStyleForNode - case CommandCSSGetPlatformFontsForNode: - *t = CommandCSSGetPlatformFontsForNode - case CommandCSSGetStyleSheetText: - *t = CommandCSSGetStyleSheetText - case CommandCSSCollectClassNames: - *t = CommandCSSCollectClassNames - case CommandCSSSetStyleSheetText: - *t = CommandCSSSetStyleSheetText - case CommandCSSSetRuleSelector: - *t = CommandCSSSetRuleSelector - case CommandCSSSetKeyframeKey: - *t = CommandCSSSetKeyframeKey - case CommandCSSSetStyleTexts: - *t = CommandCSSSetStyleTexts - case CommandCSSSetMediaText: - *t = CommandCSSSetMediaText - case CommandCSSCreateStyleSheet: - *t = CommandCSSCreateStyleSheet - case CommandCSSAddRule: - *t = CommandCSSAddRule - case CommandCSSForcePseudoState: - *t = CommandCSSForcePseudoState - case CommandCSSGetMediaQueries: - *t = CommandCSSGetMediaQueries - case CommandCSSSetEffectivePropertyValueForNode: - *t = CommandCSSSetEffectivePropertyValueForNode - case CommandCSSGetBackgroundColors: - *t = CommandCSSGetBackgroundColors - case CommandCSSStartRuleUsageTracking: - *t = CommandCSSStartRuleUsageTracking - case CommandCSSTakeCoverageDelta: - *t = CommandCSSTakeCoverageDelta - case CommandCSSStopRuleUsageTracking: - *t = CommandCSSStopRuleUsageTracking - case CommandDOMSnapshotGetSnapshot: - *t = CommandDOMSnapshotGetSnapshot - case CommandIORead: - *t = CommandIORead - case CommandIOClose: - *t = CommandIOClose - case CommandIOResolveBlob: - *t = CommandIOResolveBlob - case CommandDOMDebuggerSetDOMBreakpoint: - *t = CommandDOMDebuggerSetDOMBreakpoint - case CommandDOMDebuggerRemoveDOMBreakpoint: - *t = CommandDOMDebuggerRemoveDOMBreakpoint - case CommandDOMDebuggerSetEventListenerBreakpoint: - *t = CommandDOMDebuggerSetEventListenerBreakpoint - case CommandDOMDebuggerRemoveEventListenerBreakpoint: - *t = CommandDOMDebuggerRemoveEventListenerBreakpoint - case CommandDOMDebuggerSetInstrumentationBreakpoint: - *t = CommandDOMDebuggerSetInstrumentationBreakpoint - case CommandDOMDebuggerRemoveInstrumentationBreakpoint: - *t = CommandDOMDebuggerRemoveInstrumentationBreakpoint - case CommandDOMDebuggerSetXHRBreakpoint: - *t = CommandDOMDebuggerSetXHRBreakpoint - case CommandDOMDebuggerRemoveXHRBreakpoint: - *t = CommandDOMDebuggerRemoveXHRBreakpoint - case CommandDOMDebuggerGetEventListeners: - *t = CommandDOMDebuggerGetEventListeners - case EventTargetTargetCreated: - *t = EventTargetTargetCreated - case EventTargetTargetInfoChanged: - *t = EventTargetTargetInfoChanged - case EventTargetTargetDestroyed: - *t = EventTargetTargetDestroyed - case EventTargetAttachedToTarget: - *t = EventTargetAttachedToTarget - case EventTargetDetachedFromTarget: - *t = EventTargetDetachedFromTarget - case EventTargetReceivedMessageFromTarget: - *t = EventTargetReceivedMessageFromTarget - case CommandTargetSetDiscoverTargets: - *t = CommandTargetSetDiscoverTargets - case CommandTargetSetAutoAttach: - *t = CommandTargetSetAutoAttach - case CommandTargetSetAttachToFrames: - *t = CommandTargetSetAttachToFrames - case CommandTargetSetRemoteLocations: - *t = CommandTargetSetRemoteLocations - case CommandTargetSendMessageToTarget: - *t = CommandTargetSendMessageToTarget - case CommandTargetGetTargetInfo: - *t = CommandTargetGetTargetInfo - case CommandTargetActivateTarget: - *t = CommandTargetActivateTarget - case CommandTargetCloseTarget: - *t = CommandTargetCloseTarget - case CommandTargetAttachToTarget: - *t = CommandTargetAttachToTarget - case CommandTargetDetachFromTarget: - *t = CommandTargetDetachFromTarget - case CommandTargetCreateBrowserContext: - *t = CommandTargetCreateBrowserContext - case CommandTargetDisposeBrowserContext: - *t = CommandTargetDisposeBrowserContext - case CommandTargetCreateTarget: - *t = CommandTargetCreateTarget - case CommandTargetGetTargets: - *t = CommandTargetGetTargets - case EventHeadlessExperimentalNeedsBeginFramesChanged: - *t = EventHeadlessExperimentalNeedsBeginFramesChanged - case EventHeadlessExperimentalMainFrameReadyForScreenshots: - *t = EventHeadlessExperimentalMainFrameReadyForScreenshots - case CommandHeadlessExperimentalEnable: - *t = CommandHeadlessExperimentalEnable - case CommandHeadlessExperimentalDisable: - *t = CommandHeadlessExperimentalDisable - case CommandHeadlessExperimentalBeginFrame: - *t = CommandHeadlessExperimentalBeginFrame - case EventServiceWorkerWorkerRegistrationUpdated: - *t = EventServiceWorkerWorkerRegistrationUpdated - case EventServiceWorkerWorkerVersionUpdated: - *t = EventServiceWorkerWorkerVersionUpdated - case EventServiceWorkerWorkerErrorReported: - *t = EventServiceWorkerWorkerErrorReported - case CommandServiceWorkerEnable: - *t = CommandServiceWorkerEnable - case CommandServiceWorkerDisable: - *t = CommandServiceWorkerDisable - case CommandServiceWorkerUnregister: - *t = CommandServiceWorkerUnregister - case CommandServiceWorkerUpdateRegistration: - *t = CommandServiceWorkerUpdateRegistration - case CommandServiceWorkerStartWorker: - *t = CommandServiceWorkerStartWorker - case CommandServiceWorkerSkipWaiting: - *t = CommandServiceWorkerSkipWaiting - case CommandServiceWorkerStopWorker: - *t = CommandServiceWorkerStopWorker - case CommandServiceWorkerStopAllWorkers: - *t = CommandServiceWorkerStopAllWorkers - case CommandServiceWorkerInspectWorker: - *t = CommandServiceWorkerInspectWorker - case CommandServiceWorkerSetForceUpdateOnPageLoad: - *t = CommandServiceWorkerSetForceUpdateOnPageLoad - case CommandServiceWorkerDeliverPushMessage: - *t = CommandServiceWorkerDeliverPushMessage - case CommandServiceWorkerDispatchSyncEvent: - *t = CommandServiceWorkerDispatchSyncEvent - case CommandInputSetIgnoreInputEvents: - *t = CommandInputSetIgnoreInputEvents - case CommandInputDispatchKeyEvent: - *t = CommandInputDispatchKeyEvent - case CommandInputDispatchMouseEvent: - *t = CommandInputDispatchMouseEvent - case CommandInputDispatchTouchEvent: - *t = CommandInputDispatchTouchEvent - case CommandInputEmulateTouchFromMouseEvent: - *t = CommandInputEmulateTouchFromMouseEvent - case CommandInputSynthesizePinchGesture: - *t = CommandInputSynthesizePinchGesture - case CommandInputSynthesizeScrollGesture: - *t = CommandInputSynthesizeScrollGesture - case CommandInputSynthesizeTapGesture: - *t = CommandInputSynthesizeTapGesture - case EventLayerTreeLayerTreeDidChange: - *t = EventLayerTreeLayerTreeDidChange - case EventLayerTreeLayerPainted: - *t = EventLayerTreeLayerPainted - case CommandLayerTreeEnable: - *t = CommandLayerTreeEnable - case CommandLayerTreeDisable: - *t = CommandLayerTreeDisable - case CommandLayerTreeCompositingReasons: - *t = CommandLayerTreeCompositingReasons - case CommandLayerTreeMakeSnapshot: - *t = CommandLayerTreeMakeSnapshot - case CommandLayerTreeLoadSnapshot: - *t = CommandLayerTreeLoadSnapshot - case CommandLayerTreeReleaseSnapshot: - *t = CommandLayerTreeReleaseSnapshot - case CommandLayerTreeProfileSnapshot: - *t = CommandLayerTreeProfileSnapshot - case CommandLayerTreeReplaySnapshot: - *t = CommandLayerTreeReplaySnapshot - case CommandLayerTreeSnapshotCommandLog: - *t = CommandLayerTreeSnapshotCommandLog - case CommandDeviceOrientationSetDeviceOrientationOverride: - *t = CommandDeviceOrientationSetDeviceOrientationOverride - case CommandDeviceOrientationClearDeviceOrientationOverride: - *t = CommandDeviceOrientationClearDeviceOrientationOverride - case EventTracingDataCollected: - *t = EventTracingDataCollected - case EventTracingTracingComplete: - *t = EventTracingTracingComplete - case EventTracingBufferUsage: - *t = EventTracingBufferUsage - case CommandTracingStart: - *t = CommandTracingStart - case CommandTracingEnd: - *t = CommandTracingEnd - case CommandTracingGetCategories: - *t = CommandTracingGetCategories - case CommandTracingRequestMemoryDump: - *t = CommandTracingRequestMemoryDump - case CommandTracingRecordClockSyncMarker: - *t = CommandTracingRecordClockSyncMarker - case EventAnimationAnimationCreated: - *t = EventAnimationAnimationCreated - case EventAnimationAnimationStarted: - *t = EventAnimationAnimationStarted - case EventAnimationAnimationCanceled: - *t = EventAnimationAnimationCanceled - case CommandAnimationEnable: - *t = CommandAnimationEnable - case CommandAnimationDisable: - *t = CommandAnimationDisable - case CommandAnimationGetPlaybackRate: - *t = CommandAnimationGetPlaybackRate - case CommandAnimationSetPlaybackRate: - *t = CommandAnimationSetPlaybackRate - case CommandAnimationGetCurrentTime: - *t = CommandAnimationGetCurrentTime - case CommandAnimationSetPaused: - *t = CommandAnimationSetPaused - case CommandAnimationSetTiming: - *t = CommandAnimationSetTiming - case CommandAnimationSeekAnimations: - *t = CommandAnimationSeekAnimations - case CommandAnimationReleaseAnimations: - *t = CommandAnimationReleaseAnimations - case CommandAnimationResolveAnimation: - *t = CommandAnimationResolveAnimation - case CommandAccessibilityGetPartialAXTree: - *t = CommandAccessibilityGetPartialAXTree - case EventStorageCacheStorageListUpdated: - *t = EventStorageCacheStorageListUpdated - case EventStorageCacheStorageContentUpdated: - *t = EventStorageCacheStorageContentUpdated - case EventStorageIndexedDBListUpdated: - *t = EventStorageIndexedDBListUpdated - case EventStorageIndexedDBContentUpdated: - *t = EventStorageIndexedDBContentUpdated - case CommandStorageClearDataForOrigin: - *t = CommandStorageClearDataForOrigin - case CommandStorageGetUsageAndQuota: - *t = CommandStorageGetUsageAndQuota - case CommandStorageTrackCacheStorageForOrigin: - *t = CommandStorageTrackCacheStorageForOrigin - case CommandStorageUntrackCacheStorageForOrigin: - *t = CommandStorageUntrackCacheStorageForOrigin - case CommandStorageTrackIndexedDBForOrigin: - *t = CommandStorageTrackIndexedDBForOrigin - case CommandStorageUntrackIndexedDBForOrigin: - *t = CommandStorageUntrackIndexedDBForOrigin - case EventLogEntryAdded: - *t = EventLogEntryAdded - case CommandLogEnable: - *t = CommandLogEnable - case CommandLogDisable: - *t = CommandLogDisable - case CommandLogClear: - *t = CommandLogClear - case CommandLogStartViolationsReport: - *t = CommandLogStartViolationsReport - case CommandLogStopViolationsReport: - *t = CommandLogStopViolationsReport - case CommandSystemInfoGetInfo: - *t = CommandSystemInfoGetInfo - case EventTetheringAccepted: - *t = EventTetheringAccepted - case CommandTetheringBind: - *t = CommandTetheringBind - case CommandTetheringUnbind: - *t = CommandTetheringUnbind - case CommandBrowserClose: - *t = CommandBrowserClose - case CommandBrowserGetWindowForTarget: - *t = CommandBrowserGetWindowForTarget - case CommandBrowserGetVersion: - *t = CommandBrowserGetVersion - case CommandBrowserSetWindowBounds: - *t = CommandBrowserSetWindowBounds - case CommandBrowserGetWindowBounds: - *t = CommandBrowserGetWindowBounds - case EventRuntimeExecutionContextCreated: - *t = EventRuntimeExecutionContextCreated - case EventRuntimeExecutionContextDestroyed: - *t = EventRuntimeExecutionContextDestroyed - case EventRuntimeExecutionContextsCleared: - *t = EventRuntimeExecutionContextsCleared - case EventRuntimeExceptionThrown: - *t = EventRuntimeExceptionThrown - case EventRuntimeExceptionRevoked: - *t = EventRuntimeExceptionRevoked - case EventRuntimeConsoleAPICalled: - *t = EventRuntimeConsoleAPICalled - case EventRuntimeInspectRequested: - *t = EventRuntimeInspectRequested - case CommandRuntimeEvaluate: - *t = CommandRuntimeEvaluate - case CommandRuntimeAwaitPromise: - *t = CommandRuntimeAwaitPromise - case CommandRuntimeCallFunctionOn: - *t = CommandRuntimeCallFunctionOn - case CommandRuntimeGetProperties: - *t = CommandRuntimeGetProperties - case CommandRuntimeReleaseObject: - *t = CommandRuntimeReleaseObject - case CommandRuntimeReleaseObjectGroup: - *t = CommandRuntimeReleaseObjectGroup - case CommandRuntimeRunIfWaitingForDebugger: - *t = CommandRuntimeRunIfWaitingForDebugger - case CommandRuntimeEnable: - *t = CommandRuntimeEnable - case CommandRuntimeDisable: - *t = CommandRuntimeDisable - case CommandRuntimeDiscardConsoleEntries: - *t = CommandRuntimeDiscardConsoleEntries - case CommandRuntimeSetCustomObjectFormatterEnabled: - *t = CommandRuntimeSetCustomObjectFormatterEnabled - case CommandRuntimeCompileScript: - *t = CommandRuntimeCompileScript - case CommandRuntimeRunScript: - *t = CommandRuntimeRunScript - case CommandRuntimeQueryObjects: - *t = CommandRuntimeQueryObjects - case CommandRuntimeGlobalLexicalScopeNames: - *t = CommandRuntimeGlobalLexicalScopeNames - case EventDebuggerScriptParsed: - *t = EventDebuggerScriptParsed - case EventDebuggerScriptFailedToParse: - *t = EventDebuggerScriptFailedToParse - case EventDebuggerBreakpointResolved: - *t = EventDebuggerBreakpointResolved - case EventDebuggerPaused: - *t = EventDebuggerPaused - case EventDebuggerResumed: - *t = EventDebuggerResumed - case CommandDebuggerEnable: - *t = CommandDebuggerEnable - case CommandDebuggerDisable: - *t = CommandDebuggerDisable - case CommandDebuggerSetBreakpointsActive: - *t = CommandDebuggerSetBreakpointsActive - case CommandDebuggerSetSkipAllPauses: - *t = CommandDebuggerSetSkipAllPauses - case CommandDebuggerSetBreakpointByURL: - *t = CommandDebuggerSetBreakpointByURL - case CommandDebuggerSetBreakpoint: - *t = CommandDebuggerSetBreakpoint - case CommandDebuggerRemoveBreakpoint: - *t = CommandDebuggerRemoveBreakpoint - case CommandDebuggerGetPossibleBreakpoints: - *t = CommandDebuggerGetPossibleBreakpoints - case CommandDebuggerContinueToLocation: - *t = CommandDebuggerContinueToLocation - case CommandDebuggerPauseOnAsyncCall: - *t = CommandDebuggerPauseOnAsyncCall - case CommandDebuggerStepOver: - *t = CommandDebuggerStepOver - case CommandDebuggerStepInto: - *t = CommandDebuggerStepInto - case CommandDebuggerStepOut: - *t = CommandDebuggerStepOut - case CommandDebuggerPause: - *t = CommandDebuggerPause - case CommandDebuggerScheduleStepIntoAsync: - *t = CommandDebuggerScheduleStepIntoAsync - case CommandDebuggerResume: - *t = CommandDebuggerResume - case CommandDebuggerGetStackTrace: - *t = CommandDebuggerGetStackTrace - case CommandDebuggerSearchInContent: - *t = CommandDebuggerSearchInContent - case CommandDebuggerSetScriptSource: - *t = CommandDebuggerSetScriptSource - case CommandDebuggerRestartFrame: - *t = CommandDebuggerRestartFrame - case CommandDebuggerGetScriptSource: - *t = CommandDebuggerGetScriptSource - case CommandDebuggerSetPauseOnExceptions: - *t = CommandDebuggerSetPauseOnExceptions - case CommandDebuggerEvaluateOnCallFrame: - *t = CommandDebuggerEvaluateOnCallFrame - case CommandDebuggerSetVariableValue: - *t = CommandDebuggerSetVariableValue - case CommandDebuggerSetReturnValue: - *t = CommandDebuggerSetReturnValue - case CommandDebuggerSetAsyncCallStackDepth: - *t = CommandDebuggerSetAsyncCallStackDepth - case CommandDebuggerSetBlackboxPatterns: - *t = CommandDebuggerSetBlackboxPatterns - case CommandDebuggerSetBlackboxedRanges: - *t = CommandDebuggerSetBlackboxedRanges - case EventProfilerConsoleProfileStarted: - *t = EventProfilerConsoleProfileStarted - case EventProfilerConsoleProfileFinished: - *t = EventProfilerConsoleProfileFinished - case CommandProfilerEnable: - *t = CommandProfilerEnable - case CommandProfilerDisable: - *t = CommandProfilerDisable - case CommandProfilerSetSamplingInterval: - *t = CommandProfilerSetSamplingInterval - case CommandProfilerStart: - *t = CommandProfilerStart - case CommandProfilerStop: - *t = CommandProfilerStop - case CommandProfilerStartPreciseCoverage: - *t = CommandProfilerStartPreciseCoverage - case CommandProfilerStopPreciseCoverage: - *t = CommandProfilerStopPreciseCoverage - case CommandProfilerTakePreciseCoverage: - *t = CommandProfilerTakePreciseCoverage - case CommandProfilerGetBestEffortCoverage: - *t = CommandProfilerGetBestEffortCoverage - case CommandProfilerStartTypeProfile: - *t = CommandProfilerStartTypeProfile - case CommandProfilerStopTypeProfile: - *t = CommandProfilerStopTypeProfile - case CommandProfilerTakeTypeProfile: - *t = CommandProfilerTakeTypeProfile - case EventHeapProfilerAddHeapSnapshotChunk: - *t = EventHeapProfilerAddHeapSnapshotChunk - case EventHeapProfilerResetProfiles: - *t = EventHeapProfilerResetProfiles - case EventHeapProfilerReportHeapSnapshotProgress: - *t = EventHeapProfilerReportHeapSnapshotProgress - case EventHeapProfilerLastSeenObjectID: - *t = EventHeapProfilerLastSeenObjectID - case EventHeapProfilerHeapStatsUpdate: - *t = EventHeapProfilerHeapStatsUpdate - case CommandHeapProfilerEnable: - *t = CommandHeapProfilerEnable - case CommandHeapProfilerDisable: - *t = CommandHeapProfilerDisable - case CommandHeapProfilerStartTrackingHeapObjects: - *t = CommandHeapProfilerStartTrackingHeapObjects - case CommandHeapProfilerStopTrackingHeapObjects: - *t = CommandHeapProfilerStopTrackingHeapObjects - case CommandHeapProfilerTakeHeapSnapshot: - *t = CommandHeapProfilerTakeHeapSnapshot - case CommandHeapProfilerCollectGarbage: - *t = CommandHeapProfilerCollectGarbage - case CommandHeapProfilerGetObjectByHeapObjectID: - *t = CommandHeapProfilerGetObjectByHeapObjectID - case CommandHeapProfilerAddInspectedHeapObject: - *t = CommandHeapProfilerAddInspectedHeapObject - case CommandHeapProfilerGetHeapObjectID: - *t = CommandHeapProfilerGetHeapObjectID - case CommandHeapProfilerStartSampling: - *t = CommandHeapProfilerStartSampling - case CommandHeapProfilerStopSampling: - *t = CommandHeapProfilerStopSampling - case CommandHeapProfilerGetSamplingProfile: - *t = CommandHeapProfilerGetSamplingProfile - - default: - in.AddError(errors.New("unknown MethodType value")) - } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *MethodType) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} - -// Domain returns the Chrome Debugging Protocol domain of the event or command. -func (t MethodType) Domain() string { - return string(t[:strings.IndexByte(string(t), '.')]) -} - -// ErrorType error type. -type ErrorType string - -// String returns the ErrorType as string value. -func (t ErrorType) String() string { - return string(t) -} - -// ErrorType values. -const ( - ErrChannelClosed ErrorType = "channel closed" - ErrInvalidResult ErrorType = "invalid result" - ErrUnknownResult ErrorType = "unknown result" -) - -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t ErrorType) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t ErrorType) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *ErrorType) UnmarshalEasyJSON(in *jlexer.Lexer) { - switch ErrorType(in.String()) { - case ErrChannelClosed: - *t = ErrChannelClosed - case ErrInvalidResult: - *t = ErrInvalidResult - case ErrUnknownResult: - *t = ErrUnknownResult - - default: - in.AddError(errors.New("unknown ErrorType value")) - } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *ErrorType) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} - -// Error satisfies the error interface. -func (t ErrorType) Error() string { - return string(t) -} - -// Handler is the common interface for a Chrome Debugging Protocol target. -type Handler interface { - // SetActive changes the top level frame id. - SetActive(context.Context, FrameID) error - - // GetRoot returns the root document node for the top level frame. - GetRoot(context.Context) (*Node, error) - - // WaitFrame waits for a frame to be available. - WaitFrame(context.Context, FrameID) (*Frame, error) - - // WaitNode waits for a node to be available. - WaitNode(context.Context, *Frame, NodeID) (*Node, error) - - // Execute executes the specified command using the supplied context and - // parameters. - Execute(context.Context, MethodType, easyjson.Marshaler, easyjson.Unmarshaler) error - - // Listen creates a channel that will receive an event for the types - // specified. - Listen(...MethodType) <-chan interface{} - - // Release releases a channel returned from Listen. - Release(<-chan interface{}) -} - -// FrameID unique frame identifier. -type FrameID string - -// String returns the FrameID as string value. -func (t FrameID) String() string { - return string(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *FrameID) UnmarshalEasyJSON(in *jlexer.Lexer) { - buf := in.Raw() - if l := len(buf); l > 2 && buf[0] == '"' && buf[l-1] == '"' { - buf = buf[1 : l-1] - } - - *t = FrameID(buf) -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *FrameID) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} - -// Frame information about the Frame on the page. -type Frame struct { - ID FrameID `json:"id"` // Frame unique identifier. - ParentID FrameID `json:"parentId,omitempty"` // Parent frame identifier. - LoaderID LoaderID `json:"loaderId"` // Identifier of the loader associated with this frame. - Name string `json:"name,omitempty"` // Frame's name as specified in the tag. - URL string `json:"url"` // Frame document's URL. - SecurityOrigin string `json:"securityOrigin"` // Frame document's security origin. - MimeType string `json:"mimeType"` // Frame document's mimeType as determined by the browser. - UnreachableURL string `json:"unreachableUrl,omitempty"` // If the frame failed to load, this contains the URL that could not be loaded. - State FrameState `json:"-"` // Frame state. - Root *Node `json:"-"` // Frame document root. - Nodes map[NodeID]*Node `json:"-"` // Frame nodes. - sync.RWMutex `json:"-"` // Read write mutex. -} - -// FrameState is the state of a Frame. -type FrameState uint16 - -// FrameState enum values. -const ( - FrameDOMContentEventFired FrameState = 1 << (15 - iota) - FrameLoadEventFired - FrameAttached - FrameNavigated - FrameLoading - FrameScheduledNavigation -) - -// frameStateNames are the names of the frame states. -var frameStateNames = map[FrameState]string{ - FrameDOMContentEventFired: "DOMContentEventFired", - FrameLoadEventFired: "LoadEventFired", - FrameAttached: "Attached", - FrameNavigated: "Navigated", - FrameLoading: "Loading", - FrameScheduledNavigation: "ScheduledNavigation", -} - -// String satisfies stringer interface. -func (fs FrameState) String() string { - var s []string - for k, v := range frameStateNames { - if fs&k != 0 { - s = append(s, v) - } - } - return "[" + strings.Join(s, " ") + "]" -} - -// EmptyFrameID is the "non-existent" frame id. -const EmptyFrameID = FrameID("") - -// LoaderID unique loader identifier. -type LoaderID string - -// String returns the LoaderID as string value. -func (t LoaderID) String() string { - return string(t) -} - -// TimeSinceEpoch uTC time in seconds, counted from January 1, 1970. -type TimeSinceEpoch time.Time - -// Time returns the TimeSinceEpoch as time.Time value. -func (t TimeSinceEpoch) Time() time.Time { - return time.Time(t) -} - -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t TimeSinceEpoch) MarshalEasyJSON(out *jwriter.Writer) { - v := float64(time.Time(t).UnixNano() / int64(time.Second)) - - out.Buffer.EnsureSpace(20) - out.Buffer.Buf = strconv.AppendFloat(out.Buffer.Buf, v, 'f', -1, 64) -} - -// MarshalJSON satisfies json.Marshaler. -func (t TimeSinceEpoch) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *TimeSinceEpoch) UnmarshalEasyJSON(in *jlexer.Lexer) { - *t = TimeSinceEpoch(time.Unix(0, int64(in.Float64()*float64(time.Second)))) -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *TimeSinceEpoch) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} - -// MonotonicTime monotonically increasing time in seconds since an arbitrary -// point in the past. -type MonotonicTime time.Time - -// Time returns the MonotonicTime as time.Time value. -func (t MonotonicTime) Time() time.Time { - return time.Time(t) -} - -// MonotonicTimeEpoch is the MonotonicTime time epoch. -var MonotonicTimeEpoch *time.Time - -func init() { - // initialize epoch - bt := sysutil.BootTime() - MonotonicTimeEpoch = &bt -} - -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t MonotonicTime) MarshalEasyJSON(out *jwriter.Writer) { - v := float64(time.Time(t).Sub(*MonotonicTimeEpoch)) / float64(time.Second) - - out.Buffer.EnsureSpace(20) - out.Buffer.Buf = strconv.AppendFloat(out.Buffer.Buf, v, 'f', -1, 64) -} - -// MarshalJSON satisfies json.Marshaler. -func (t MonotonicTime) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *MonotonicTime) UnmarshalEasyJSON(in *jlexer.Lexer) { - *t = MonotonicTime(MonotonicTimeEpoch.Add(time.Duration(in.Float64() * float64(time.Second)))) -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *MonotonicTime) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} - // NodeID unique DOM node identifier. type NodeID int64 @@ -2141,3 +469,1678 @@ func (t *NodeType) UnmarshalEasyJSON(in *jlexer.Lexer) { func (t *NodeType) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } + +// MessageError message error type. +type MessageError struct { + Code int64 `json:"code"` // Error code. + Message string `json:"message"` // Error message. +} + +// Error satisfies error interface. +func (e *MessageError) Error() string { + return fmt.Sprintf("%s (%d)", e.Message, e.Code) +} + +// Message chrome Debugging Protocol message sent to/read over websocket +// connection. +type Message struct { + ID int64 `json:"id,omitempty"` // Unique message identifier. + Method MethodType `json:"method,omitempty"` // Event or command type. + Params easyjson.RawMessage `json:"params,omitempty"` // Event or command parameters. + Result easyjson.RawMessage `json:"result,omitempty"` // Command return values. + Error *MessageError `json:"error,omitempty"` // Error message. +} + +// MethodType chrome Debugging Protocol method type (ie, event and command +// names). +type MethodType string + +// String returns the MethodType as string value. +func (t MethodType) String() string { + return string(t) +} + +// MethodType values. +const ( + CommandAccessibilityGetPartialAXTree MethodType = "Accessibility.getPartialAXTree" + EventAnimationAnimationCanceled MethodType = "Animation.animationCanceled" + EventAnimationAnimationCreated MethodType = "Animation.animationCreated" + EventAnimationAnimationStarted MethodType = "Animation.animationStarted" + CommandAnimationDisable MethodType = "Animation.disable" + CommandAnimationEnable MethodType = "Animation.enable" + CommandAnimationGetCurrentTime MethodType = "Animation.getCurrentTime" + CommandAnimationGetPlaybackRate MethodType = "Animation.getPlaybackRate" + CommandAnimationReleaseAnimations MethodType = "Animation.releaseAnimations" + CommandAnimationResolveAnimation MethodType = "Animation.resolveAnimation" + CommandAnimationSeekAnimations MethodType = "Animation.seekAnimations" + CommandAnimationSetPaused MethodType = "Animation.setPaused" + CommandAnimationSetPlaybackRate MethodType = "Animation.setPlaybackRate" + CommandAnimationSetTiming MethodType = "Animation.setTiming" + EventApplicationCacheApplicationCacheStatusUpdated MethodType = "ApplicationCache.applicationCacheStatusUpdated" + EventApplicationCacheNetworkStateUpdated MethodType = "ApplicationCache.networkStateUpdated" + CommandApplicationCacheEnable MethodType = "ApplicationCache.enable" + CommandApplicationCacheGetApplicationCacheForFrame MethodType = "ApplicationCache.getApplicationCacheForFrame" + CommandApplicationCacheGetFramesWithManifests MethodType = "ApplicationCache.getFramesWithManifests" + CommandApplicationCacheGetManifestForFrame MethodType = "ApplicationCache.getManifestForFrame" + CommandAuditsGetEncodedResponse MethodType = "Audits.getEncodedResponse" + CommandBrowserClose MethodType = "Browser.close" + CommandBrowserGetVersion MethodType = "Browser.getVersion" + CommandBrowserGetWindowBounds MethodType = "Browser.getWindowBounds" + CommandBrowserGetWindowForTarget MethodType = "Browser.getWindowForTarget" + CommandBrowserSetWindowBounds MethodType = "Browser.setWindowBounds" + EventCSSFontsUpdated MethodType = "CSS.fontsUpdated" + EventCSSMediaQueryResultChanged MethodType = "CSS.mediaQueryResultChanged" + EventCSSStyleSheetAdded MethodType = "CSS.styleSheetAdded" + EventCSSStyleSheetChanged MethodType = "CSS.styleSheetChanged" + EventCSSStyleSheetRemoved MethodType = "CSS.styleSheetRemoved" + CommandCSSAddRule MethodType = "CSS.addRule" + CommandCSSCollectClassNames MethodType = "CSS.collectClassNames" + CommandCSSCreateStyleSheet MethodType = "CSS.createStyleSheet" + CommandCSSDisable MethodType = "CSS.disable" + CommandCSSEnable MethodType = "CSS.enable" + CommandCSSForcePseudoState MethodType = "CSS.forcePseudoState" + CommandCSSGetBackgroundColors MethodType = "CSS.getBackgroundColors" + CommandCSSGetComputedStyleForNode MethodType = "CSS.getComputedStyleForNode" + CommandCSSGetInlineStylesForNode MethodType = "CSS.getInlineStylesForNode" + CommandCSSGetMatchedStylesForNode MethodType = "CSS.getMatchedStylesForNode" + CommandCSSGetMediaQueries MethodType = "CSS.getMediaQueries" + CommandCSSGetPlatformFontsForNode MethodType = "CSS.getPlatformFontsForNode" + CommandCSSGetStyleSheetText MethodType = "CSS.getStyleSheetText" + CommandCSSSetEffectivePropertyValueForNode MethodType = "CSS.setEffectivePropertyValueForNode" + CommandCSSSetKeyframeKey MethodType = "CSS.setKeyframeKey" + CommandCSSSetMediaText MethodType = "CSS.setMediaText" + CommandCSSSetRuleSelector MethodType = "CSS.setRuleSelector" + CommandCSSSetStyleSheetText MethodType = "CSS.setStyleSheetText" + CommandCSSSetStyleTexts MethodType = "CSS.setStyleTexts" + CommandCSSStartRuleUsageTracking MethodType = "CSS.startRuleUsageTracking" + CommandCSSStopRuleUsageTracking MethodType = "CSS.stopRuleUsageTracking" + CommandCSSTakeCoverageDelta MethodType = "CSS.takeCoverageDelta" + CommandCacheStorageDeleteCache MethodType = "CacheStorage.deleteCache" + CommandCacheStorageDeleteEntry MethodType = "CacheStorage.deleteEntry" + CommandCacheStorageRequestCacheNames MethodType = "CacheStorage.requestCacheNames" + CommandCacheStorageRequestCachedResponse MethodType = "CacheStorage.requestCachedResponse" + CommandCacheStorageRequestEntries MethodType = "CacheStorage.requestEntries" + EventDOMAttributeModified MethodType = "DOM.attributeModified" + EventDOMAttributeRemoved MethodType = "DOM.attributeRemoved" + EventDOMCharacterDataModified MethodType = "DOM.characterDataModified" + EventDOMChildNodeCountUpdated MethodType = "DOM.childNodeCountUpdated" + EventDOMChildNodeInserted MethodType = "DOM.childNodeInserted" + EventDOMChildNodeRemoved MethodType = "DOM.childNodeRemoved" + EventDOMDistributedNodesUpdated MethodType = "DOM.distributedNodesUpdated" + EventDOMDocumentUpdated MethodType = "DOM.documentUpdated" + EventDOMInlineStyleInvalidated MethodType = "DOM.inlineStyleInvalidated" + EventDOMPseudoElementAdded MethodType = "DOM.pseudoElementAdded" + EventDOMPseudoElementRemoved MethodType = "DOM.pseudoElementRemoved" + EventDOMSetChildNodes MethodType = "DOM.setChildNodes" + EventDOMShadowRootPopped MethodType = "DOM.shadowRootPopped" + EventDOMShadowRootPushed MethodType = "DOM.shadowRootPushed" + CommandDOMCollectClassNamesFromSubtree MethodType = "DOM.collectClassNamesFromSubtree" + CommandDOMCopyTo MethodType = "DOM.copyTo" + CommandDOMDescribeNode MethodType = "DOM.describeNode" + CommandDOMDisable MethodType = "DOM.disable" + CommandDOMDiscardSearchResults MethodType = "DOM.discardSearchResults" + CommandDOMEnable MethodType = "DOM.enable" + CommandDOMFocus MethodType = "DOM.focus" + CommandDOMGetAttributes MethodType = "DOM.getAttributes" + CommandDOMGetBoxModel MethodType = "DOM.getBoxModel" + CommandDOMGetDocument MethodType = "DOM.getDocument" + CommandDOMGetFlattenedDocument MethodType = "DOM.getFlattenedDocument" + CommandDOMGetNodeForLocation MethodType = "DOM.getNodeForLocation" + CommandDOMGetOuterHTML MethodType = "DOM.getOuterHTML" + CommandDOMGetRelayoutBoundary MethodType = "DOM.getRelayoutBoundary" + CommandDOMGetSearchResults MethodType = "DOM.getSearchResults" + CommandDOMMarkUndoableState MethodType = "DOM.markUndoableState" + CommandDOMMoveTo MethodType = "DOM.moveTo" + CommandDOMPerformSearch MethodType = "DOM.performSearch" + CommandDOMPushNodeByPathToFrontend MethodType = "DOM.pushNodeByPathToFrontend" + CommandDOMPushNodesByBackendIdsToFrontend MethodType = "DOM.pushNodesByBackendIdsToFrontend" + CommandDOMQuerySelector MethodType = "DOM.querySelector" + CommandDOMQuerySelectorAll MethodType = "DOM.querySelectorAll" + CommandDOMRedo MethodType = "DOM.redo" + CommandDOMRemoveAttribute MethodType = "DOM.removeAttribute" + CommandDOMRemoveNode MethodType = "DOM.removeNode" + CommandDOMRequestChildNodes MethodType = "DOM.requestChildNodes" + CommandDOMRequestNode MethodType = "DOM.requestNode" + CommandDOMResolveNode MethodType = "DOM.resolveNode" + CommandDOMSetAttributeValue MethodType = "DOM.setAttributeValue" + CommandDOMSetAttributesAsText MethodType = "DOM.setAttributesAsText" + CommandDOMSetFileInputFiles MethodType = "DOM.setFileInputFiles" + CommandDOMSetInspectedNode MethodType = "DOM.setInspectedNode" + CommandDOMSetNodeName MethodType = "DOM.setNodeName" + CommandDOMSetNodeValue MethodType = "DOM.setNodeValue" + CommandDOMSetOuterHTML MethodType = "DOM.setOuterHTML" + CommandDOMUndo MethodType = "DOM.undo" + CommandDOMDebuggerGetEventListeners MethodType = "DOMDebugger.getEventListeners" + CommandDOMDebuggerRemoveDOMBreakpoint MethodType = "DOMDebugger.removeDOMBreakpoint" + CommandDOMDebuggerRemoveEventListenerBreakpoint MethodType = "DOMDebugger.removeEventListenerBreakpoint" + CommandDOMDebuggerRemoveInstrumentationBreakpoint MethodType = "DOMDebugger.removeInstrumentationBreakpoint" + CommandDOMDebuggerRemoveXHRBreakpoint MethodType = "DOMDebugger.removeXHRBreakpoint" + CommandDOMDebuggerSetDOMBreakpoint MethodType = "DOMDebugger.setDOMBreakpoint" + CommandDOMDebuggerSetEventListenerBreakpoint MethodType = "DOMDebugger.setEventListenerBreakpoint" + CommandDOMDebuggerSetInstrumentationBreakpoint MethodType = "DOMDebugger.setInstrumentationBreakpoint" + CommandDOMDebuggerSetXHRBreakpoint MethodType = "DOMDebugger.setXHRBreakpoint" + CommandDOMSnapshotGetSnapshot MethodType = "DOMSnapshot.getSnapshot" + EventDOMStorageDomStorageItemAdded MethodType = "DOMStorage.domStorageItemAdded" + EventDOMStorageDomStorageItemRemoved MethodType = "DOMStorage.domStorageItemRemoved" + EventDOMStorageDomStorageItemUpdated MethodType = "DOMStorage.domStorageItemUpdated" + EventDOMStorageDomStorageItemsCleared MethodType = "DOMStorage.domStorageItemsCleared" + CommandDOMStorageClear MethodType = "DOMStorage.clear" + CommandDOMStorageDisable MethodType = "DOMStorage.disable" + CommandDOMStorageEnable MethodType = "DOMStorage.enable" + CommandDOMStorageGetDOMStorageItems MethodType = "DOMStorage.getDOMStorageItems" + CommandDOMStorageRemoveDOMStorageItem MethodType = "DOMStorage.removeDOMStorageItem" + CommandDOMStorageSetDOMStorageItem MethodType = "DOMStorage.setDOMStorageItem" + EventDatabaseAddDatabase MethodType = "Database.addDatabase" + CommandDatabaseDisable MethodType = "Database.disable" + CommandDatabaseEnable MethodType = "Database.enable" + CommandDatabaseExecuteSQL MethodType = "Database.executeSQL" + CommandDatabaseGetDatabaseTableNames MethodType = "Database.getDatabaseTableNames" + CommandDeviceOrientationClearDeviceOrientationOverride MethodType = "DeviceOrientation.clearDeviceOrientationOverride" + CommandDeviceOrientationSetDeviceOrientationOverride MethodType = "DeviceOrientation.setDeviceOrientationOverride" + EventEmulationVirtualTimeAdvanced MethodType = "Emulation.virtualTimeAdvanced" + EventEmulationVirtualTimeBudgetExpired MethodType = "Emulation.virtualTimeBudgetExpired" + EventEmulationVirtualTimePaused MethodType = "Emulation.virtualTimePaused" + CommandEmulationCanEmulate MethodType = "Emulation.canEmulate" + CommandEmulationClearDeviceMetricsOverride MethodType = "Emulation.clearDeviceMetricsOverride" + CommandEmulationClearGeolocationOverride MethodType = "Emulation.clearGeolocationOverride" + CommandEmulationResetPageScaleFactor MethodType = "Emulation.resetPageScaleFactor" + CommandEmulationSetCPUThrottlingRate MethodType = "Emulation.setCPUThrottlingRate" + CommandEmulationSetDefaultBackgroundColorOverride MethodType = "Emulation.setDefaultBackgroundColorOverride" + CommandEmulationSetDeviceMetricsOverride MethodType = "Emulation.setDeviceMetricsOverride" + CommandEmulationSetEmitTouchEventsForMouse MethodType = "Emulation.setEmitTouchEventsForMouse" + CommandEmulationSetEmulatedMedia MethodType = "Emulation.setEmulatedMedia" + CommandEmulationSetGeolocationOverride MethodType = "Emulation.setGeolocationOverride" + CommandEmulationSetNavigatorOverrides MethodType = "Emulation.setNavigatorOverrides" + CommandEmulationSetPageScaleFactor MethodType = "Emulation.setPageScaleFactor" + CommandEmulationSetScriptExecutionDisabled MethodType = "Emulation.setScriptExecutionDisabled" + CommandEmulationSetTouchEmulationEnabled MethodType = "Emulation.setTouchEmulationEnabled" + CommandEmulationSetVirtualTimePolicy MethodType = "Emulation.setVirtualTimePolicy" + EventHeadlessExperimentalMainFrameReadyForScreenshots MethodType = "HeadlessExperimental.mainFrameReadyForScreenshots" + EventHeadlessExperimentalNeedsBeginFramesChanged MethodType = "HeadlessExperimental.needsBeginFramesChanged" + CommandHeadlessExperimentalBeginFrame MethodType = "HeadlessExperimental.beginFrame" + CommandHeadlessExperimentalDisable MethodType = "HeadlessExperimental.disable" + CommandHeadlessExperimentalEnable MethodType = "HeadlessExperimental.enable" + CommandIOClose MethodType = "IO.close" + CommandIORead MethodType = "IO.read" + CommandIOResolveBlob MethodType = "IO.resolveBlob" + CommandIndexedDBClearObjectStore MethodType = "IndexedDB.clearObjectStore" + CommandIndexedDBDeleteDatabase MethodType = "IndexedDB.deleteDatabase" + CommandIndexedDBDeleteObjectStoreEntries MethodType = "IndexedDB.deleteObjectStoreEntries" + CommandIndexedDBDisable MethodType = "IndexedDB.disable" + CommandIndexedDBEnable MethodType = "IndexedDB.enable" + CommandIndexedDBRequestData MethodType = "IndexedDB.requestData" + CommandIndexedDBRequestDatabase MethodType = "IndexedDB.requestDatabase" + CommandIndexedDBRequestDatabaseNames MethodType = "IndexedDB.requestDatabaseNames" + CommandInputDispatchKeyEvent MethodType = "Input.dispatchKeyEvent" + CommandInputDispatchMouseEvent MethodType = "Input.dispatchMouseEvent" + CommandInputDispatchTouchEvent MethodType = "Input.dispatchTouchEvent" + CommandInputEmulateTouchFromMouseEvent MethodType = "Input.emulateTouchFromMouseEvent" + CommandInputSetIgnoreInputEvents MethodType = "Input.setIgnoreInputEvents" + CommandInputSynthesizePinchGesture MethodType = "Input.synthesizePinchGesture" + CommandInputSynthesizeScrollGesture MethodType = "Input.synthesizeScrollGesture" + CommandInputSynthesizeTapGesture MethodType = "Input.synthesizeTapGesture" + EventInspectorDetached MethodType = "Inspector.detached" + EventInspectorTargetCrashed MethodType = "Inspector.targetCrashed" + CommandInspectorDisable MethodType = "Inspector.disable" + CommandInspectorEnable MethodType = "Inspector.enable" + EventLayerTreeLayerPainted MethodType = "LayerTree.layerPainted" + EventLayerTreeLayerTreeDidChange MethodType = "LayerTree.layerTreeDidChange" + CommandLayerTreeCompositingReasons MethodType = "LayerTree.compositingReasons" + CommandLayerTreeDisable MethodType = "LayerTree.disable" + CommandLayerTreeEnable MethodType = "LayerTree.enable" + CommandLayerTreeLoadSnapshot MethodType = "LayerTree.loadSnapshot" + CommandLayerTreeMakeSnapshot MethodType = "LayerTree.makeSnapshot" + CommandLayerTreeProfileSnapshot MethodType = "LayerTree.profileSnapshot" + CommandLayerTreeReleaseSnapshot MethodType = "LayerTree.releaseSnapshot" + CommandLayerTreeReplaySnapshot MethodType = "LayerTree.replaySnapshot" + CommandLayerTreeSnapshotCommandLog MethodType = "LayerTree.snapshotCommandLog" + EventLogEntryAdded MethodType = "Log.entryAdded" + CommandLogClear MethodType = "Log.clear" + CommandLogDisable MethodType = "Log.disable" + CommandLogEnable MethodType = "Log.enable" + CommandLogStartViolationsReport MethodType = "Log.startViolationsReport" + CommandLogStopViolationsReport MethodType = "Log.stopViolationsReport" + CommandMemoryGetDOMCounters MethodType = "Memory.getDOMCounters" + CommandMemoryPrepareForLeakDetection MethodType = "Memory.prepareForLeakDetection" + CommandMemorySetPressureNotificationsSuppressed MethodType = "Memory.setPressureNotificationsSuppressed" + CommandMemorySimulatePressureNotification MethodType = "Memory.simulatePressureNotification" + EventNetworkDataReceived MethodType = "Network.dataReceived" + EventNetworkEventSourceMessageReceived MethodType = "Network.eventSourceMessageReceived" + EventNetworkLoadingFailed MethodType = "Network.loadingFailed" + EventNetworkLoadingFinished MethodType = "Network.loadingFinished" + EventNetworkRequestIntercepted MethodType = "Network.requestIntercepted" + EventNetworkRequestServedFromCache MethodType = "Network.requestServedFromCache" + EventNetworkRequestWillBeSent MethodType = "Network.requestWillBeSent" + EventNetworkResourceChangedPriority MethodType = "Network.resourceChangedPriority" + EventNetworkResponseReceived MethodType = "Network.responseReceived" + EventNetworkWebSocketClosed MethodType = "Network.webSocketClosed" + EventNetworkWebSocketCreated MethodType = "Network.webSocketCreated" + EventNetworkWebSocketFrameError MethodType = "Network.webSocketFrameError" + EventNetworkWebSocketFrameReceived MethodType = "Network.webSocketFrameReceived" + EventNetworkWebSocketFrameSent MethodType = "Network.webSocketFrameSent" + EventNetworkWebSocketHandshakeResponseReceived MethodType = "Network.webSocketHandshakeResponseReceived" + EventNetworkWebSocketWillSendHandshakeRequest MethodType = "Network.webSocketWillSendHandshakeRequest" + CommandNetworkClearBrowserCache MethodType = "Network.clearBrowserCache" + CommandNetworkClearBrowserCookies MethodType = "Network.clearBrowserCookies" + CommandNetworkContinueInterceptedRequest MethodType = "Network.continueInterceptedRequest" + CommandNetworkDeleteCookies MethodType = "Network.deleteCookies" + CommandNetworkDisable MethodType = "Network.disable" + CommandNetworkEmulateNetworkConditions MethodType = "Network.emulateNetworkConditions" + CommandNetworkEnable MethodType = "Network.enable" + CommandNetworkGetAllCookies MethodType = "Network.getAllCookies" + CommandNetworkGetCertificate MethodType = "Network.getCertificate" + CommandNetworkGetCookies MethodType = "Network.getCookies" + CommandNetworkGetResponseBody MethodType = "Network.getResponseBody" + CommandNetworkGetResponseBodyForInterception MethodType = "Network.getResponseBodyForInterception" + CommandNetworkReplayXHR MethodType = "Network.replayXHR" + CommandNetworkSearchInResponseBody MethodType = "Network.searchInResponseBody" + CommandNetworkSetBlockedURLS MethodType = "Network.setBlockedURLs" + CommandNetworkSetBypassServiceWorker MethodType = "Network.setBypassServiceWorker" + CommandNetworkSetCacheDisabled MethodType = "Network.setCacheDisabled" + CommandNetworkSetCookie MethodType = "Network.setCookie" + CommandNetworkSetCookies MethodType = "Network.setCookies" + CommandNetworkSetDataSizeLimitsForTest MethodType = "Network.setDataSizeLimitsForTest" + CommandNetworkSetExtraHTTPHeaders MethodType = "Network.setExtraHTTPHeaders" + CommandNetworkSetRequestInterception MethodType = "Network.setRequestInterception" + CommandNetworkSetUserAgentOverride MethodType = "Network.setUserAgentOverride" + EventOverlayInspectNodeRequested MethodType = "Overlay.inspectNodeRequested" + EventOverlayNodeHighlightRequested MethodType = "Overlay.nodeHighlightRequested" + EventOverlayScreenshotRequested MethodType = "Overlay.screenshotRequested" + CommandOverlayDisable MethodType = "Overlay.disable" + CommandOverlayEnable MethodType = "Overlay.enable" + CommandOverlayGetHighlightObjectForTest MethodType = "Overlay.getHighlightObjectForTest" + CommandOverlayHideHighlight MethodType = "Overlay.hideHighlight" + CommandOverlayHighlightFrame MethodType = "Overlay.highlightFrame" + CommandOverlayHighlightNode MethodType = "Overlay.highlightNode" + CommandOverlayHighlightQuad MethodType = "Overlay.highlightQuad" + CommandOverlayHighlightRect MethodType = "Overlay.highlightRect" + CommandOverlaySetInspectMode MethodType = "Overlay.setInspectMode" + CommandOverlaySetPausedInDebuggerMessage MethodType = "Overlay.setPausedInDebuggerMessage" + CommandOverlaySetShowDebugBorders MethodType = "Overlay.setShowDebugBorders" + CommandOverlaySetShowFPSCounter MethodType = "Overlay.setShowFPSCounter" + CommandOverlaySetShowPaintRects MethodType = "Overlay.setShowPaintRects" + CommandOverlaySetShowScrollBottleneckRects MethodType = "Overlay.setShowScrollBottleneckRects" + CommandOverlaySetShowViewportSizeOnResize MethodType = "Overlay.setShowViewportSizeOnResize" + CommandOverlaySetSuspended MethodType = "Overlay.setSuspended" + EventPageDomContentEventFired MethodType = "Page.domContentEventFired" + EventPageFrameAttached MethodType = "Page.frameAttached" + EventPageFrameClearedScheduledNavigation MethodType = "Page.frameClearedScheduledNavigation" + EventPageFrameDetached MethodType = "Page.frameDetached" + EventPageFrameNavigated MethodType = "Page.frameNavigated" + EventPageFrameResized MethodType = "Page.frameResized" + EventPageFrameScheduledNavigation MethodType = "Page.frameScheduledNavigation" + EventPageFrameStartedLoading MethodType = "Page.frameStartedLoading" + EventPageFrameStoppedLoading MethodType = "Page.frameStoppedLoading" + EventPageInterstitialHidden MethodType = "Page.interstitialHidden" + EventPageInterstitialShown MethodType = "Page.interstitialShown" + EventPageJavascriptDialogClosed MethodType = "Page.javascriptDialogClosed" + EventPageJavascriptDialogOpening MethodType = "Page.javascriptDialogOpening" + EventPageLifecycleEvent MethodType = "Page.lifecycleEvent" + EventPageLoadEventFired MethodType = "Page.loadEventFired" + EventPageScreencastFrame MethodType = "Page.screencastFrame" + EventPageScreencastVisibilityChanged MethodType = "Page.screencastVisibilityChanged" + EventPageWindowOpen MethodType = "Page.windowOpen" + CommandPageAddScriptToEvaluateOnNewDocument MethodType = "Page.addScriptToEvaluateOnNewDocument" + CommandPageBringToFront MethodType = "Page.bringToFront" + CommandPageCaptureScreenshot MethodType = "Page.captureScreenshot" + CommandPageCreateIsolatedWorld MethodType = "Page.createIsolatedWorld" + CommandPageDisable MethodType = "Page.disable" + CommandPageEnable MethodType = "Page.enable" + CommandPageGetAppManifest MethodType = "Page.getAppManifest" + CommandPageGetFrameTree MethodType = "Page.getFrameTree" + CommandPageGetLayoutMetrics MethodType = "Page.getLayoutMetrics" + CommandPageGetNavigationHistory MethodType = "Page.getNavigationHistory" + CommandPageGetResourceContent MethodType = "Page.getResourceContent" + CommandPageGetResourceTree MethodType = "Page.getResourceTree" + CommandPageHandleJavaScriptDialog MethodType = "Page.handleJavaScriptDialog" + CommandPageNavigate MethodType = "Page.navigate" + CommandPageNavigateToHistoryEntry MethodType = "Page.navigateToHistoryEntry" + CommandPagePrintToPDF MethodType = "Page.printToPDF" + CommandPageReload MethodType = "Page.reload" + CommandPageRemoveScriptToEvaluateOnNewDocument MethodType = "Page.removeScriptToEvaluateOnNewDocument" + CommandPageRequestAppBanner MethodType = "Page.requestAppBanner" + CommandPageScreencastFrameAck MethodType = "Page.screencastFrameAck" + CommandPageSearchInResource MethodType = "Page.searchInResource" + CommandPageSetAdBlockingEnabled MethodType = "Page.setAdBlockingEnabled" + CommandPageSetAutoAttachToCreatedPages MethodType = "Page.setAutoAttachToCreatedPages" + CommandPageSetDocumentContent MethodType = "Page.setDocumentContent" + CommandPageSetDownloadBehavior MethodType = "Page.setDownloadBehavior" + CommandPageSetLifecycleEventsEnabled MethodType = "Page.setLifecycleEventsEnabled" + CommandPageStartScreencast MethodType = "Page.startScreencast" + CommandPageStopLoading MethodType = "Page.stopLoading" + CommandPageStopScreencast MethodType = "Page.stopScreencast" + EventPerformanceMetrics MethodType = "Performance.metrics" + CommandPerformanceDisable MethodType = "Performance.disable" + CommandPerformanceEnable MethodType = "Performance.enable" + CommandPerformanceGetMetrics MethodType = "Performance.getMetrics" + EventSecurityCertificateError MethodType = "Security.certificateError" + EventSecuritySecurityStateChanged MethodType = "Security.securityStateChanged" + CommandSecurityDisable MethodType = "Security.disable" + CommandSecurityEnable MethodType = "Security.enable" + CommandSecurityHandleCertificateError MethodType = "Security.handleCertificateError" + CommandSecuritySetOverrideCertificateErrors MethodType = "Security.setOverrideCertificateErrors" + EventServiceWorkerWorkerErrorReported MethodType = "ServiceWorker.workerErrorReported" + EventServiceWorkerWorkerRegistrationUpdated MethodType = "ServiceWorker.workerRegistrationUpdated" + EventServiceWorkerWorkerVersionUpdated MethodType = "ServiceWorker.workerVersionUpdated" + CommandServiceWorkerDeliverPushMessage MethodType = "ServiceWorker.deliverPushMessage" + CommandServiceWorkerDisable MethodType = "ServiceWorker.disable" + CommandServiceWorkerDispatchSyncEvent MethodType = "ServiceWorker.dispatchSyncEvent" + CommandServiceWorkerEnable MethodType = "ServiceWorker.enable" + CommandServiceWorkerInspectWorker MethodType = "ServiceWorker.inspectWorker" + CommandServiceWorkerSetForceUpdateOnPageLoad MethodType = "ServiceWorker.setForceUpdateOnPageLoad" + CommandServiceWorkerSkipWaiting MethodType = "ServiceWorker.skipWaiting" + CommandServiceWorkerStartWorker MethodType = "ServiceWorker.startWorker" + CommandServiceWorkerStopAllWorkers MethodType = "ServiceWorker.stopAllWorkers" + CommandServiceWorkerStopWorker MethodType = "ServiceWorker.stopWorker" + CommandServiceWorkerUnregister MethodType = "ServiceWorker.unregister" + CommandServiceWorkerUpdateRegistration MethodType = "ServiceWorker.updateRegistration" + EventStorageCacheStorageContentUpdated MethodType = "Storage.cacheStorageContentUpdated" + EventStorageCacheStorageListUpdated MethodType = "Storage.cacheStorageListUpdated" + EventStorageIndexedDBContentUpdated MethodType = "Storage.indexedDBContentUpdated" + EventStorageIndexedDBListUpdated MethodType = "Storage.indexedDBListUpdated" + CommandStorageClearDataForOrigin MethodType = "Storage.clearDataForOrigin" + CommandStorageGetUsageAndQuota MethodType = "Storage.getUsageAndQuota" + CommandStorageTrackCacheStorageForOrigin MethodType = "Storage.trackCacheStorageForOrigin" + CommandStorageTrackIndexedDBForOrigin MethodType = "Storage.trackIndexedDBForOrigin" + CommandStorageUntrackCacheStorageForOrigin MethodType = "Storage.untrackCacheStorageForOrigin" + CommandStorageUntrackIndexedDBForOrigin MethodType = "Storage.untrackIndexedDBForOrigin" + CommandSystemInfoGetInfo MethodType = "SystemInfo.getInfo" + EventTargetAttachedToTarget MethodType = "Target.attachedToTarget" + EventTargetDetachedFromTarget MethodType = "Target.detachedFromTarget" + EventTargetReceivedMessageFromTarget MethodType = "Target.receivedMessageFromTarget" + EventTargetTargetCreated MethodType = "Target.targetCreated" + EventTargetTargetDestroyed MethodType = "Target.targetDestroyed" + EventTargetTargetInfoChanged MethodType = "Target.targetInfoChanged" + CommandTargetActivateTarget MethodType = "Target.activateTarget" + CommandTargetAttachToTarget MethodType = "Target.attachToTarget" + CommandTargetCloseTarget MethodType = "Target.closeTarget" + CommandTargetCreateBrowserContext MethodType = "Target.createBrowserContext" + CommandTargetCreateTarget MethodType = "Target.createTarget" + CommandTargetDetachFromTarget MethodType = "Target.detachFromTarget" + CommandTargetDisposeBrowserContext MethodType = "Target.disposeBrowserContext" + CommandTargetGetTargetInfo MethodType = "Target.getTargetInfo" + CommandTargetGetTargets MethodType = "Target.getTargets" + CommandTargetSendMessageToTarget MethodType = "Target.sendMessageToTarget" + CommandTargetSetAttachToFrames MethodType = "Target.setAttachToFrames" + CommandTargetSetAutoAttach MethodType = "Target.setAutoAttach" + CommandTargetSetDiscoverTargets MethodType = "Target.setDiscoverTargets" + CommandTargetSetRemoteLocations MethodType = "Target.setRemoteLocations" + EventTetheringAccepted MethodType = "Tethering.accepted" + CommandTetheringBind MethodType = "Tethering.bind" + CommandTetheringUnbind MethodType = "Tethering.unbind" + EventTracingBufferUsage MethodType = "Tracing.bufferUsage" + EventTracingDataCollected MethodType = "Tracing.dataCollected" + EventTracingTracingComplete MethodType = "Tracing.tracingComplete" + CommandTracingEnd MethodType = "Tracing.end" + CommandTracingGetCategories MethodType = "Tracing.getCategories" + CommandTracingRecordClockSyncMarker MethodType = "Tracing.recordClockSyncMarker" + CommandTracingRequestMemoryDump MethodType = "Tracing.requestMemoryDump" + CommandTracingStart MethodType = "Tracing.start" + EventDebuggerBreakpointResolved MethodType = "Debugger.breakpointResolved" + EventDebuggerPaused MethodType = "Debugger.paused" + EventDebuggerResumed MethodType = "Debugger.resumed" + EventDebuggerScriptFailedToParse MethodType = "Debugger.scriptFailedToParse" + EventDebuggerScriptParsed MethodType = "Debugger.scriptParsed" + CommandDebuggerContinueToLocation MethodType = "Debugger.continueToLocation" + CommandDebuggerDisable MethodType = "Debugger.disable" + CommandDebuggerEnable MethodType = "Debugger.enable" + CommandDebuggerEvaluateOnCallFrame MethodType = "Debugger.evaluateOnCallFrame" + CommandDebuggerGetPossibleBreakpoints MethodType = "Debugger.getPossibleBreakpoints" + CommandDebuggerGetScriptSource MethodType = "Debugger.getScriptSource" + CommandDebuggerGetStackTrace MethodType = "Debugger.getStackTrace" + CommandDebuggerPause MethodType = "Debugger.pause" + CommandDebuggerPauseOnAsyncCall MethodType = "Debugger.pauseOnAsyncCall" + CommandDebuggerRemoveBreakpoint MethodType = "Debugger.removeBreakpoint" + CommandDebuggerRestartFrame MethodType = "Debugger.restartFrame" + CommandDebuggerResume MethodType = "Debugger.resume" + CommandDebuggerScheduleStepIntoAsync MethodType = "Debugger.scheduleStepIntoAsync" + CommandDebuggerSearchInContent MethodType = "Debugger.searchInContent" + CommandDebuggerSetAsyncCallStackDepth MethodType = "Debugger.setAsyncCallStackDepth" + CommandDebuggerSetBlackboxPatterns MethodType = "Debugger.setBlackboxPatterns" + CommandDebuggerSetBlackboxedRanges MethodType = "Debugger.setBlackboxedRanges" + CommandDebuggerSetBreakpoint MethodType = "Debugger.setBreakpoint" + CommandDebuggerSetBreakpointByURL MethodType = "Debugger.setBreakpointByUrl" + CommandDebuggerSetBreakpointsActive MethodType = "Debugger.setBreakpointsActive" + CommandDebuggerSetPauseOnExceptions MethodType = "Debugger.setPauseOnExceptions" + CommandDebuggerSetReturnValue MethodType = "Debugger.setReturnValue" + CommandDebuggerSetScriptSource MethodType = "Debugger.setScriptSource" + CommandDebuggerSetSkipAllPauses MethodType = "Debugger.setSkipAllPauses" + CommandDebuggerSetVariableValue MethodType = "Debugger.setVariableValue" + CommandDebuggerStepInto MethodType = "Debugger.stepInto" + CommandDebuggerStepOut MethodType = "Debugger.stepOut" + CommandDebuggerStepOver MethodType = "Debugger.stepOver" + EventHeapProfilerAddHeapSnapshotChunk MethodType = "HeapProfiler.addHeapSnapshotChunk" + EventHeapProfilerHeapStatsUpdate MethodType = "HeapProfiler.heapStatsUpdate" + EventHeapProfilerLastSeenObjectID MethodType = "HeapProfiler.lastSeenObjectId" + EventHeapProfilerReportHeapSnapshotProgress MethodType = "HeapProfiler.reportHeapSnapshotProgress" + EventHeapProfilerResetProfiles MethodType = "HeapProfiler.resetProfiles" + CommandHeapProfilerAddInspectedHeapObject MethodType = "HeapProfiler.addInspectedHeapObject" + CommandHeapProfilerCollectGarbage MethodType = "HeapProfiler.collectGarbage" + CommandHeapProfilerDisable MethodType = "HeapProfiler.disable" + CommandHeapProfilerEnable MethodType = "HeapProfiler.enable" + CommandHeapProfilerGetHeapObjectID MethodType = "HeapProfiler.getHeapObjectId" + CommandHeapProfilerGetObjectByHeapObjectID MethodType = "HeapProfiler.getObjectByHeapObjectId" + CommandHeapProfilerGetSamplingProfile MethodType = "HeapProfiler.getSamplingProfile" + CommandHeapProfilerStartSampling MethodType = "HeapProfiler.startSampling" + CommandHeapProfilerStartTrackingHeapObjects MethodType = "HeapProfiler.startTrackingHeapObjects" + CommandHeapProfilerStopSampling MethodType = "HeapProfiler.stopSampling" + CommandHeapProfilerStopTrackingHeapObjects MethodType = "HeapProfiler.stopTrackingHeapObjects" + CommandHeapProfilerTakeHeapSnapshot MethodType = "HeapProfiler.takeHeapSnapshot" + EventProfilerConsoleProfileFinished MethodType = "Profiler.consoleProfileFinished" + EventProfilerConsoleProfileStarted MethodType = "Profiler.consoleProfileStarted" + CommandProfilerDisable MethodType = "Profiler.disable" + CommandProfilerEnable MethodType = "Profiler.enable" + CommandProfilerGetBestEffortCoverage MethodType = "Profiler.getBestEffortCoverage" + CommandProfilerSetSamplingInterval MethodType = "Profiler.setSamplingInterval" + CommandProfilerStart MethodType = "Profiler.start" + CommandProfilerStartPreciseCoverage MethodType = "Profiler.startPreciseCoverage" + CommandProfilerStartTypeProfile MethodType = "Profiler.startTypeProfile" + CommandProfilerStop MethodType = "Profiler.stop" + CommandProfilerStopPreciseCoverage MethodType = "Profiler.stopPreciseCoverage" + CommandProfilerStopTypeProfile MethodType = "Profiler.stopTypeProfile" + CommandProfilerTakePreciseCoverage MethodType = "Profiler.takePreciseCoverage" + CommandProfilerTakeTypeProfile MethodType = "Profiler.takeTypeProfile" + EventRuntimeConsoleAPICalled MethodType = "Runtime.consoleAPICalled" + EventRuntimeExceptionRevoked MethodType = "Runtime.exceptionRevoked" + EventRuntimeExceptionThrown MethodType = "Runtime.exceptionThrown" + EventRuntimeExecutionContextCreated MethodType = "Runtime.executionContextCreated" + EventRuntimeExecutionContextDestroyed MethodType = "Runtime.executionContextDestroyed" + EventRuntimeExecutionContextsCleared MethodType = "Runtime.executionContextsCleared" + EventRuntimeInspectRequested MethodType = "Runtime.inspectRequested" + CommandRuntimeAwaitPromise MethodType = "Runtime.awaitPromise" + CommandRuntimeCallFunctionOn MethodType = "Runtime.callFunctionOn" + CommandRuntimeCompileScript MethodType = "Runtime.compileScript" + CommandRuntimeDisable MethodType = "Runtime.disable" + CommandRuntimeDiscardConsoleEntries MethodType = "Runtime.discardConsoleEntries" + CommandRuntimeEnable MethodType = "Runtime.enable" + CommandRuntimeEvaluate MethodType = "Runtime.evaluate" + CommandRuntimeGetProperties MethodType = "Runtime.getProperties" + CommandRuntimeGlobalLexicalScopeNames MethodType = "Runtime.globalLexicalScopeNames" + CommandRuntimeQueryObjects MethodType = "Runtime.queryObjects" + CommandRuntimeReleaseObject MethodType = "Runtime.releaseObject" + CommandRuntimeReleaseObjectGroup MethodType = "Runtime.releaseObjectGroup" + CommandRuntimeRunIfWaitingForDebugger MethodType = "Runtime.runIfWaitingForDebugger" + CommandRuntimeRunScript MethodType = "Runtime.runScript" + CommandRuntimeSetCustomObjectFormatterEnabled MethodType = "Runtime.setCustomObjectFormatterEnabled" +) + +// MarshalEasyJSON satisfies easyjson.Marshaler. +func (t MethodType) MarshalEasyJSON(out *jwriter.Writer) { + out.String(string(t)) +} + +// MarshalJSON satisfies json.Marshaler. +func (t MethodType) MarshalJSON() ([]byte, error) { + return easyjson.Marshal(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) { + switch MethodType(in.String()) { + case CommandAccessibilityGetPartialAXTree: + *t = CommandAccessibilityGetPartialAXTree + case EventAnimationAnimationCanceled: + *t = EventAnimationAnimationCanceled + case EventAnimationAnimationCreated: + *t = EventAnimationAnimationCreated + case EventAnimationAnimationStarted: + *t = EventAnimationAnimationStarted + case CommandAnimationDisable: + *t = CommandAnimationDisable + case CommandAnimationEnable: + *t = CommandAnimationEnable + case CommandAnimationGetCurrentTime: + *t = CommandAnimationGetCurrentTime + case CommandAnimationGetPlaybackRate: + *t = CommandAnimationGetPlaybackRate + case CommandAnimationReleaseAnimations: + *t = CommandAnimationReleaseAnimations + case CommandAnimationResolveAnimation: + *t = CommandAnimationResolveAnimation + case CommandAnimationSeekAnimations: + *t = CommandAnimationSeekAnimations + case CommandAnimationSetPaused: + *t = CommandAnimationSetPaused + case CommandAnimationSetPlaybackRate: + *t = CommandAnimationSetPlaybackRate + case CommandAnimationSetTiming: + *t = CommandAnimationSetTiming + case EventApplicationCacheApplicationCacheStatusUpdated: + *t = EventApplicationCacheApplicationCacheStatusUpdated + case EventApplicationCacheNetworkStateUpdated: + *t = EventApplicationCacheNetworkStateUpdated + case CommandApplicationCacheEnable: + *t = CommandApplicationCacheEnable + case CommandApplicationCacheGetApplicationCacheForFrame: + *t = CommandApplicationCacheGetApplicationCacheForFrame + case CommandApplicationCacheGetFramesWithManifests: + *t = CommandApplicationCacheGetFramesWithManifests + case CommandApplicationCacheGetManifestForFrame: + *t = CommandApplicationCacheGetManifestForFrame + case CommandAuditsGetEncodedResponse: + *t = CommandAuditsGetEncodedResponse + case CommandBrowserClose: + *t = CommandBrowserClose + case CommandBrowserGetVersion: + *t = CommandBrowserGetVersion + case CommandBrowserGetWindowBounds: + *t = CommandBrowserGetWindowBounds + case CommandBrowserGetWindowForTarget: + *t = CommandBrowserGetWindowForTarget + case CommandBrowserSetWindowBounds: + *t = CommandBrowserSetWindowBounds + case EventCSSFontsUpdated: + *t = EventCSSFontsUpdated + case EventCSSMediaQueryResultChanged: + *t = EventCSSMediaQueryResultChanged + case EventCSSStyleSheetAdded: + *t = EventCSSStyleSheetAdded + case EventCSSStyleSheetChanged: + *t = EventCSSStyleSheetChanged + case EventCSSStyleSheetRemoved: + *t = EventCSSStyleSheetRemoved + case CommandCSSAddRule: + *t = CommandCSSAddRule + case CommandCSSCollectClassNames: + *t = CommandCSSCollectClassNames + case CommandCSSCreateStyleSheet: + *t = CommandCSSCreateStyleSheet + case CommandCSSDisable: + *t = CommandCSSDisable + case CommandCSSEnable: + *t = CommandCSSEnable + case CommandCSSForcePseudoState: + *t = CommandCSSForcePseudoState + case CommandCSSGetBackgroundColors: + *t = CommandCSSGetBackgroundColors + case CommandCSSGetComputedStyleForNode: + *t = CommandCSSGetComputedStyleForNode + case CommandCSSGetInlineStylesForNode: + *t = CommandCSSGetInlineStylesForNode + case CommandCSSGetMatchedStylesForNode: + *t = CommandCSSGetMatchedStylesForNode + case CommandCSSGetMediaQueries: + *t = CommandCSSGetMediaQueries + case CommandCSSGetPlatformFontsForNode: + *t = CommandCSSGetPlatformFontsForNode + case CommandCSSGetStyleSheetText: + *t = CommandCSSGetStyleSheetText + case CommandCSSSetEffectivePropertyValueForNode: + *t = CommandCSSSetEffectivePropertyValueForNode + case CommandCSSSetKeyframeKey: + *t = CommandCSSSetKeyframeKey + case CommandCSSSetMediaText: + *t = CommandCSSSetMediaText + case CommandCSSSetRuleSelector: + *t = CommandCSSSetRuleSelector + case CommandCSSSetStyleSheetText: + *t = CommandCSSSetStyleSheetText + case CommandCSSSetStyleTexts: + *t = CommandCSSSetStyleTexts + case CommandCSSStartRuleUsageTracking: + *t = CommandCSSStartRuleUsageTracking + case CommandCSSStopRuleUsageTracking: + *t = CommandCSSStopRuleUsageTracking + case CommandCSSTakeCoverageDelta: + *t = CommandCSSTakeCoverageDelta + case CommandCacheStorageDeleteCache: + *t = CommandCacheStorageDeleteCache + case CommandCacheStorageDeleteEntry: + *t = CommandCacheStorageDeleteEntry + case CommandCacheStorageRequestCacheNames: + *t = CommandCacheStorageRequestCacheNames + case CommandCacheStorageRequestCachedResponse: + *t = CommandCacheStorageRequestCachedResponse + case CommandCacheStorageRequestEntries: + *t = CommandCacheStorageRequestEntries + case EventDOMAttributeModified: + *t = EventDOMAttributeModified + case EventDOMAttributeRemoved: + *t = EventDOMAttributeRemoved + case EventDOMCharacterDataModified: + *t = EventDOMCharacterDataModified + case EventDOMChildNodeCountUpdated: + *t = EventDOMChildNodeCountUpdated + case EventDOMChildNodeInserted: + *t = EventDOMChildNodeInserted + case EventDOMChildNodeRemoved: + *t = EventDOMChildNodeRemoved + case EventDOMDistributedNodesUpdated: + *t = EventDOMDistributedNodesUpdated + case EventDOMDocumentUpdated: + *t = EventDOMDocumentUpdated + case EventDOMInlineStyleInvalidated: + *t = EventDOMInlineStyleInvalidated + case EventDOMPseudoElementAdded: + *t = EventDOMPseudoElementAdded + case EventDOMPseudoElementRemoved: + *t = EventDOMPseudoElementRemoved + case EventDOMSetChildNodes: + *t = EventDOMSetChildNodes + case EventDOMShadowRootPopped: + *t = EventDOMShadowRootPopped + case EventDOMShadowRootPushed: + *t = EventDOMShadowRootPushed + case CommandDOMCollectClassNamesFromSubtree: + *t = CommandDOMCollectClassNamesFromSubtree + case CommandDOMCopyTo: + *t = CommandDOMCopyTo + case CommandDOMDescribeNode: + *t = CommandDOMDescribeNode + case CommandDOMDisable: + *t = CommandDOMDisable + case CommandDOMDiscardSearchResults: + *t = CommandDOMDiscardSearchResults + case CommandDOMEnable: + *t = CommandDOMEnable + case CommandDOMFocus: + *t = CommandDOMFocus + case CommandDOMGetAttributes: + *t = CommandDOMGetAttributes + case CommandDOMGetBoxModel: + *t = CommandDOMGetBoxModel + case CommandDOMGetDocument: + *t = CommandDOMGetDocument + case CommandDOMGetFlattenedDocument: + *t = CommandDOMGetFlattenedDocument + case CommandDOMGetNodeForLocation: + *t = CommandDOMGetNodeForLocation + case CommandDOMGetOuterHTML: + *t = CommandDOMGetOuterHTML + case CommandDOMGetRelayoutBoundary: + *t = CommandDOMGetRelayoutBoundary + case CommandDOMGetSearchResults: + *t = CommandDOMGetSearchResults + case CommandDOMMarkUndoableState: + *t = CommandDOMMarkUndoableState + case CommandDOMMoveTo: + *t = CommandDOMMoveTo + case CommandDOMPerformSearch: + *t = CommandDOMPerformSearch + case CommandDOMPushNodeByPathToFrontend: + *t = CommandDOMPushNodeByPathToFrontend + case CommandDOMPushNodesByBackendIdsToFrontend: + *t = CommandDOMPushNodesByBackendIdsToFrontend + case CommandDOMQuerySelector: + *t = CommandDOMQuerySelector + case CommandDOMQuerySelectorAll: + *t = CommandDOMQuerySelectorAll + case CommandDOMRedo: + *t = CommandDOMRedo + case CommandDOMRemoveAttribute: + *t = CommandDOMRemoveAttribute + case CommandDOMRemoveNode: + *t = CommandDOMRemoveNode + case CommandDOMRequestChildNodes: + *t = CommandDOMRequestChildNodes + case CommandDOMRequestNode: + *t = CommandDOMRequestNode + case CommandDOMResolveNode: + *t = CommandDOMResolveNode + case CommandDOMSetAttributeValue: + *t = CommandDOMSetAttributeValue + case CommandDOMSetAttributesAsText: + *t = CommandDOMSetAttributesAsText + case CommandDOMSetFileInputFiles: + *t = CommandDOMSetFileInputFiles + case CommandDOMSetInspectedNode: + *t = CommandDOMSetInspectedNode + case CommandDOMSetNodeName: + *t = CommandDOMSetNodeName + case CommandDOMSetNodeValue: + *t = CommandDOMSetNodeValue + case CommandDOMSetOuterHTML: + *t = CommandDOMSetOuterHTML + case CommandDOMUndo: + *t = CommandDOMUndo + case CommandDOMDebuggerGetEventListeners: + *t = CommandDOMDebuggerGetEventListeners + case CommandDOMDebuggerRemoveDOMBreakpoint: + *t = CommandDOMDebuggerRemoveDOMBreakpoint + case CommandDOMDebuggerRemoveEventListenerBreakpoint: + *t = CommandDOMDebuggerRemoveEventListenerBreakpoint + case CommandDOMDebuggerRemoveInstrumentationBreakpoint: + *t = CommandDOMDebuggerRemoveInstrumentationBreakpoint + case CommandDOMDebuggerRemoveXHRBreakpoint: + *t = CommandDOMDebuggerRemoveXHRBreakpoint + case CommandDOMDebuggerSetDOMBreakpoint: + *t = CommandDOMDebuggerSetDOMBreakpoint + case CommandDOMDebuggerSetEventListenerBreakpoint: + *t = CommandDOMDebuggerSetEventListenerBreakpoint + case CommandDOMDebuggerSetInstrumentationBreakpoint: + *t = CommandDOMDebuggerSetInstrumentationBreakpoint + case CommandDOMDebuggerSetXHRBreakpoint: + *t = CommandDOMDebuggerSetXHRBreakpoint + case CommandDOMSnapshotGetSnapshot: + *t = CommandDOMSnapshotGetSnapshot + case EventDOMStorageDomStorageItemAdded: + *t = EventDOMStorageDomStorageItemAdded + case EventDOMStorageDomStorageItemRemoved: + *t = EventDOMStorageDomStorageItemRemoved + case EventDOMStorageDomStorageItemUpdated: + *t = EventDOMStorageDomStorageItemUpdated + case EventDOMStorageDomStorageItemsCleared: + *t = EventDOMStorageDomStorageItemsCleared + case CommandDOMStorageClear: + *t = CommandDOMStorageClear + case CommandDOMStorageDisable: + *t = CommandDOMStorageDisable + case CommandDOMStorageEnable: + *t = CommandDOMStorageEnable + case CommandDOMStorageGetDOMStorageItems: + *t = CommandDOMStorageGetDOMStorageItems + case CommandDOMStorageRemoveDOMStorageItem: + *t = CommandDOMStorageRemoveDOMStorageItem + case CommandDOMStorageSetDOMStorageItem: + *t = CommandDOMStorageSetDOMStorageItem + case EventDatabaseAddDatabase: + *t = EventDatabaseAddDatabase + case CommandDatabaseDisable: + *t = CommandDatabaseDisable + case CommandDatabaseEnable: + *t = CommandDatabaseEnable + case CommandDatabaseExecuteSQL: + *t = CommandDatabaseExecuteSQL + case CommandDatabaseGetDatabaseTableNames: + *t = CommandDatabaseGetDatabaseTableNames + case CommandDeviceOrientationClearDeviceOrientationOverride: + *t = CommandDeviceOrientationClearDeviceOrientationOverride + case CommandDeviceOrientationSetDeviceOrientationOverride: + *t = CommandDeviceOrientationSetDeviceOrientationOverride + case EventEmulationVirtualTimeAdvanced: + *t = EventEmulationVirtualTimeAdvanced + case EventEmulationVirtualTimeBudgetExpired: + *t = EventEmulationVirtualTimeBudgetExpired + case EventEmulationVirtualTimePaused: + *t = EventEmulationVirtualTimePaused + case CommandEmulationCanEmulate: + *t = CommandEmulationCanEmulate + case CommandEmulationClearDeviceMetricsOverride: + *t = CommandEmulationClearDeviceMetricsOverride + case CommandEmulationClearGeolocationOverride: + *t = CommandEmulationClearGeolocationOverride + case CommandEmulationResetPageScaleFactor: + *t = CommandEmulationResetPageScaleFactor + case CommandEmulationSetCPUThrottlingRate: + *t = CommandEmulationSetCPUThrottlingRate + case CommandEmulationSetDefaultBackgroundColorOverride: + *t = CommandEmulationSetDefaultBackgroundColorOverride + case CommandEmulationSetDeviceMetricsOverride: + *t = CommandEmulationSetDeviceMetricsOverride + case CommandEmulationSetEmitTouchEventsForMouse: + *t = CommandEmulationSetEmitTouchEventsForMouse + case CommandEmulationSetEmulatedMedia: + *t = CommandEmulationSetEmulatedMedia + case CommandEmulationSetGeolocationOverride: + *t = CommandEmulationSetGeolocationOverride + case CommandEmulationSetNavigatorOverrides: + *t = CommandEmulationSetNavigatorOverrides + case CommandEmulationSetPageScaleFactor: + *t = CommandEmulationSetPageScaleFactor + case CommandEmulationSetScriptExecutionDisabled: + *t = CommandEmulationSetScriptExecutionDisabled + case CommandEmulationSetTouchEmulationEnabled: + *t = CommandEmulationSetTouchEmulationEnabled + case CommandEmulationSetVirtualTimePolicy: + *t = CommandEmulationSetVirtualTimePolicy + case EventHeadlessExperimentalMainFrameReadyForScreenshots: + *t = EventHeadlessExperimentalMainFrameReadyForScreenshots + case EventHeadlessExperimentalNeedsBeginFramesChanged: + *t = EventHeadlessExperimentalNeedsBeginFramesChanged + case CommandHeadlessExperimentalBeginFrame: + *t = CommandHeadlessExperimentalBeginFrame + case CommandHeadlessExperimentalDisable: + *t = CommandHeadlessExperimentalDisable + case CommandHeadlessExperimentalEnable: + *t = CommandHeadlessExperimentalEnable + case CommandIOClose: + *t = CommandIOClose + case CommandIORead: + *t = CommandIORead + case CommandIOResolveBlob: + *t = CommandIOResolveBlob + case CommandIndexedDBClearObjectStore: + *t = CommandIndexedDBClearObjectStore + case CommandIndexedDBDeleteDatabase: + *t = CommandIndexedDBDeleteDatabase + case CommandIndexedDBDeleteObjectStoreEntries: + *t = CommandIndexedDBDeleteObjectStoreEntries + case CommandIndexedDBDisable: + *t = CommandIndexedDBDisable + case CommandIndexedDBEnable: + *t = CommandIndexedDBEnable + case CommandIndexedDBRequestData: + *t = CommandIndexedDBRequestData + case CommandIndexedDBRequestDatabase: + *t = CommandIndexedDBRequestDatabase + case CommandIndexedDBRequestDatabaseNames: + *t = CommandIndexedDBRequestDatabaseNames + case CommandInputDispatchKeyEvent: + *t = CommandInputDispatchKeyEvent + case CommandInputDispatchMouseEvent: + *t = CommandInputDispatchMouseEvent + case CommandInputDispatchTouchEvent: + *t = CommandInputDispatchTouchEvent + case CommandInputEmulateTouchFromMouseEvent: + *t = CommandInputEmulateTouchFromMouseEvent + case CommandInputSetIgnoreInputEvents: + *t = CommandInputSetIgnoreInputEvents + case CommandInputSynthesizePinchGesture: + *t = CommandInputSynthesizePinchGesture + case CommandInputSynthesizeScrollGesture: + *t = CommandInputSynthesizeScrollGesture + case CommandInputSynthesizeTapGesture: + *t = CommandInputSynthesizeTapGesture + case EventInspectorDetached: + *t = EventInspectorDetached + case EventInspectorTargetCrashed: + *t = EventInspectorTargetCrashed + case CommandInspectorDisable: + *t = CommandInspectorDisable + case CommandInspectorEnable: + *t = CommandInspectorEnable + case EventLayerTreeLayerPainted: + *t = EventLayerTreeLayerPainted + case EventLayerTreeLayerTreeDidChange: + *t = EventLayerTreeLayerTreeDidChange + case CommandLayerTreeCompositingReasons: + *t = CommandLayerTreeCompositingReasons + case CommandLayerTreeDisable: + *t = CommandLayerTreeDisable + case CommandLayerTreeEnable: + *t = CommandLayerTreeEnable + case CommandLayerTreeLoadSnapshot: + *t = CommandLayerTreeLoadSnapshot + case CommandLayerTreeMakeSnapshot: + *t = CommandLayerTreeMakeSnapshot + case CommandLayerTreeProfileSnapshot: + *t = CommandLayerTreeProfileSnapshot + case CommandLayerTreeReleaseSnapshot: + *t = CommandLayerTreeReleaseSnapshot + case CommandLayerTreeReplaySnapshot: + *t = CommandLayerTreeReplaySnapshot + case CommandLayerTreeSnapshotCommandLog: + *t = CommandLayerTreeSnapshotCommandLog + case EventLogEntryAdded: + *t = EventLogEntryAdded + case CommandLogClear: + *t = CommandLogClear + case CommandLogDisable: + *t = CommandLogDisable + case CommandLogEnable: + *t = CommandLogEnable + case CommandLogStartViolationsReport: + *t = CommandLogStartViolationsReport + case CommandLogStopViolationsReport: + *t = CommandLogStopViolationsReport + case CommandMemoryGetDOMCounters: + *t = CommandMemoryGetDOMCounters + case CommandMemoryPrepareForLeakDetection: + *t = CommandMemoryPrepareForLeakDetection + case CommandMemorySetPressureNotificationsSuppressed: + *t = CommandMemorySetPressureNotificationsSuppressed + case CommandMemorySimulatePressureNotification: + *t = CommandMemorySimulatePressureNotification + case EventNetworkDataReceived: + *t = EventNetworkDataReceived + case EventNetworkEventSourceMessageReceived: + *t = EventNetworkEventSourceMessageReceived + case EventNetworkLoadingFailed: + *t = EventNetworkLoadingFailed + case EventNetworkLoadingFinished: + *t = EventNetworkLoadingFinished + case EventNetworkRequestIntercepted: + *t = EventNetworkRequestIntercepted + case EventNetworkRequestServedFromCache: + *t = EventNetworkRequestServedFromCache + case EventNetworkRequestWillBeSent: + *t = EventNetworkRequestWillBeSent + case EventNetworkResourceChangedPriority: + *t = EventNetworkResourceChangedPriority + case EventNetworkResponseReceived: + *t = EventNetworkResponseReceived + case EventNetworkWebSocketClosed: + *t = EventNetworkWebSocketClosed + case EventNetworkWebSocketCreated: + *t = EventNetworkWebSocketCreated + case EventNetworkWebSocketFrameError: + *t = EventNetworkWebSocketFrameError + case EventNetworkWebSocketFrameReceived: + *t = EventNetworkWebSocketFrameReceived + case EventNetworkWebSocketFrameSent: + *t = EventNetworkWebSocketFrameSent + case EventNetworkWebSocketHandshakeResponseReceived: + *t = EventNetworkWebSocketHandshakeResponseReceived + case EventNetworkWebSocketWillSendHandshakeRequest: + *t = EventNetworkWebSocketWillSendHandshakeRequest + case CommandNetworkClearBrowserCache: + *t = CommandNetworkClearBrowserCache + case CommandNetworkClearBrowserCookies: + *t = CommandNetworkClearBrowserCookies + case CommandNetworkContinueInterceptedRequest: + *t = CommandNetworkContinueInterceptedRequest + case CommandNetworkDeleteCookies: + *t = CommandNetworkDeleteCookies + case CommandNetworkDisable: + *t = CommandNetworkDisable + case CommandNetworkEmulateNetworkConditions: + *t = CommandNetworkEmulateNetworkConditions + case CommandNetworkEnable: + *t = CommandNetworkEnable + case CommandNetworkGetAllCookies: + *t = CommandNetworkGetAllCookies + case CommandNetworkGetCertificate: + *t = CommandNetworkGetCertificate + case CommandNetworkGetCookies: + *t = CommandNetworkGetCookies + case CommandNetworkGetResponseBody: + *t = CommandNetworkGetResponseBody + case CommandNetworkGetResponseBodyForInterception: + *t = CommandNetworkGetResponseBodyForInterception + case CommandNetworkReplayXHR: + *t = CommandNetworkReplayXHR + case CommandNetworkSearchInResponseBody: + *t = CommandNetworkSearchInResponseBody + case CommandNetworkSetBlockedURLS: + *t = CommandNetworkSetBlockedURLS + case CommandNetworkSetBypassServiceWorker: + *t = CommandNetworkSetBypassServiceWorker + case CommandNetworkSetCacheDisabled: + *t = CommandNetworkSetCacheDisabled + case CommandNetworkSetCookie: + *t = CommandNetworkSetCookie + case CommandNetworkSetCookies: + *t = CommandNetworkSetCookies + case CommandNetworkSetDataSizeLimitsForTest: + *t = CommandNetworkSetDataSizeLimitsForTest + case CommandNetworkSetExtraHTTPHeaders: + *t = CommandNetworkSetExtraHTTPHeaders + case CommandNetworkSetRequestInterception: + *t = CommandNetworkSetRequestInterception + case CommandNetworkSetUserAgentOverride: + *t = CommandNetworkSetUserAgentOverride + case EventOverlayInspectNodeRequested: + *t = EventOverlayInspectNodeRequested + case EventOverlayNodeHighlightRequested: + *t = EventOverlayNodeHighlightRequested + case EventOverlayScreenshotRequested: + *t = EventOverlayScreenshotRequested + case CommandOverlayDisable: + *t = CommandOverlayDisable + case CommandOverlayEnable: + *t = CommandOverlayEnable + case CommandOverlayGetHighlightObjectForTest: + *t = CommandOverlayGetHighlightObjectForTest + case CommandOverlayHideHighlight: + *t = CommandOverlayHideHighlight + case CommandOverlayHighlightFrame: + *t = CommandOverlayHighlightFrame + case CommandOverlayHighlightNode: + *t = CommandOverlayHighlightNode + case CommandOverlayHighlightQuad: + *t = CommandOverlayHighlightQuad + case CommandOverlayHighlightRect: + *t = CommandOverlayHighlightRect + case CommandOverlaySetInspectMode: + *t = CommandOverlaySetInspectMode + case CommandOverlaySetPausedInDebuggerMessage: + *t = CommandOverlaySetPausedInDebuggerMessage + case CommandOverlaySetShowDebugBorders: + *t = CommandOverlaySetShowDebugBorders + case CommandOverlaySetShowFPSCounter: + *t = CommandOverlaySetShowFPSCounter + case CommandOverlaySetShowPaintRects: + *t = CommandOverlaySetShowPaintRects + case CommandOverlaySetShowScrollBottleneckRects: + *t = CommandOverlaySetShowScrollBottleneckRects + case CommandOverlaySetShowViewportSizeOnResize: + *t = CommandOverlaySetShowViewportSizeOnResize + case CommandOverlaySetSuspended: + *t = CommandOverlaySetSuspended + case EventPageDomContentEventFired: + *t = EventPageDomContentEventFired + case EventPageFrameAttached: + *t = EventPageFrameAttached + case EventPageFrameClearedScheduledNavigation: + *t = EventPageFrameClearedScheduledNavigation + case EventPageFrameDetached: + *t = EventPageFrameDetached + case EventPageFrameNavigated: + *t = EventPageFrameNavigated + case EventPageFrameResized: + *t = EventPageFrameResized + case EventPageFrameScheduledNavigation: + *t = EventPageFrameScheduledNavigation + case EventPageFrameStartedLoading: + *t = EventPageFrameStartedLoading + case EventPageFrameStoppedLoading: + *t = EventPageFrameStoppedLoading + case EventPageInterstitialHidden: + *t = EventPageInterstitialHidden + case EventPageInterstitialShown: + *t = EventPageInterstitialShown + case EventPageJavascriptDialogClosed: + *t = EventPageJavascriptDialogClosed + case EventPageJavascriptDialogOpening: + *t = EventPageJavascriptDialogOpening + case EventPageLifecycleEvent: + *t = EventPageLifecycleEvent + case EventPageLoadEventFired: + *t = EventPageLoadEventFired + case EventPageScreencastFrame: + *t = EventPageScreencastFrame + case EventPageScreencastVisibilityChanged: + *t = EventPageScreencastVisibilityChanged + case EventPageWindowOpen: + *t = EventPageWindowOpen + case CommandPageAddScriptToEvaluateOnNewDocument: + *t = CommandPageAddScriptToEvaluateOnNewDocument + case CommandPageBringToFront: + *t = CommandPageBringToFront + case CommandPageCaptureScreenshot: + *t = CommandPageCaptureScreenshot + case CommandPageCreateIsolatedWorld: + *t = CommandPageCreateIsolatedWorld + case CommandPageDisable: + *t = CommandPageDisable + case CommandPageEnable: + *t = CommandPageEnable + case CommandPageGetAppManifest: + *t = CommandPageGetAppManifest + case CommandPageGetFrameTree: + *t = CommandPageGetFrameTree + case CommandPageGetLayoutMetrics: + *t = CommandPageGetLayoutMetrics + case CommandPageGetNavigationHistory: + *t = CommandPageGetNavigationHistory + case CommandPageGetResourceContent: + *t = CommandPageGetResourceContent + case CommandPageGetResourceTree: + *t = CommandPageGetResourceTree + case CommandPageHandleJavaScriptDialog: + *t = CommandPageHandleJavaScriptDialog + case CommandPageNavigate: + *t = CommandPageNavigate + case CommandPageNavigateToHistoryEntry: + *t = CommandPageNavigateToHistoryEntry + case CommandPagePrintToPDF: + *t = CommandPagePrintToPDF + case CommandPageReload: + *t = CommandPageReload + case CommandPageRemoveScriptToEvaluateOnNewDocument: + *t = CommandPageRemoveScriptToEvaluateOnNewDocument + case CommandPageRequestAppBanner: + *t = CommandPageRequestAppBanner + case CommandPageScreencastFrameAck: + *t = CommandPageScreencastFrameAck + case CommandPageSearchInResource: + *t = CommandPageSearchInResource + case CommandPageSetAdBlockingEnabled: + *t = CommandPageSetAdBlockingEnabled + case CommandPageSetAutoAttachToCreatedPages: + *t = CommandPageSetAutoAttachToCreatedPages + case CommandPageSetDocumentContent: + *t = CommandPageSetDocumentContent + case CommandPageSetDownloadBehavior: + *t = CommandPageSetDownloadBehavior + case CommandPageSetLifecycleEventsEnabled: + *t = CommandPageSetLifecycleEventsEnabled + case CommandPageStartScreencast: + *t = CommandPageStartScreencast + case CommandPageStopLoading: + *t = CommandPageStopLoading + case CommandPageStopScreencast: + *t = CommandPageStopScreencast + case EventPerformanceMetrics: + *t = EventPerformanceMetrics + case CommandPerformanceDisable: + *t = CommandPerformanceDisable + case CommandPerformanceEnable: + *t = CommandPerformanceEnable + case CommandPerformanceGetMetrics: + *t = CommandPerformanceGetMetrics + case EventSecurityCertificateError: + *t = EventSecurityCertificateError + case EventSecuritySecurityStateChanged: + *t = EventSecuritySecurityStateChanged + case CommandSecurityDisable: + *t = CommandSecurityDisable + case CommandSecurityEnable: + *t = CommandSecurityEnable + case CommandSecurityHandleCertificateError: + *t = CommandSecurityHandleCertificateError + case CommandSecuritySetOverrideCertificateErrors: + *t = CommandSecuritySetOverrideCertificateErrors + case EventServiceWorkerWorkerErrorReported: + *t = EventServiceWorkerWorkerErrorReported + case EventServiceWorkerWorkerRegistrationUpdated: + *t = EventServiceWorkerWorkerRegistrationUpdated + case EventServiceWorkerWorkerVersionUpdated: + *t = EventServiceWorkerWorkerVersionUpdated + case CommandServiceWorkerDeliverPushMessage: + *t = CommandServiceWorkerDeliverPushMessage + case CommandServiceWorkerDisable: + *t = CommandServiceWorkerDisable + case CommandServiceWorkerDispatchSyncEvent: + *t = CommandServiceWorkerDispatchSyncEvent + case CommandServiceWorkerEnable: + *t = CommandServiceWorkerEnable + case CommandServiceWorkerInspectWorker: + *t = CommandServiceWorkerInspectWorker + case CommandServiceWorkerSetForceUpdateOnPageLoad: + *t = CommandServiceWorkerSetForceUpdateOnPageLoad + case CommandServiceWorkerSkipWaiting: + *t = CommandServiceWorkerSkipWaiting + case CommandServiceWorkerStartWorker: + *t = CommandServiceWorkerStartWorker + case CommandServiceWorkerStopAllWorkers: + *t = CommandServiceWorkerStopAllWorkers + case CommandServiceWorkerStopWorker: + *t = CommandServiceWorkerStopWorker + case CommandServiceWorkerUnregister: + *t = CommandServiceWorkerUnregister + case CommandServiceWorkerUpdateRegistration: + *t = CommandServiceWorkerUpdateRegistration + case EventStorageCacheStorageContentUpdated: + *t = EventStorageCacheStorageContentUpdated + case EventStorageCacheStorageListUpdated: + *t = EventStorageCacheStorageListUpdated + case EventStorageIndexedDBContentUpdated: + *t = EventStorageIndexedDBContentUpdated + case EventStorageIndexedDBListUpdated: + *t = EventStorageIndexedDBListUpdated + case CommandStorageClearDataForOrigin: + *t = CommandStorageClearDataForOrigin + case CommandStorageGetUsageAndQuota: + *t = CommandStorageGetUsageAndQuota + case CommandStorageTrackCacheStorageForOrigin: + *t = CommandStorageTrackCacheStorageForOrigin + case CommandStorageTrackIndexedDBForOrigin: + *t = CommandStorageTrackIndexedDBForOrigin + case CommandStorageUntrackCacheStorageForOrigin: + *t = CommandStorageUntrackCacheStorageForOrigin + case CommandStorageUntrackIndexedDBForOrigin: + *t = CommandStorageUntrackIndexedDBForOrigin + case CommandSystemInfoGetInfo: + *t = CommandSystemInfoGetInfo + case EventTargetAttachedToTarget: + *t = EventTargetAttachedToTarget + case EventTargetDetachedFromTarget: + *t = EventTargetDetachedFromTarget + case EventTargetReceivedMessageFromTarget: + *t = EventTargetReceivedMessageFromTarget + case EventTargetTargetCreated: + *t = EventTargetTargetCreated + case EventTargetTargetDestroyed: + *t = EventTargetTargetDestroyed + case EventTargetTargetInfoChanged: + *t = EventTargetTargetInfoChanged + case CommandTargetActivateTarget: + *t = CommandTargetActivateTarget + case CommandTargetAttachToTarget: + *t = CommandTargetAttachToTarget + case CommandTargetCloseTarget: + *t = CommandTargetCloseTarget + case CommandTargetCreateBrowserContext: + *t = CommandTargetCreateBrowserContext + case CommandTargetCreateTarget: + *t = CommandTargetCreateTarget + case CommandTargetDetachFromTarget: + *t = CommandTargetDetachFromTarget + case CommandTargetDisposeBrowserContext: + *t = CommandTargetDisposeBrowserContext + case CommandTargetGetTargetInfo: + *t = CommandTargetGetTargetInfo + case CommandTargetGetTargets: + *t = CommandTargetGetTargets + case CommandTargetSendMessageToTarget: + *t = CommandTargetSendMessageToTarget + case CommandTargetSetAttachToFrames: + *t = CommandTargetSetAttachToFrames + case CommandTargetSetAutoAttach: + *t = CommandTargetSetAutoAttach + case CommandTargetSetDiscoverTargets: + *t = CommandTargetSetDiscoverTargets + case CommandTargetSetRemoteLocations: + *t = CommandTargetSetRemoteLocations + case EventTetheringAccepted: + *t = EventTetheringAccepted + case CommandTetheringBind: + *t = CommandTetheringBind + case CommandTetheringUnbind: + *t = CommandTetheringUnbind + case EventTracingBufferUsage: + *t = EventTracingBufferUsage + case EventTracingDataCollected: + *t = EventTracingDataCollected + case EventTracingTracingComplete: + *t = EventTracingTracingComplete + case CommandTracingEnd: + *t = CommandTracingEnd + case CommandTracingGetCategories: + *t = CommandTracingGetCategories + case CommandTracingRecordClockSyncMarker: + *t = CommandTracingRecordClockSyncMarker + case CommandTracingRequestMemoryDump: + *t = CommandTracingRequestMemoryDump + case CommandTracingStart: + *t = CommandTracingStart + case EventDebuggerBreakpointResolved: + *t = EventDebuggerBreakpointResolved + case EventDebuggerPaused: + *t = EventDebuggerPaused + case EventDebuggerResumed: + *t = EventDebuggerResumed + case EventDebuggerScriptFailedToParse: + *t = EventDebuggerScriptFailedToParse + case EventDebuggerScriptParsed: + *t = EventDebuggerScriptParsed + case CommandDebuggerContinueToLocation: + *t = CommandDebuggerContinueToLocation + case CommandDebuggerDisable: + *t = CommandDebuggerDisable + case CommandDebuggerEnable: + *t = CommandDebuggerEnable + case CommandDebuggerEvaluateOnCallFrame: + *t = CommandDebuggerEvaluateOnCallFrame + case CommandDebuggerGetPossibleBreakpoints: + *t = CommandDebuggerGetPossibleBreakpoints + case CommandDebuggerGetScriptSource: + *t = CommandDebuggerGetScriptSource + case CommandDebuggerGetStackTrace: + *t = CommandDebuggerGetStackTrace + case CommandDebuggerPause: + *t = CommandDebuggerPause + case CommandDebuggerPauseOnAsyncCall: + *t = CommandDebuggerPauseOnAsyncCall + case CommandDebuggerRemoveBreakpoint: + *t = CommandDebuggerRemoveBreakpoint + case CommandDebuggerRestartFrame: + *t = CommandDebuggerRestartFrame + case CommandDebuggerResume: + *t = CommandDebuggerResume + case CommandDebuggerScheduleStepIntoAsync: + *t = CommandDebuggerScheduleStepIntoAsync + case CommandDebuggerSearchInContent: + *t = CommandDebuggerSearchInContent + case CommandDebuggerSetAsyncCallStackDepth: + *t = CommandDebuggerSetAsyncCallStackDepth + case CommandDebuggerSetBlackboxPatterns: + *t = CommandDebuggerSetBlackboxPatterns + case CommandDebuggerSetBlackboxedRanges: + *t = CommandDebuggerSetBlackboxedRanges + case CommandDebuggerSetBreakpoint: + *t = CommandDebuggerSetBreakpoint + case CommandDebuggerSetBreakpointByURL: + *t = CommandDebuggerSetBreakpointByURL + case CommandDebuggerSetBreakpointsActive: + *t = CommandDebuggerSetBreakpointsActive + case CommandDebuggerSetPauseOnExceptions: + *t = CommandDebuggerSetPauseOnExceptions + case CommandDebuggerSetReturnValue: + *t = CommandDebuggerSetReturnValue + case CommandDebuggerSetScriptSource: + *t = CommandDebuggerSetScriptSource + case CommandDebuggerSetSkipAllPauses: + *t = CommandDebuggerSetSkipAllPauses + case CommandDebuggerSetVariableValue: + *t = CommandDebuggerSetVariableValue + case CommandDebuggerStepInto: + *t = CommandDebuggerStepInto + case CommandDebuggerStepOut: + *t = CommandDebuggerStepOut + case CommandDebuggerStepOver: + *t = CommandDebuggerStepOver + case EventHeapProfilerAddHeapSnapshotChunk: + *t = EventHeapProfilerAddHeapSnapshotChunk + case EventHeapProfilerHeapStatsUpdate: + *t = EventHeapProfilerHeapStatsUpdate + case EventHeapProfilerLastSeenObjectID: + *t = EventHeapProfilerLastSeenObjectID + case EventHeapProfilerReportHeapSnapshotProgress: + *t = EventHeapProfilerReportHeapSnapshotProgress + case EventHeapProfilerResetProfiles: + *t = EventHeapProfilerResetProfiles + case CommandHeapProfilerAddInspectedHeapObject: + *t = CommandHeapProfilerAddInspectedHeapObject + case CommandHeapProfilerCollectGarbage: + *t = CommandHeapProfilerCollectGarbage + case CommandHeapProfilerDisable: + *t = CommandHeapProfilerDisable + case CommandHeapProfilerEnable: + *t = CommandHeapProfilerEnable + case CommandHeapProfilerGetHeapObjectID: + *t = CommandHeapProfilerGetHeapObjectID + case CommandHeapProfilerGetObjectByHeapObjectID: + *t = CommandHeapProfilerGetObjectByHeapObjectID + case CommandHeapProfilerGetSamplingProfile: + *t = CommandHeapProfilerGetSamplingProfile + case CommandHeapProfilerStartSampling: + *t = CommandHeapProfilerStartSampling + case CommandHeapProfilerStartTrackingHeapObjects: + *t = CommandHeapProfilerStartTrackingHeapObjects + case CommandHeapProfilerStopSampling: + *t = CommandHeapProfilerStopSampling + case CommandHeapProfilerStopTrackingHeapObjects: + *t = CommandHeapProfilerStopTrackingHeapObjects + case CommandHeapProfilerTakeHeapSnapshot: + *t = CommandHeapProfilerTakeHeapSnapshot + case EventProfilerConsoleProfileFinished: + *t = EventProfilerConsoleProfileFinished + case EventProfilerConsoleProfileStarted: + *t = EventProfilerConsoleProfileStarted + case CommandProfilerDisable: + *t = CommandProfilerDisable + case CommandProfilerEnable: + *t = CommandProfilerEnable + case CommandProfilerGetBestEffortCoverage: + *t = CommandProfilerGetBestEffortCoverage + case CommandProfilerSetSamplingInterval: + *t = CommandProfilerSetSamplingInterval + case CommandProfilerStart: + *t = CommandProfilerStart + case CommandProfilerStartPreciseCoverage: + *t = CommandProfilerStartPreciseCoverage + case CommandProfilerStartTypeProfile: + *t = CommandProfilerStartTypeProfile + case CommandProfilerStop: + *t = CommandProfilerStop + case CommandProfilerStopPreciseCoverage: + *t = CommandProfilerStopPreciseCoverage + case CommandProfilerStopTypeProfile: + *t = CommandProfilerStopTypeProfile + case CommandProfilerTakePreciseCoverage: + *t = CommandProfilerTakePreciseCoverage + case CommandProfilerTakeTypeProfile: + *t = CommandProfilerTakeTypeProfile + case EventRuntimeConsoleAPICalled: + *t = EventRuntimeConsoleAPICalled + case EventRuntimeExceptionRevoked: + *t = EventRuntimeExceptionRevoked + case EventRuntimeExceptionThrown: + *t = EventRuntimeExceptionThrown + case EventRuntimeExecutionContextCreated: + *t = EventRuntimeExecutionContextCreated + case EventRuntimeExecutionContextDestroyed: + *t = EventRuntimeExecutionContextDestroyed + case EventRuntimeExecutionContextsCleared: + *t = EventRuntimeExecutionContextsCleared + case EventRuntimeInspectRequested: + *t = EventRuntimeInspectRequested + case CommandRuntimeAwaitPromise: + *t = CommandRuntimeAwaitPromise + case CommandRuntimeCallFunctionOn: + *t = CommandRuntimeCallFunctionOn + case CommandRuntimeCompileScript: + *t = CommandRuntimeCompileScript + case CommandRuntimeDisable: + *t = CommandRuntimeDisable + case CommandRuntimeDiscardConsoleEntries: + *t = CommandRuntimeDiscardConsoleEntries + case CommandRuntimeEnable: + *t = CommandRuntimeEnable + case CommandRuntimeEvaluate: + *t = CommandRuntimeEvaluate + case CommandRuntimeGetProperties: + *t = CommandRuntimeGetProperties + case CommandRuntimeGlobalLexicalScopeNames: + *t = CommandRuntimeGlobalLexicalScopeNames + case CommandRuntimeQueryObjects: + *t = CommandRuntimeQueryObjects + case CommandRuntimeReleaseObject: + *t = CommandRuntimeReleaseObject + case CommandRuntimeReleaseObjectGroup: + *t = CommandRuntimeReleaseObjectGroup + case CommandRuntimeRunIfWaitingForDebugger: + *t = CommandRuntimeRunIfWaitingForDebugger + case CommandRuntimeRunScript: + *t = CommandRuntimeRunScript + case CommandRuntimeSetCustomObjectFormatterEnabled: + *t = CommandRuntimeSetCustomObjectFormatterEnabled + + default: + in.AddError(errors.New("unknown MethodType value")) + } +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *MethodType) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} + +// Domain returns the Chrome Debugging Protocol domain of the event or command. +func (t MethodType) Domain() string { + return string(t[:strings.IndexByte(string(t), '.')]) +} + +// ErrorType error type. +type ErrorType string + +// String returns the ErrorType as string value. +func (t ErrorType) String() string { + return string(t) +} + +// ErrorType values. +const ( + ErrChannelClosed ErrorType = "channel closed" + ErrInvalidResult ErrorType = "invalid result" + ErrUnknownResult ErrorType = "unknown result" +) + +// MarshalEasyJSON satisfies easyjson.Marshaler. +func (t ErrorType) MarshalEasyJSON(out *jwriter.Writer) { + out.String(string(t)) +} + +// MarshalJSON satisfies json.Marshaler. +func (t ErrorType) MarshalJSON() ([]byte, error) { + return easyjson.Marshal(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *ErrorType) UnmarshalEasyJSON(in *jlexer.Lexer) { + switch ErrorType(in.String()) { + case ErrChannelClosed: + *t = ErrChannelClosed + case ErrInvalidResult: + *t = ErrInvalidResult + case ErrUnknownResult: + *t = ErrUnknownResult + + default: + in.AddError(errors.New("unknown ErrorType value")) + } +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *ErrorType) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} + +// Error satisfies the error interface. +func (t ErrorType) Error() string { + return string(t) +} + +// Handler is the common interface for a Chrome Debugging Protocol target. +type Handler interface { + // SetActive changes the top level frame id. + SetActive(context.Context, FrameID) error + + // GetRoot returns the root document node for the top level frame. + GetRoot(context.Context) (*Node, error) + + // WaitFrame waits for a frame to be available. + WaitFrame(context.Context, FrameID) (*Frame, error) + + // WaitNode waits for a node to be available. + WaitNode(context.Context, *Frame, NodeID) (*Node, error) + + // Execute executes the specified command using the supplied context and + // parameters. + Execute(context.Context, MethodType, easyjson.Marshaler, easyjson.Unmarshaler) error + + // Listen creates a channel that will receive an event for the types + // specified. + Listen(...MethodType) <-chan interface{} + + // Release releases a channel returned from Listen. + Release(<-chan interface{}) +} + +// LoaderID unique loader identifier. +type LoaderID string + +// String returns the LoaderID as string value. +func (t LoaderID) String() string { + return string(t) +} + +// TimeSinceEpoch uTC time in seconds, counted from January 1, 1970. +type TimeSinceEpoch time.Time + +// Time returns the TimeSinceEpoch as time.Time value. +func (t TimeSinceEpoch) Time() time.Time { + return time.Time(t) +} + +// MarshalEasyJSON satisfies easyjson.Marshaler. +func (t TimeSinceEpoch) MarshalEasyJSON(out *jwriter.Writer) { + v := float64(time.Time(t).UnixNano() / int64(time.Second)) + + out.Buffer.EnsureSpace(20) + out.Buffer.Buf = strconv.AppendFloat(out.Buffer.Buf, v, 'f', -1, 64) +} + +// MarshalJSON satisfies json.Marshaler. +func (t TimeSinceEpoch) MarshalJSON() ([]byte, error) { + return easyjson.Marshal(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *TimeSinceEpoch) UnmarshalEasyJSON(in *jlexer.Lexer) { + *t = TimeSinceEpoch(time.Unix(0, int64(in.Float64()*float64(time.Second)))) +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *TimeSinceEpoch) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} + +// MonotonicTime monotonically increasing time in seconds since an arbitrary +// point in the past. +type MonotonicTime time.Time + +// Time returns the MonotonicTime as time.Time value. +func (t MonotonicTime) Time() time.Time { + return time.Time(t) +} + +// MonotonicTimeEpoch is the MonotonicTime time epoch. +var MonotonicTimeEpoch *time.Time + +func init() { + // initialize epoch + bt := sysutil.BootTime() + MonotonicTimeEpoch = &bt +} + +// MarshalEasyJSON satisfies easyjson.Marshaler. +func (t MonotonicTime) MarshalEasyJSON(out *jwriter.Writer) { + v := float64(time.Time(t).Sub(*MonotonicTimeEpoch)) / float64(time.Second) + + out.Buffer.EnsureSpace(20) + out.Buffer.Buf = strconv.AppendFloat(out.Buffer.Buf, v, 'f', -1, 64) +} + +// MarshalJSON satisfies json.Marshaler. +func (t MonotonicTime) MarshalJSON() ([]byte, error) { + return easyjson.Marshal(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *MonotonicTime) UnmarshalEasyJSON(in *jlexer.Lexer) { + *t = MonotonicTime(MonotonicTimeEpoch.Add(time.Duration(in.Float64() * float64(time.Second)))) +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *MonotonicTime) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} + +// FrameID unique frame identifier. +type FrameID string + +// String returns the FrameID as string value. +func (t FrameID) String() string { + return string(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *FrameID) UnmarshalEasyJSON(in *jlexer.Lexer) { + buf := in.Raw() + if l := len(buf); l > 2 && buf[0] == '"' && buf[l-1] == '"' { + buf = buf[1 : l-1] + } + + *t = FrameID(buf) +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *FrameID) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} + +// Frame information about the Frame on the page. +type Frame struct { + ID FrameID `json:"id"` // Frame unique identifier. + ParentID FrameID `json:"parentId,omitempty"` // Parent frame identifier. + LoaderID LoaderID `json:"loaderId"` // Identifier of the loader associated with this frame. + Name string `json:"name,omitempty"` // Frame's name as specified in the tag. + URL string `json:"url"` // Frame document's URL. + SecurityOrigin string `json:"securityOrigin"` // Frame document's security origin. + MimeType string `json:"mimeType"` // Frame document's mimeType as determined by the browser. + UnreachableURL string `json:"unreachableUrl,omitempty"` // If the frame failed to load, this contains the URL that could not be loaded. + State FrameState `json:"-"` // Frame state. + Root *Node `json:"-"` // Frame document root. + Nodes map[NodeID]*Node `json:"-"` // Frame nodes. + sync.RWMutex `json:"-"` // Read write mutex. +} + +// FrameState is the state of a Frame. +type FrameState uint16 + +// FrameState enum values. +const ( + FrameDOMContentEventFired FrameState = 1 << (15 - iota) + FrameLoadEventFired + FrameAttached + FrameNavigated + FrameLoading + FrameScheduledNavigation +) + +// frameStateNames are the names of the frame states. +var frameStateNames = map[FrameState]string{ + FrameDOMContentEventFired: "DOMContentEventFired", + FrameLoadEventFired: "LoadEventFired", + FrameAttached: "Attached", + FrameNavigated: "Navigated", + FrameLoading: "Loading", + FrameScheduledNavigation: "ScheduledNavigation", +} + +// String satisfies stringer interface. +func (fs FrameState) String() string { + var s []string + for k, v := range frameStateNames { + if fs&k != 0 { + s = append(s, v) + } + } + return "[" + strings.Join(s, " ") + "]" +} + +// EmptyFrameID is the "non-existent" frame id. +const EmptyFrameID = FrameID("") diff --git a/cdp/cdputil/cdputil.go b/cdp/cdputil/cdputil.go index 3f8e542..be1ee38 100644 --- a/cdp/cdputil/cdputil.go +++ b/cdp/cdputil/cdputil.go @@ -52,590 +52,233 @@ var emptyVal = &empty{} func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { var v easyjson.Unmarshaler switch msg.Method { - case cdp.CommandInspectorEnable: - return emptyVal, nil - - case cdp.CommandInspectorDisable: - return emptyVal, nil - - case cdp.EventInspectorDetached: - v = new(inspector.EventDetached) - - case cdp.EventInspectorTargetCrashed: - v = new(inspector.EventTargetCrashed) - - case cdp.CommandMemoryGetDOMCounters: - v = new(memory.GetDOMCountersReturns) - - case cdp.CommandMemoryPrepareForLeakDetection: - return emptyVal, nil - - case cdp.CommandMemorySetPressureNotificationsSuppressed: - return emptyVal, nil - - case cdp.CommandMemorySimulatePressureNotification: - return emptyVal, nil - - case cdp.CommandPerformanceEnable: - return emptyVal, nil - - case cdp.CommandPerformanceDisable: - return emptyVal, nil - - case cdp.CommandPerformanceGetMetrics: - v = new(performance.GetMetricsReturns) - - case cdp.EventPerformanceMetrics: - v = new(performance.EventMetrics) - - case cdp.CommandPageEnable: - return emptyVal, nil - - case cdp.CommandPageDisable: - return emptyVal, nil - - case cdp.CommandPageAddScriptToEvaluateOnNewDocument: - v = new(page.AddScriptToEvaluateOnNewDocumentReturns) - - case cdp.CommandPageRemoveScriptToEvaluateOnNewDocument: - return emptyVal, nil - - case cdp.CommandPageSetAutoAttachToCreatedPages: - return emptyVal, nil - - case cdp.CommandPageSetLifecycleEventsEnabled: - return emptyVal, nil - - case cdp.CommandPageReload: - return emptyVal, nil - - case cdp.CommandPageSetAdBlockingEnabled: - return emptyVal, nil - - case cdp.CommandPageNavigate: - v = new(page.NavigateReturns) - - case cdp.CommandPageStopLoading: - return emptyVal, nil - - case cdp.CommandPageGetNavigationHistory: - v = new(page.GetNavigationHistoryReturns) - - case cdp.CommandPageNavigateToHistoryEntry: - return emptyVal, nil - - case cdp.CommandPageGetResourceTree: - v = new(page.GetResourceTreeReturns) - - case cdp.CommandPageGetFrameTree: - v = new(page.GetFrameTreeReturns) - - case cdp.CommandPageGetResourceContent: - v = new(page.GetResourceContentReturns) - - case cdp.CommandPageSearchInResource: - v = new(page.SearchInResourceReturns) - - case cdp.CommandPageSetDocumentContent: - return emptyVal, nil - - case cdp.CommandPageCaptureScreenshot: - v = new(page.CaptureScreenshotReturns) - - case cdp.CommandPagePrintToPDF: - v = new(page.PrintToPDFReturns) - - case cdp.CommandPageStartScreencast: - return emptyVal, nil - - case cdp.CommandPageStopScreencast: - return emptyVal, nil - - case cdp.CommandPageScreencastFrameAck: - return emptyVal, nil - - case cdp.CommandPageHandleJavaScriptDialog: - return emptyVal, nil - - case cdp.CommandPageGetAppManifest: - v = new(page.GetAppManifestReturns) - - case cdp.CommandPageRequestAppBanner: - return emptyVal, nil - - case cdp.CommandPageGetLayoutMetrics: - v = new(page.GetLayoutMetricsReturns) - - case cdp.CommandPageCreateIsolatedWorld: - v = new(page.CreateIsolatedWorldReturns) - - case cdp.CommandPageBringToFront: - return emptyVal, nil - - case cdp.CommandPageSetDownloadBehavior: - return emptyVal, nil - - case cdp.EventPageDomContentEventFired: - v = new(page.EventDomContentEventFired) - - case cdp.EventPageLoadEventFired: - v = new(page.EventLoadEventFired) - - case cdp.EventPageLifecycleEvent: - v = new(page.EventLifecycleEvent) - - case cdp.EventPageFrameAttached: - v = new(page.EventFrameAttached) - - case cdp.EventPageFrameNavigated: - v = new(page.EventFrameNavigated) - - case cdp.EventPageFrameDetached: - v = new(page.EventFrameDetached) - - case cdp.EventPageFrameStartedLoading: - v = new(page.EventFrameStartedLoading) - - case cdp.EventPageFrameStoppedLoading: - v = new(page.EventFrameStoppedLoading) - - case cdp.EventPageFrameScheduledNavigation: - v = new(page.EventFrameScheduledNavigation) - - case cdp.EventPageFrameClearedScheduledNavigation: - v = new(page.EventFrameClearedScheduledNavigation) - - case cdp.EventPageFrameResized: - v = new(page.EventFrameResized) - - case cdp.EventPageJavascriptDialogOpening: - v = new(page.EventJavascriptDialogOpening) - - case cdp.EventPageJavascriptDialogClosed: - v = new(page.EventJavascriptDialogClosed) - - case cdp.EventPageScreencastFrame: - v = new(page.EventScreencastFrame) - - case cdp.EventPageScreencastVisibilityChanged: - v = new(page.EventScreencastVisibilityChanged) - - case cdp.EventPageInterstitialShown: - v = new(page.EventInterstitialShown) - - case cdp.EventPageInterstitialHidden: - v = new(page.EventInterstitialHidden) - - case cdp.EventPageWindowOpen: - v = new(page.EventWindowOpen) - - case cdp.CommandOverlayEnable: - return emptyVal, nil - - case cdp.CommandOverlayDisable: - return emptyVal, nil - - case cdp.CommandOverlaySetShowPaintRects: - return emptyVal, nil - - case cdp.CommandOverlaySetShowDebugBorders: - return emptyVal, nil - - case cdp.CommandOverlaySetShowFPSCounter: - return emptyVal, nil - - case cdp.CommandOverlaySetShowScrollBottleneckRects: - return emptyVal, nil - - case cdp.CommandOverlaySetShowViewportSizeOnResize: - return emptyVal, nil - - case cdp.CommandOverlaySetPausedInDebuggerMessage: - return emptyVal, nil - - case cdp.CommandOverlaySetSuspended: - return emptyVal, nil - - case cdp.CommandOverlaySetInspectMode: - return emptyVal, nil - - case cdp.CommandOverlayHighlightRect: - return emptyVal, nil - - case cdp.CommandOverlayHighlightQuad: - return emptyVal, nil - - case cdp.CommandOverlayHighlightNode: - return emptyVal, nil - - case cdp.CommandOverlayHighlightFrame: - return emptyVal, nil - - case cdp.CommandOverlayHideHighlight: - return emptyVal, nil - - case cdp.CommandOverlayGetHighlightObjectForTest: - v = new(overlay.GetHighlightObjectForTestReturns) - - case cdp.EventOverlayNodeHighlightRequested: - v = new(overlay.EventNodeHighlightRequested) - - case cdp.EventOverlayInspectNodeRequested: - v = new(overlay.EventInspectNodeRequested) - - case cdp.EventOverlayScreenshotRequested: - v = new(overlay.EventScreenshotRequested) - - case cdp.CommandEmulationSetDeviceMetricsOverride: - return emptyVal, nil - - case cdp.CommandEmulationClearDeviceMetricsOverride: - return emptyVal, nil - - case cdp.CommandEmulationResetPageScaleFactor: - return emptyVal, nil - - case cdp.CommandEmulationSetPageScaleFactor: - return emptyVal, nil - - case cdp.CommandEmulationSetScriptExecutionDisabled: - return emptyVal, nil - - case cdp.CommandEmulationSetGeolocationOverride: - return emptyVal, nil - - case cdp.CommandEmulationClearGeolocationOverride: - return emptyVal, nil - - case cdp.CommandEmulationSetTouchEmulationEnabled: - return emptyVal, nil + case cdp.CommandAccessibilityGetPartialAXTree: + v = new(accessibility.GetPartialAXTreeReturns) - case cdp.CommandEmulationSetEmitTouchEventsForMouse: + case cdp.CommandAnimationDisable: return emptyVal, nil - case cdp.CommandEmulationSetEmulatedMedia: + case cdp.CommandAnimationEnable: return emptyVal, nil - case cdp.CommandEmulationSetCPUThrottlingRate: - return emptyVal, nil - - case cdp.CommandEmulationCanEmulate: - v = new(emulation.CanEmulateReturns) + case cdp.CommandAnimationGetCurrentTime: + v = new(animation.GetCurrentTimeReturns) - case cdp.CommandEmulationSetVirtualTimePolicy: - v = new(emulation.SetVirtualTimePolicyReturns) - - case cdp.CommandEmulationSetNavigatorOverrides: - return emptyVal, nil + case cdp.CommandAnimationGetPlaybackRate: + v = new(animation.GetPlaybackRateReturns) - case cdp.CommandEmulationSetDefaultBackgroundColorOverride: + case cdp.CommandAnimationReleaseAnimations: return emptyVal, nil - case cdp.EventEmulationVirtualTimeBudgetExpired: - v = new(emulation.EventVirtualTimeBudgetExpired) - - case cdp.EventEmulationVirtualTimeAdvanced: - v = new(emulation.EventVirtualTimeAdvanced) - - case cdp.EventEmulationVirtualTimePaused: - v = new(emulation.EventVirtualTimePaused) - - case cdp.CommandSecurityEnable: - return emptyVal, nil + case cdp.CommandAnimationResolveAnimation: + v = new(animation.ResolveAnimationReturns) - case cdp.CommandSecurityDisable: + case cdp.CommandAnimationSeekAnimations: return emptyVal, nil - case cdp.CommandSecurityHandleCertificateError: - return emptyVal, nil - - case cdp.CommandSecuritySetOverrideCertificateErrors: - return emptyVal, nil - - case cdp.EventSecuritySecurityStateChanged: - v = new(security.EventSecurityStateChanged) - - case cdp.EventSecurityCertificateError: - v = new(security.EventCertificateError) - - case cdp.CommandAuditsGetEncodedResponse: - v = new(audits.GetEncodedResponseReturns) - - case cdp.CommandNetworkEnable: + case cdp.CommandAnimationSetPaused: return emptyVal, nil - case cdp.CommandNetworkDisable: + case cdp.CommandAnimationSetPlaybackRate: return emptyVal, nil - case cdp.CommandNetworkSetUserAgentOverride: + case cdp.CommandAnimationSetTiming: return emptyVal, nil - case cdp.CommandNetworkSearchInResponseBody: - v = new(network.SearchInResponseBodyReturns) - - case cdp.CommandNetworkSetExtraHTTPHeaders: - return emptyVal, nil - - case cdp.CommandNetworkGetResponseBody: - v = new(network.GetResponseBodyReturns) - - case cdp.CommandNetworkSetBlockedURLS: - return emptyVal, nil - - case cdp.CommandNetworkReplayXHR: - return emptyVal, nil - - case cdp.CommandNetworkClearBrowserCache: - return emptyVal, nil - - case cdp.CommandNetworkClearBrowserCookies: - return emptyVal, nil - - case cdp.CommandNetworkGetCookies: - v = new(network.GetCookiesReturns) - - case cdp.CommandNetworkGetAllCookies: - v = new(network.GetAllCookiesReturns) - - case cdp.CommandNetworkDeleteCookies: - return emptyVal, nil - - case cdp.CommandNetworkSetCookie: - v = new(network.SetCookieReturns) - - case cdp.CommandNetworkSetCookies: - return emptyVal, nil - - case cdp.CommandNetworkEmulateNetworkConditions: - return emptyVal, nil - - case cdp.CommandNetworkSetCacheDisabled: - return emptyVal, nil - - case cdp.CommandNetworkSetBypassServiceWorker: - return emptyVal, nil - - case cdp.CommandNetworkSetDataSizeLimitsForTest: - return emptyVal, nil - - case cdp.CommandNetworkGetCertificate: - v = new(network.GetCertificateReturns) - - case cdp.CommandNetworkSetRequestInterception: - return emptyVal, nil - - case cdp.CommandNetworkContinueInterceptedRequest: - return emptyVal, nil - - case cdp.CommandNetworkGetResponseBodyForInterception: - v = new(network.GetResponseBodyForInterceptionReturns) - - case cdp.EventNetworkResourceChangedPriority: - v = new(network.EventResourceChangedPriority) - - case cdp.EventNetworkRequestWillBeSent: - v = new(network.EventRequestWillBeSent) - - case cdp.EventNetworkRequestServedFromCache: - v = new(network.EventRequestServedFromCache) - - case cdp.EventNetworkResponseReceived: - v = new(network.EventResponseReceived) - - case cdp.EventNetworkDataReceived: - v = new(network.EventDataReceived) - - case cdp.EventNetworkLoadingFinished: - v = new(network.EventLoadingFinished) - - case cdp.EventNetworkLoadingFailed: - v = new(network.EventLoadingFailed) - - case cdp.EventNetworkWebSocketWillSendHandshakeRequest: - v = new(network.EventWebSocketWillSendHandshakeRequest) - - case cdp.EventNetworkWebSocketHandshakeResponseReceived: - v = new(network.EventWebSocketHandshakeResponseReceived) - - case cdp.EventNetworkWebSocketCreated: - v = new(network.EventWebSocketCreated) - - case cdp.EventNetworkWebSocketClosed: - v = new(network.EventWebSocketClosed) - - case cdp.EventNetworkWebSocketFrameReceived: - v = new(network.EventWebSocketFrameReceived) - - case cdp.EventNetworkWebSocketFrameError: - v = new(network.EventWebSocketFrameError) - - case cdp.EventNetworkWebSocketFrameSent: - v = new(network.EventWebSocketFrameSent) - - case cdp.EventNetworkEventSourceMessageReceived: - v = new(network.EventEventSourceMessageReceived) - - case cdp.EventNetworkRequestIntercepted: - v = new(network.EventRequestIntercepted) - - case cdp.CommandDatabaseEnable: - return emptyVal, nil - - case cdp.CommandDatabaseDisable: - return emptyVal, nil - - case cdp.CommandDatabaseGetDatabaseTableNames: - v = new(database.GetDatabaseTableNamesReturns) - - case cdp.CommandDatabaseExecuteSQL: - v = new(database.ExecuteSQLReturns) - - case cdp.EventDatabaseAddDatabase: - v = new(database.EventAddDatabase) - - case cdp.CommandIndexedDBEnable: - return emptyVal, nil - - case cdp.CommandIndexedDBDisable: - return emptyVal, nil - - case cdp.CommandIndexedDBRequestDatabaseNames: - v = new(indexeddb.RequestDatabaseNamesReturns) - - case cdp.CommandIndexedDBRequestDatabase: - v = new(indexeddb.RequestDatabaseReturns) - - case cdp.CommandIndexedDBRequestData: - v = new(indexeddb.RequestDataReturns) - - case cdp.CommandIndexedDBClearObjectStore: - return emptyVal, nil - - case cdp.CommandIndexedDBDeleteDatabase: - return emptyVal, nil - - case cdp.CommandCacheStorageRequestCacheNames: - v = new(cachestorage.RequestCacheNamesReturns) - - case cdp.CommandCacheStorageRequestEntries: - v = new(cachestorage.RequestEntriesReturns) - - case cdp.CommandCacheStorageDeleteCache: - return emptyVal, nil - - case cdp.CommandCacheStorageDeleteEntry: - return emptyVal, nil - - case cdp.CommandCacheStorageRequestCachedResponse: - v = new(cachestorage.RequestCachedResponseReturns) - - case cdp.CommandDOMStorageEnable: - return emptyVal, nil - - case cdp.CommandDOMStorageDisable: - return emptyVal, nil - - case cdp.CommandDOMStorageClear: - return emptyVal, nil - - case cdp.CommandDOMStorageGetDOMStorageItems: - v = new(domstorage.GetDOMStorageItemsReturns) - - case cdp.CommandDOMStorageSetDOMStorageItem: - return emptyVal, nil - - case cdp.CommandDOMStorageRemoveDOMStorageItem: - return emptyVal, nil - - case cdp.EventDOMStorageDomStorageItemsCleared: - v = new(domstorage.EventDomStorageItemsCleared) - - case cdp.EventDOMStorageDomStorageItemRemoved: - v = new(domstorage.EventDomStorageItemRemoved) - - case cdp.EventDOMStorageDomStorageItemAdded: - v = new(domstorage.EventDomStorageItemAdded) + case cdp.EventAnimationAnimationCanceled: + v = new(animation.EventAnimationCanceled) - case cdp.EventDOMStorageDomStorageItemUpdated: - v = new(domstorage.EventDomStorageItemUpdated) + case cdp.EventAnimationAnimationCreated: + v = new(animation.EventAnimationCreated) - case cdp.CommandApplicationCacheGetFramesWithManifests: - v = new(applicationcache.GetFramesWithManifestsReturns) + case cdp.EventAnimationAnimationStarted: + v = new(animation.EventAnimationStarted) case cdp.CommandApplicationCacheEnable: return emptyVal, nil - case cdp.CommandApplicationCacheGetManifestForFrame: - v = new(applicationcache.GetManifestForFrameReturns) - case cdp.CommandApplicationCacheGetApplicationCacheForFrame: v = new(applicationcache.GetApplicationCacheForFrameReturns) + case cdp.CommandApplicationCacheGetFramesWithManifests: + v = new(applicationcache.GetFramesWithManifestsReturns) + + case cdp.CommandApplicationCacheGetManifestForFrame: + v = new(applicationcache.GetManifestForFrameReturns) + case cdp.EventApplicationCacheApplicationCacheStatusUpdated: v = new(applicationcache.EventApplicationCacheStatusUpdated) case cdp.EventApplicationCacheNetworkStateUpdated: v = new(applicationcache.EventNetworkStateUpdated) - case cdp.CommandDOMEnable: + case cdp.CommandAuditsGetEncodedResponse: + v = new(audits.GetEncodedResponseReturns) + + case cdp.CommandBrowserClose: return emptyVal, nil + case cdp.CommandBrowserGetVersion: + v = new(browser.GetVersionReturns) + + case cdp.CommandBrowserGetWindowBounds: + v = new(browser.GetWindowBoundsReturns) + + case cdp.CommandBrowserGetWindowForTarget: + v = new(browser.GetWindowForTargetReturns) + + case cdp.CommandBrowserSetWindowBounds: + return emptyVal, nil + + case cdp.CommandCSSAddRule: + v = new(css.AddRuleReturns) + + case cdp.CommandCSSCollectClassNames: + v = new(css.CollectClassNamesReturns) + + case cdp.CommandCSSCreateStyleSheet: + v = new(css.CreateStyleSheetReturns) + + case cdp.CommandCSSDisable: + return emptyVal, nil + + case cdp.CommandCSSEnable: + return emptyVal, nil + + case cdp.CommandCSSForcePseudoState: + return emptyVal, nil + + case cdp.CommandCSSGetBackgroundColors: + v = new(css.GetBackgroundColorsReturns) + + case cdp.CommandCSSGetComputedStyleForNode: + v = new(css.GetComputedStyleForNodeReturns) + + case cdp.CommandCSSGetInlineStylesForNode: + v = new(css.GetInlineStylesForNodeReturns) + + case cdp.CommandCSSGetMatchedStylesForNode: + v = new(css.GetMatchedStylesForNodeReturns) + + case cdp.CommandCSSGetMediaQueries: + v = new(css.GetMediaQueriesReturns) + + case cdp.CommandCSSGetPlatformFontsForNode: + v = new(css.GetPlatformFontsForNodeReturns) + + case cdp.CommandCSSGetStyleSheetText: + v = new(css.GetStyleSheetTextReturns) + + case cdp.CommandCSSSetEffectivePropertyValueForNode: + return emptyVal, nil + + case cdp.CommandCSSSetKeyframeKey: + v = new(css.SetKeyframeKeyReturns) + + case cdp.CommandCSSSetMediaText: + v = new(css.SetMediaTextReturns) + + case cdp.CommandCSSSetRuleSelector: + v = new(css.SetRuleSelectorReturns) + + case cdp.CommandCSSSetStyleSheetText: + v = new(css.SetStyleSheetTextReturns) + + case cdp.CommandCSSSetStyleTexts: + v = new(css.SetStyleTextsReturns) + + case cdp.CommandCSSStartRuleUsageTracking: + return emptyVal, nil + + case cdp.CommandCSSStopRuleUsageTracking: + v = new(css.StopRuleUsageTrackingReturns) + + case cdp.CommandCSSTakeCoverageDelta: + v = new(css.TakeCoverageDeltaReturns) + + case cdp.EventCSSFontsUpdated: + v = new(css.EventFontsUpdated) + + case cdp.EventCSSMediaQueryResultChanged: + v = new(css.EventMediaQueryResultChanged) + + case cdp.EventCSSStyleSheetAdded: + v = new(css.EventStyleSheetAdded) + + case cdp.EventCSSStyleSheetChanged: + v = new(css.EventStyleSheetChanged) + + case cdp.EventCSSStyleSheetRemoved: + v = new(css.EventStyleSheetRemoved) + + case cdp.CommandCacheStorageDeleteCache: + return emptyVal, nil + + case cdp.CommandCacheStorageDeleteEntry: + return emptyVal, nil + + case cdp.CommandCacheStorageRequestCacheNames: + v = new(cachestorage.RequestCacheNamesReturns) + + case cdp.CommandCacheStorageRequestCachedResponse: + v = new(cachestorage.RequestCachedResponseReturns) + + case cdp.CommandCacheStorageRequestEntries: + v = new(cachestorage.RequestEntriesReturns) + + case cdp.CommandDOMCollectClassNamesFromSubtree: + v = new(dom.CollectClassNamesFromSubtreeReturns) + + case cdp.CommandDOMCopyTo: + v = new(dom.CopyToReturns) + + case cdp.CommandDOMDescribeNode: + v = new(dom.DescribeNodeReturns) + case cdp.CommandDOMDisable: return emptyVal, nil + case cdp.CommandDOMDiscardSearchResults: + return emptyVal, nil + + case cdp.CommandDOMEnable: + return emptyVal, nil + + case cdp.CommandDOMFocus: + return emptyVal, nil + + case cdp.CommandDOMGetAttributes: + v = new(dom.GetAttributesReturns) + + case cdp.CommandDOMGetBoxModel: + v = new(dom.GetBoxModelReturns) + case cdp.CommandDOMGetDocument: v = new(dom.GetDocumentReturns) case cdp.CommandDOMGetFlattenedDocument: v = new(dom.GetFlattenedDocumentReturns) - case cdp.CommandDOMCollectClassNamesFromSubtree: - v = new(dom.CollectClassNamesFromSubtreeReturns) - - case cdp.CommandDOMRequestChildNodes: - return emptyVal, nil - - case cdp.CommandDOMQuerySelector: - v = new(dom.QuerySelectorReturns) - - case cdp.CommandDOMQuerySelectorAll: - v = new(dom.QuerySelectorAllReturns) - - case cdp.CommandDOMSetNodeName: - v = new(dom.SetNodeNameReturns) - - case cdp.CommandDOMSetNodeValue: - return emptyVal, nil - - case cdp.CommandDOMRemoveNode: - return emptyVal, nil - - case cdp.CommandDOMSetAttributeValue: - return emptyVal, nil - - case cdp.CommandDOMSetAttributesAsText: - return emptyVal, nil - - case cdp.CommandDOMRemoveAttribute: - return emptyVal, nil + case cdp.CommandDOMGetNodeForLocation: + v = new(dom.GetNodeForLocationReturns) case cdp.CommandDOMGetOuterHTML: v = new(dom.GetOuterHTMLReturns) - case cdp.CommandDOMSetOuterHTML: - return emptyVal, nil - - case cdp.CommandDOMPerformSearch: - v = new(dom.PerformSearchReturns) + case cdp.CommandDOMGetRelayoutBoundary: + v = new(dom.GetRelayoutBoundaryReturns) case cdp.CommandDOMGetSearchResults: v = new(dom.GetSearchResultsReturns) - case cdp.CommandDOMDiscardSearchResults: + case cdp.CommandDOMMarkUndoableState: return emptyVal, nil - case cdp.CommandDOMRequestNode: - v = new(dom.RequestNodeReturns) + case cdp.CommandDOMMoveTo: + v = new(dom.MoveToReturns) + + case cdp.CommandDOMPerformSearch: + v = new(dom.PerformSearchReturns) case cdp.CommandDOMPushNodeByPathToFrontend: v = new(dom.PushNodeByPathToFrontendReturns) @@ -643,53 +286,53 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.CommandDOMPushNodesByBackendIdsToFrontend: v = new(dom.PushNodesByBackendIdsToFrontendReturns) - case cdp.CommandDOMSetInspectedNode: - return emptyVal, nil + case cdp.CommandDOMQuerySelector: + v = new(dom.QuerySelectorReturns) - case cdp.CommandDOMResolveNode: - v = new(dom.ResolveNodeReturns) - - case cdp.CommandDOMGetAttributes: - v = new(dom.GetAttributesReturns) - - case cdp.CommandDOMCopyTo: - v = new(dom.CopyToReturns) - - case cdp.CommandDOMMoveTo: - v = new(dom.MoveToReturns) - - case cdp.CommandDOMUndo: - return emptyVal, nil + case cdp.CommandDOMQuerySelectorAll: + v = new(dom.QuerySelectorAllReturns) case cdp.CommandDOMRedo: return emptyVal, nil - case cdp.CommandDOMMarkUndoableState: + case cdp.CommandDOMRemoveAttribute: return emptyVal, nil - case cdp.CommandDOMFocus: + case cdp.CommandDOMRemoveNode: + return emptyVal, nil + + case cdp.CommandDOMRequestChildNodes: + return emptyVal, nil + + case cdp.CommandDOMRequestNode: + v = new(dom.RequestNodeReturns) + + case cdp.CommandDOMResolveNode: + v = new(dom.ResolveNodeReturns) + + case cdp.CommandDOMSetAttributeValue: + return emptyVal, nil + + case cdp.CommandDOMSetAttributesAsText: return emptyVal, nil case cdp.CommandDOMSetFileInputFiles: return emptyVal, nil - case cdp.CommandDOMGetBoxModel: - v = new(dom.GetBoxModelReturns) + case cdp.CommandDOMSetInspectedNode: + return emptyVal, nil - case cdp.CommandDOMGetNodeForLocation: - v = new(dom.GetNodeForLocationReturns) + case cdp.CommandDOMSetNodeName: + v = new(dom.SetNodeNameReturns) - case cdp.CommandDOMGetRelayoutBoundary: - v = new(dom.GetRelayoutBoundaryReturns) + case cdp.CommandDOMSetNodeValue: + return emptyVal, nil - case cdp.CommandDOMDescribeNode: - v = new(dom.DescribeNodeReturns) + case cdp.CommandDOMSetOuterHTML: + return emptyVal, nil - case cdp.EventDOMDocumentUpdated: - v = new(dom.EventDocumentUpdated) - - case cdp.EventDOMSetChildNodes: - v = new(dom.EventSetChildNodes) + case cdp.CommandDOMUndo: + return emptyVal, nil case cdp.EventDOMAttributeModified: v = new(dom.EventAttributeModified) @@ -697,9 +340,6 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.EventDOMAttributeRemoved: v = new(dom.EventAttributeRemoved) - case cdp.EventDOMInlineStyleInvalidated: - v = new(dom.EventInlineStyleInvalidated) - case cdp.EventDOMCharacterDataModified: v = new(dom.EventCharacterDataModified) @@ -712,11 +352,14 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.EventDOMChildNodeRemoved: v = new(dom.EventChildNodeRemoved) - case cdp.EventDOMShadowRootPushed: - v = new(dom.EventShadowRootPushed) + case cdp.EventDOMDistributedNodesUpdated: + v = new(dom.EventDistributedNodesUpdated) - case cdp.EventDOMShadowRootPopped: - v = new(dom.EventShadowRootPopped) + case cdp.EventDOMDocumentUpdated: + v = new(dom.EventDocumentUpdated) + + case cdp.EventDOMInlineStyleInvalidated: + v = new(dom.EventInlineStyleInvalidated) case cdp.EventDOMPseudoElementAdded: v = new(dom.EventPseudoElementAdded) @@ -724,251 +367,197 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.EventDOMPseudoElementRemoved: v = new(dom.EventPseudoElementRemoved) - case cdp.EventDOMDistributedNodesUpdated: - v = new(dom.EventDistributedNodesUpdated) + case cdp.EventDOMSetChildNodes: + v = new(dom.EventSetChildNodes) - case cdp.CommandCSSEnable: - return emptyVal, nil + case cdp.EventDOMShadowRootPopped: + v = new(dom.EventShadowRootPopped) - case cdp.CommandCSSDisable: - return emptyVal, nil + case cdp.EventDOMShadowRootPushed: + v = new(dom.EventShadowRootPushed) - case cdp.CommandCSSGetMatchedStylesForNode: - v = new(css.GetMatchedStylesForNodeReturns) - - case cdp.CommandCSSGetInlineStylesForNode: - v = new(css.GetInlineStylesForNodeReturns) - - case cdp.CommandCSSGetComputedStyleForNode: - v = new(css.GetComputedStyleForNodeReturns) - - case cdp.CommandCSSGetPlatformFontsForNode: - v = new(css.GetPlatformFontsForNodeReturns) - - case cdp.CommandCSSGetStyleSheetText: - v = new(css.GetStyleSheetTextReturns) - - case cdp.CommandCSSCollectClassNames: - v = new(css.CollectClassNamesReturns) - - case cdp.CommandCSSSetStyleSheetText: - v = new(css.SetStyleSheetTextReturns) - - case cdp.CommandCSSSetRuleSelector: - v = new(css.SetRuleSelectorReturns) - - case cdp.CommandCSSSetKeyframeKey: - v = new(css.SetKeyframeKeyReturns) - - case cdp.CommandCSSSetStyleTexts: - v = new(css.SetStyleTextsReturns) - - case cdp.CommandCSSSetMediaText: - v = new(css.SetMediaTextReturns) - - case cdp.CommandCSSCreateStyleSheet: - v = new(css.CreateStyleSheetReturns) - - case cdp.CommandCSSAddRule: - v = new(css.AddRuleReturns) - - case cdp.CommandCSSForcePseudoState: - return emptyVal, nil - - case cdp.CommandCSSGetMediaQueries: - v = new(css.GetMediaQueriesReturns) - - case cdp.CommandCSSSetEffectivePropertyValueForNode: - return emptyVal, nil - - case cdp.CommandCSSGetBackgroundColors: - v = new(css.GetBackgroundColorsReturns) - - case cdp.CommandCSSStartRuleUsageTracking: - return emptyVal, nil - - case cdp.CommandCSSTakeCoverageDelta: - v = new(css.TakeCoverageDeltaReturns) - - case cdp.CommandCSSStopRuleUsageTracking: - v = new(css.StopRuleUsageTrackingReturns) - - case cdp.EventCSSMediaQueryResultChanged: - v = new(css.EventMediaQueryResultChanged) - - case cdp.EventCSSFontsUpdated: - v = new(css.EventFontsUpdated) - - case cdp.EventCSSStyleSheetChanged: - v = new(css.EventStyleSheetChanged) - - case cdp.EventCSSStyleSheetAdded: - v = new(css.EventStyleSheetAdded) - - case cdp.EventCSSStyleSheetRemoved: - v = new(css.EventStyleSheetRemoved) - - case cdp.CommandDOMSnapshotGetSnapshot: - v = new(domsnapshot.GetSnapshotReturns) - - case cdp.CommandIORead: - v = new(iodom.ReadReturns) - - case cdp.CommandIOClose: - return emptyVal, nil - - case cdp.CommandIOResolveBlob: - v = new(iodom.ResolveBlobReturns) - - case cdp.CommandDOMDebuggerSetDOMBreakpoint: - return emptyVal, nil + case cdp.CommandDOMDebuggerGetEventListeners: + v = new(domdebugger.GetEventListenersReturns) case cdp.CommandDOMDebuggerRemoveDOMBreakpoint: return emptyVal, nil - case cdp.CommandDOMDebuggerSetEventListenerBreakpoint: - return emptyVal, nil - case cdp.CommandDOMDebuggerRemoveEventListenerBreakpoint: return emptyVal, nil - case cdp.CommandDOMDebuggerSetInstrumentationBreakpoint: - return emptyVal, nil - case cdp.CommandDOMDebuggerRemoveInstrumentationBreakpoint: return emptyVal, nil - case cdp.CommandDOMDebuggerSetXHRBreakpoint: - return emptyVal, nil - case cdp.CommandDOMDebuggerRemoveXHRBreakpoint: return emptyVal, nil - case cdp.CommandDOMDebuggerGetEventListeners: - v = new(domdebugger.GetEventListenersReturns) - - case cdp.CommandTargetSetDiscoverTargets: + case cdp.CommandDOMDebuggerSetDOMBreakpoint: return emptyVal, nil - case cdp.CommandTargetSetAutoAttach: + case cdp.CommandDOMDebuggerSetEventListenerBreakpoint: return emptyVal, nil - case cdp.CommandTargetSetAttachToFrames: + case cdp.CommandDOMDebuggerSetInstrumentationBreakpoint: return emptyVal, nil - case cdp.CommandTargetSetRemoteLocations: + case cdp.CommandDOMDebuggerSetXHRBreakpoint: return emptyVal, nil - case cdp.CommandTargetSendMessageToTarget: + case cdp.CommandDOMSnapshotGetSnapshot: + v = new(domsnapshot.GetSnapshotReturns) + + case cdp.CommandDOMStorageClear: return emptyVal, nil - case cdp.CommandTargetGetTargetInfo: - v = new(target.GetTargetInfoReturns) - - case cdp.CommandTargetActivateTarget: + case cdp.CommandDOMStorageDisable: return emptyVal, nil - case cdp.CommandTargetCloseTarget: - v = new(target.CloseTargetReturns) - - case cdp.CommandTargetAttachToTarget: - v = new(target.AttachToTargetReturns) - - case cdp.CommandTargetDetachFromTarget: + case cdp.CommandDOMStorageEnable: return emptyVal, nil - case cdp.CommandTargetCreateBrowserContext: - v = new(target.CreateBrowserContextReturns) + case cdp.CommandDOMStorageGetDOMStorageItems: + v = new(domstorage.GetDOMStorageItemsReturns) - case cdp.CommandTargetDisposeBrowserContext: - v = new(target.DisposeBrowserContextReturns) - - case cdp.CommandTargetCreateTarget: - v = new(target.CreateTargetReturns) - - case cdp.CommandTargetGetTargets: - v = new(target.GetTargetsReturns) - - case cdp.EventTargetTargetCreated: - v = new(target.EventTargetCreated) - - case cdp.EventTargetTargetInfoChanged: - v = new(target.EventTargetInfoChanged) - - case cdp.EventTargetTargetDestroyed: - v = new(target.EventTargetDestroyed) - - case cdp.EventTargetAttachedToTarget: - v = new(target.EventAttachedToTarget) - - case cdp.EventTargetDetachedFromTarget: - v = new(target.EventDetachedFromTarget) - - case cdp.EventTargetReceivedMessageFromTarget: - v = new(target.EventReceivedMessageFromTarget) - - case cdp.CommandHeadlessExperimentalEnable: + case cdp.CommandDOMStorageRemoveDOMStorageItem: return emptyVal, nil - case cdp.CommandHeadlessExperimentalDisable: + case cdp.CommandDOMStorageSetDOMStorageItem: return emptyVal, nil + case cdp.EventDOMStorageDomStorageItemAdded: + v = new(domstorage.EventDomStorageItemAdded) + + case cdp.EventDOMStorageDomStorageItemRemoved: + v = new(domstorage.EventDomStorageItemRemoved) + + case cdp.EventDOMStorageDomStorageItemUpdated: + v = new(domstorage.EventDomStorageItemUpdated) + + case cdp.EventDOMStorageDomStorageItemsCleared: + v = new(domstorage.EventDomStorageItemsCleared) + + case cdp.CommandDatabaseDisable: + return emptyVal, nil + + case cdp.CommandDatabaseEnable: + return emptyVal, nil + + case cdp.CommandDatabaseExecuteSQL: + v = new(database.ExecuteSQLReturns) + + case cdp.CommandDatabaseGetDatabaseTableNames: + v = new(database.GetDatabaseTableNamesReturns) + + case cdp.EventDatabaseAddDatabase: + v = new(database.EventAddDatabase) + + case cdp.CommandDeviceOrientationClearDeviceOrientationOverride: + return emptyVal, nil + + case cdp.CommandDeviceOrientationSetDeviceOrientationOverride: + return emptyVal, nil + + case cdp.CommandEmulationCanEmulate: + v = new(emulation.CanEmulateReturns) + + case cdp.CommandEmulationClearDeviceMetricsOverride: + return emptyVal, nil + + case cdp.CommandEmulationClearGeolocationOverride: + return emptyVal, nil + + case cdp.CommandEmulationResetPageScaleFactor: + return emptyVal, nil + + case cdp.CommandEmulationSetCPUThrottlingRate: + return emptyVal, nil + + case cdp.CommandEmulationSetDefaultBackgroundColorOverride: + return emptyVal, nil + + case cdp.CommandEmulationSetDeviceMetricsOverride: + return emptyVal, nil + + case cdp.CommandEmulationSetEmitTouchEventsForMouse: + return emptyVal, nil + + case cdp.CommandEmulationSetEmulatedMedia: + return emptyVal, nil + + case cdp.CommandEmulationSetGeolocationOverride: + return emptyVal, nil + + case cdp.CommandEmulationSetNavigatorOverrides: + return emptyVal, nil + + case cdp.CommandEmulationSetPageScaleFactor: + return emptyVal, nil + + case cdp.CommandEmulationSetScriptExecutionDisabled: + return emptyVal, nil + + case cdp.CommandEmulationSetTouchEmulationEnabled: + return emptyVal, nil + + case cdp.CommandEmulationSetVirtualTimePolicy: + v = new(emulation.SetVirtualTimePolicyReturns) + + case cdp.EventEmulationVirtualTimeAdvanced: + v = new(emulation.EventVirtualTimeAdvanced) + + case cdp.EventEmulationVirtualTimeBudgetExpired: + v = new(emulation.EventVirtualTimeBudgetExpired) + + case cdp.EventEmulationVirtualTimePaused: + v = new(emulation.EventVirtualTimePaused) + case cdp.CommandHeadlessExperimentalBeginFrame: v = new(headlessexperimental.BeginFrameReturns) - case cdp.EventHeadlessExperimentalNeedsBeginFramesChanged: - v = new(headlessexperimental.EventNeedsBeginFramesChanged) + case cdp.CommandHeadlessExperimentalDisable: + return emptyVal, nil + + case cdp.CommandHeadlessExperimentalEnable: + return emptyVal, nil case cdp.EventHeadlessExperimentalMainFrameReadyForScreenshots: v = new(headlessexperimental.EventMainFrameReadyForScreenshots) - case cdp.CommandServiceWorkerEnable: + case cdp.EventHeadlessExperimentalNeedsBeginFramesChanged: + v = new(headlessexperimental.EventNeedsBeginFramesChanged) + + case cdp.CommandIOClose: return emptyVal, nil - case cdp.CommandServiceWorkerDisable: + case cdp.CommandIORead: + v = new(iodom.ReadReturns) + + case cdp.CommandIOResolveBlob: + v = new(iodom.ResolveBlobReturns) + + case cdp.CommandIndexedDBClearObjectStore: return emptyVal, nil - case cdp.CommandServiceWorkerUnregister: + case cdp.CommandIndexedDBDeleteDatabase: return emptyVal, nil - case cdp.CommandServiceWorkerUpdateRegistration: + case cdp.CommandIndexedDBDeleteObjectStoreEntries: return emptyVal, nil - case cdp.CommandServiceWorkerStartWorker: + case cdp.CommandIndexedDBDisable: return emptyVal, nil - case cdp.CommandServiceWorkerSkipWaiting: + case cdp.CommandIndexedDBEnable: return emptyVal, nil - case cdp.CommandServiceWorkerStopWorker: - return emptyVal, nil + case cdp.CommandIndexedDBRequestData: + v = new(indexeddb.RequestDataReturns) - case cdp.CommandServiceWorkerStopAllWorkers: - return emptyVal, nil + case cdp.CommandIndexedDBRequestDatabase: + v = new(indexeddb.RequestDatabaseReturns) - case cdp.CommandServiceWorkerInspectWorker: - return emptyVal, nil - - case cdp.CommandServiceWorkerSetForceUpdateOnPageLoad: - return emptyVal, nil - - case cdp.CommandServiceWorkerDeliverPushMessage: - return emptyVal, nil - - case cdp.CommandServiceWorkerDispatchSyncEvent: - return emptyVal, nil - - case cdp.EventServiceWorkerWorkerRegistrationUpdated: - v = new(serviceworker.EventWorkerRegistrationUpdated) - - case cdp.EventServiceWorkerWorkerVersionUpdated: - v = new(serviceworker.EventWorkerVersionUpdated) - - case cdp.EventServiceWorkerWorkerErrorReported: - v = new(serviceworker.EventWorkerErrorReported) - - case cdp.CommandInputSetIgnoreInputEvents: - return emptyVal, nil + case cdp.CommandIndexedDBRequestDatabaseNames: + v = new(indexeddb.RequestDatabaseNamesReturns) case cdp.CommandInputDispatchKeyEvent: return emptyVal, nil @@ -982,6 +571,9 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.CommandInputEmulateTouchFromMouseEvent: return emptyVal, nil + case cdp.CommandInputSetIgnoreInputEvents: + return emptyVal, nil + case cdp.CommandInputSynthesizePinchGesture: return emptyVal, nil @@ -991,148 +583,58 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.CommandInputSynthesizeTapGesture: return emptyVal, nil - case cdp.CommandLayerTreeEnable: + case cdp.CommandInspectorDisable: return emptyVal, nil - case cdp.CommandLayerTreeDisable: + case cdp.CommandInspectorEnable: return emptyVal, nil + case cdp.EventInspectorDetached: + v = new(inspector.EventDetached) + + case cdp.EventInspectorTargetCrashed: + v = new(inspector.EventTargetCrashed) + case cdp.CommandLayerTreeCompositingReasons: v = new(layertree.CompositingReasonsReturns) - case cdp.CommandLayerTreeMakeSnapshot: - v = new(layertree.MakeSnapshotReturns) + case cdp.CommandLayerTreeDisable: + return emptyVal, nil + + case cdp.CommandLayerTreeEnable: + return emptyVal, nil case cdp.CommandLayerTreeLoadSnapshot: v = new(layertree.LoadSnapshotReturns) - case cdp.CommandLayerTreeReleaseSnapshot: - return emptyVal, nil + case cdp.CommandLayerTreeMakeSnapshot: + v = new(layertree.MakeSnapshotReturns) case cdp.CommandLayerTreeProfileSnapshot: v = new(layertree.ProfileSnapshotReturns) + case cdp.CommandLayerTreeReleaseSnapshot: + return emptyVal, nil + case cdp.CommandLayerTreeReplaySnapshot: v = new(layertree.ReplaySnapshotReturns) case cdp.CommandLayerTreeSnapshotCommandLog: v = new(layertree.SnapshotCommandLogReturns) - case cdp.EventLayerTreeLayerTreeDidChange: - v = new(layertree.EventLayerTreeDidChange) - case cdp.EventLayerTreeLayerPainted: v = new(layertree.EventLayerPainted) - case cdp.CommandDeviceOrientationSetDeviceOrientationOverride: - return emptyVal, nil + case cdp.EventLayerTreeLayerTreeDidChange: + v = new(layertree.EventLayerTreeDidChange) - case cdp.CommandDeviceOrientationClearDeviceOrientationOverride: - return emptyVal, nil - - case cdp.CommandTracingStart: - return emptyVal, nil - - case cdp.CommandTracingEnd: - return emptyVal, nil - - case cdp.CommandTracingGetCategories: - v = new(tracing.GetCategoriesReturns) - - case cdp.CommandTracingRequestMemoryDump: - v = new(tracing.RequestMemoryDumpReturns) - - case cdp.CommandTracingRecordClockSyncMarker: - return emptyVal, nil - - case cdp.EventTracingDataCollected: - v = new(tracing.EventDataCollected) - - case cdp.EventTracingTracingComplete: - v = new(tracing.EventTracingComplete) - - case cdp.EventTracingBufferUsage: - v = new(tracing.EventBufferUsage) - - case cdp.CommandAnimationEnable: - return emptyVal, nil - - case cdp.CommandAnimationDisable: - return emptyVal, nil - - case cdp.CommandAnimationGetPlaybackRate: - v = new(animation.GetPlaybackRateReturns) - - case cdp.CommandAnimationSetPlaybackRate: - return emptyVal, nil - - case cdp.CommandAnimationGetCurrentTime: - v = new(animation.GetCurrentTimeReturns) - - case cdp.CommandAnimationSetPaused: - return emptyVal, nil - - case cdp.CommandAnimationSetTiming: - return emptyVal, nil - - case cdp.CommandAnimationSeekAnimations: - return emptyVal, nil - - case cdp.CommandAnimationReleaseAnimations: - return emptyVal, nil - - case cdp.CommandAnimationResolveAnimation: - v = new(animation.ResolveAnimationReturns) - - case cdp.EventAnimationAnimationCreated: - v = new(animation.EventAnimationCreated) - - case cdp.EventAnimationAnimationStarted: - v = new(animation.EventAnimationStarted) - - case cdp.EventAnimationAnimationCanceled: - v = new(animation.EventAnimationCanceled) - - case cdp.CommandAccessibilityGetPartialAXTree: - v = new(accessibility.GetPartialAXTreeReturns) - - case cdp.CommandStorageClearDataForOrigin: - return emptyVal, nil - - case cdp.CommandStorageGetUsageAndQuota: - v = new(storage.GetUsageAndQuotaReturns) - - case cdp.CommandStorageTrackCacheStorageForOrigin: - return emptyVal, nil - - case cdp.CommandStorageUntrackCacheStorageForOrigin: - return emptyVal, nil - - case cdp.CommandStorageTrackIndexedDBForOrigin: - return emptyVal, nil - - case cdp.CommandStorageUntrackIndexedDBForOrigin: - return emptyVal, nil - - case cdp.EventStorageCacheStorageListUpdated: - v = new(storage.EventCacheStorageListUpdated) - - case cdp.EventStorageCacheStorageContentUpdated: - v = new(storage.EventCacheStorageContentUpdated) - - case cdp.EventStorageIndexedDBListUpdated: - v = new(storage.EventIndexedDBListUpdated) - - case cdp.EventStorageIndexedDBContentUpdated: - v = new(storage.EventIndexedDBContentUpdated) - - case cdp.CommandLogEnable: + case cdp.CommandLogClear: return emptyVal, nil case cdp.CommandLogDisable: return emptyVal, nil - case cdp.CommandLogClear: + case cdp.CommandLogEnable: return emptyVal, nil case cdp.CommandLogStartViolationsReport: @@ -1144,9 +646,501 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.EventLogEntryAdded: v = new(logdom.EventEntryAdded) + case cdp.CommandMemoryGetDOMCounters: + v = new(memory.GetDOMCountersReturns) + + case cdp.CommandMemoryPrepareForLeakDetection: + return emptyVal, nil + + case cdp.CommandMemorySetPressureNotificationsSuppressed: + return emptyVal, nil + + case cdp.CommandMemorySimulatePressureNotification: + return emptyVal, nil + + case cdp.CommandNetworkClearBrowserCache: + return emptyVal, nil + + case cdp.CommandNetworkClearBrowserCookies: + return emptyVal, nil + + case cdp.CommandNetworkContinueInterceptedRequest: + return emptyVal, nil + + case cdp.CommandNetworkDeleteCookies: + return emptyVal, nil + + case cdp.CommandNetworkDisable: + return emptyVal, nil + + case cdp.CommandNetworkEmulateNetworkConditions: + return emptyVal, nil + + case cdp.CommandNetworkEnable: + return emptyVal, nil + + case cdp.CommandNetworkGetAllCookies: + v = new(network.GetAllCookiesReturns) + + case cdp.CommandNetworkGetCertificate: + v = new(network.GetCertificateReturns) + + case cdp.CommandNetworkGetCookies: + v = new(network.GetCookiesReturns) + + case cdp.CommandNetworkGetResponseBody: + v = new(network.GetResponseBodyReturns) + + case cdp.CommandNetworkGetResponseBodyForInterception: + v = new(network.GetResponseBodyForInterceptionReturns) + + case cdp.CommandNetworkReplayXHR: + return emptyVal, nil + + case cdp.CommandNetworkSearchInResponseBody: + v = new(network.SearchInResponseBodyReturns) + + case cdp.CommandNetworkSetBlockedURLS: + return emptyVal, nil + + case cdp.CommandNetworkSetBypassServiceWorker: + return emptyVal, nil + + case cdp.CommandNetworkSetCacheDisabled: + return emptyVal, nil + + case cdp.CommandNetworkSetCookie: + v = new(network.SetCookieReturns) + + case cdp.CommandNetworkSetCookies: + return emptyVal, nil + + case cdp.CommandNetworkSetDataSizeLimitsForTest: + return emptyVal, nil + + case cdp.CommandNetworkSetExtraHTTPHeaders: + return emptyVal, nil + + case cdp.CommandNetworkSetRequestInterception: + return emptyVal, nil + + case cdp.CommandNetworkSetUserAgentOverride: + return emptyVal, nil + + case cdp.EventNetworkDataReceived: + v = new(network.EventDataReceived) + + case cdp.EventNetworkEventSourceMessageReceived: + v = new(network.EventEventSourceMessageReceived) + + case cdp.EventNetworkLoadingFailed: + v = new(network.EventLoadingFailed) + + case cdp.EventNetworkLoadingFinished: + v = new(network.EventLoadingFinished) + + case cdp.EventNetworkRequestIntercepted: + v = new(network.EventRequestIntercepted) + + case cdp.EventNetworkRequestServedFromCache: + v = new(network.EventRequestServedFromCache) + + case cdp.EventNetworkRequestWillBeSent: + v = new(network.EventRequestWillBeSent) + + case cdp.EventNetworkResourceChangedPriority: + v = new(network.EventResourceChangedPriority) + + case cdp.EventNetworkResponseReceived: + v = new(network.EventResponseReceived) + + case cdp.EventNetworkWebSocketClosed: + v = new(network.EventWebSocketClosed) + + case cdp.EventNetworkWebSocketCreated: + v = new(network.EventWebSocketCreated) + + case cdp.EventNetworkWebSocketFrameError: + v = new(network.EventWebSocketFrameError) + + case cdp.EventNetworkWebSocketFrameReceived: + v = new(network.EventWebSocketFrameReceived) + + case cdp.EventNetworkWebSocketFrameSent: + v = new(network.EventWebSocketFrameSent) + + case cdp.EventNetworkWebSocketHandshakeResponseReceived: + v = new(network.EventWebSocketHandshakeResponseReceived) + + case cdp.EventNetworkWebSocketWillSendHandshakeRequest: + v = new(network.EventWebSocketWillSendHandshakeRequest) + + case cdp.CommandOverlayDisable: + return emptyVal, nil + + case cdp.CommandOverlayEnable: + return emptyVal, nil + + case cdp.CommandOverlayGetHighlightObjectForTest: + v = new(overlay.GetHighlightObjectForTestReturns) + + case cdp.CommandOverlayHideHighlight: + return emptyVal, nil + + case cdp.CommandOverlayHighlightFrame: + return emptyVal, nil + + case cdp.CommandOverlayHighlightNode: + return emptyVal, nil + + case cdp.CommandOverlayHighlightQuad: + return emptyVal, nil + + case cdp.CommandOverlayHighlightRect: + return emptyVal, nil + + case cdp.CommandOverlaySetInspectMode: + return emptyVal, nil + + case cdp.CommandOverlaySetPausedInDebuggerMessage: + return emptyVal, nil + + case cdp.CommandOverlaySetShowDebugBorders: + return emptyVal, nil + + case cdp.CommandOverlaySetShowFPSCounter: + return emptyVal, nil + + case cdp.CommandOverlaySetShowPaintRects: + return emptyVal, nil + + case cdp.CommandOverlaySetShowScrollBottleneckRects: + return emptyVal, nil + + case cdp.CommandOverlaySetShowViewportSizeOnResize: + return emptyVal, nil + + case cdp.CommandOverlaySetSuspended: + return emptyVal, nil + + case cdp.EventOverlayInspectNodeRequested: + v = new(overlay.EventInspectNodeRequested) + + case cdp.EventOverlayNodeHighlightRequested: + v = new(overlay.EventNodeHighlightRequested) + + case cdp.EventOverlayScreenshotRequested: + v = new(overlay.EventScreenshotRequested) + + case cdp.CommandPageAddScriptToEvaluateOnNewDocument: + v = new(page.AddScriptToEvaluateOnNewDocumentReturns) + + case cdp.CommandPageBringToFront: + return emptyVal, nil + + case cdp.CommandPageCaptureScreenshot: + v = new(page.CaptureScreenshotReturns) + + case cdp.CommandPageCreateIsolatedWorld: + v = new(page.CreateIsolatedWorldReturns) + + case cdp.CommandPageDisable: + return emptyVal, nil + + case cdp.CommandPageEnable: + return emptyVal, nil + + case cdp.CommandPageGetAppManifest: + v = new(page.GetAppManifestReturns) + + case cdp.CommandPageGetFrameTree: + v = new(page.GetFrameTreeReturns) + + case cdp.CommandPageGetLayoutMetrics: + v = new(page.GetLayoutMetricsReturns) + + case cdp.CommandPageGetNavigationHistory: + v = new(page.GetNavigationHistoryReturns) + + case cdp.CommandPageGetResourceContent: + v = new(page.GetResourceContentReturns) + + case cdp.CommandPageGetResourceTree: + v = new(page.GetResourceTreeReturns) + + case cdp.CommandPageHandleJavaScriptDialog: + return emptyVal, nil + + case cdp.CommandPageNavigate: + v = new(page.NavigateReturns) + + case cdp.CommandPageNavigateToHistoryEntry: + return emptyVal, nil + + case cdp.CommandPagePrintToPDF: + v = new(page.PrintToPDFReturns) + + case cdp.CommandPageReload: + return emptyVal, nil + + case cdp.CommandPageRemoveScriptToEvaluateOnNewDocument: + return emptyVal, nil + + case cdp.CommandPageRequestAppBanner: + return emptyVal, nil + + case cdp.CommandPageScreencastFrameAck: + return emptyVal, nil + + case cdp.CommandPageSearchInResource: + v = new(page.SearchInResourceReturns) + + case cdp.CommandPageSetAdBlockingEnabled: + return emptyVal, nil + + case cdp.CommandPageSetAutoAttachToCreatedPages: + return emptyVal, nil + + case cdp.CommandPageSetDocumentContent: + return emptyVal, nil + + case cdp.CommandPageSetDownloadBehavior: + return emptyVal, nil + + case cdp.CommandPageSetLifecycleEventsEnabled: + return emptyVal, nil + + case cdp.CommandPageStartScreencast: + return emptyVal, nil + + case cdp.CommandPageStopLoading: + return emptyVal, nil + + case cdp.CommandPageStopScreencast: + return emptyVal, nil + + case cdp.EventPageDomContentEventFired: + v = new(page.EventDomContentEventFired) + + case cdp.EventPageFrameAttached: + v = new(page.EventFrameAttached) + + case cdp.EventPageFrameClearedScheduledNavigation: + v = new(page.EventFrameClearedScheduledNavigation) + + case cdp.EventPageFrameDetached: + v = new(page.EventFrameDetached) + + case cdp.EventPageFrameNavigated: + v = new(page.EventFrameNavigated) + + case cdp.EventPageFrameResized: + v = new(page.EventFrameResized) + + case cdp.EventPageFrameScheduledNavigation: + v = new(page.EventFrameScheduledNavigation) + + case cdp.EventPageFrameStartedLoading: + v = new(page.EventFrameStartedLoading) + + case cdp.EventPageFrameStoppedLoading: + v = new(page.EventFrameStoppedLoading) + + case cdp.EventPageInterstitialHidden: + v = new(page.EventInterstitialHidden) + + case cdp.EventPageInterstitialShown: + v = new(page.EventInterstitialShown) + + case cdp.EventPageJavascriptDialogClosed: + v = new(page.EventJavascriptDialogClosed) + + case cdp.EventPageJavascriptDialogOpening: + v = new(page.EventJavascriptDialogOpening) + + case cdp.EventPageLifecycleEvent: + v = new(page.EventLifecycleEvent) + + case cdp.EventPageLoadEventFired: + v = new(page.EventLoadEventFired) + + case cdp.EventPageScreencastFrame: + v = new(page.EventScreencastFrame) + + case cdp.EventPageScreencastVisibilityChanged: + v = new(page.EventScreencastVisibilityChanged) + + case cdp.EventPageWindowOpen: + v = new(page.EventWindowOpen) + + case cdp.CommandPerformanceDisable: + return emptyVal, nil + + case cdp.CommandPerformanceEnable: + return emptyVal, nil + + case cdp.CommandPerformanceGetMetrics: + v = new(performance.GetMetricsReturns) + + case cdp.EventPerformanceMetrics: + v = new(performance.EventMetrics) + + case cdp.CommandSecurityDisable: + return emptyVal, nil + + case cdp.CommandSecurityEnable: + return emptyVal, nil + + case cdp.CommandSecurityHandleCertificateError: + return emptyVal, nil + + case cdp.CommandSecuritySetOverrideCertificateErrors: + return emptyVal, nil + + case cdp.EventSecurityCertificateError: + v = new(security.EventCertificateError) + + case cdp.EventSecuritySecurityStateChanged: + v = new(security.EventSecurityStateChanged) + + case cdp.CommandServiceWorkerDeliverPushMessage: + return emptyVal, nil + + case cdp.CommandServiceWorkerDisable: + return emptyVal, nil + + case cdp.CommandServiceWorkerDispatchSyncEvent: + return emptyVal, nil + + case cdp.CommandServiceWorkerEnable: + return emptyVal, nil + + case cdp.CommandServiceWorkerInspectWorker: + return emptyVal, nil + + case cdp.CommandServiceWorkerSetForceUpdateOnPageLoad: + return emptyVal, nil + + case cdp.CommandServiceWorkerSkipWaiting: + return emptyVal, nil + + case cdp.CommandServiceWorkerStartWorker: + return emptyVal, nil + + case cdp.CommandServiceWorkerStopAllWorkers: + return emptyVal, nil + + case cdp.CommandServiceWorkerStopWorker: + return emptyVal, nil + + case cdp.CommandServiceWorkerUnregister: + return emptyVal, nil + + case cdp.CommandServiceWorkerUpdateRegistration: + return emptyVal, nil + + case cdp.EventServiceWorkerWorkerErrorReported: + v = new(serviceworker.EventWorkerErrorReported) + + case cdp.EventServiceWorkerWorkerRegistrationUpdated: + v = new(serviceworker.EventWorkerRegistrationUpdated) + + case cdp.EventServiceWorkerWorkerVersionUpdated: + v = new(serviceworker.EventWorkerVersionUpdated) + + case cdp.CommandStorageClearDataForOrigin: + return emptyVal, nil + + case cdp.CommandStorageGetUsageAndQuota: + v = new(storage.GetUsageAndQuotaReturns) + + case cdp.CommandStorageTrackCacheStorageForOrigin: + return emptyVal, nil + + case cdp.CommandStorageTrackIndexedDBForOrigin: + return emptyVal, nil + + case cdp.CommandStorageUntrackCacheStorageForOrigin: + return emptyVal, nil + + case cdp.CommandStorageUntrackIndexedDBForOrigin: + return emptyVal, nil + + case cdp.EventStorageCacheStorageContentUpdated: + v = new(storage.EventCacheStorageContentUpdated) + + case cdp.EventStorageCacheStorageListUpdated: + v = new(storage.EventCacheStorageListUpdated) + + case cdp.EventStorageIndexedDBContentUpdated: + v = new(storage.EventIndexedDBContentUpdated) + + case cdp.EventStorageIndexedDBListUpdated: + v = new(storage.EventIndexedDBListUpdated) + case cdp.CommandSystemInfoGetInfo: v = new(systeminfo.GetInfoReturns) + case cdp.CommandTargetActivateTarget: + return emptyVal, nil + + case cdp.CommandTargetAttachToTarget: + v = new(target.AttachToTargetReturns) + + case cdp.CommandTargetCloseTarget: + v = new(target.CloseTargetReturns) + + case cdp.CommandTargetCreateBrowserContext: + v = new(target.CreateBrowserContextReturns) + + case cdp.CommandTargetCreateTarget: + v = new(target.CreateTargetReturns) + + case cdp.CommandTargetDetachFromTarget: + return emptyVal, nil + + case cdp.CommandTargetDisposeBrowserContext: + v = new(target.DisposeBrowserContextReturns) + + case cdp.CommandTargetGetTargetInfo: + v = new(target.GetTargetInfoReturns) + + case cdp.CommandTargetGetTargets: + v = new(target.GetTargetsReturns) + + case cdp.CommandTargetSendMessageToTarget: + return emptyVal, nil + + case cdp.CommandTargetSetAttachToFrames: + return emptyVal, nil + + case cdp.CommandTargetSetAutoAttach: + return emptyVal, nil + + case cdp.CommandTargetSetDiscoverTargets: + return emptyVal, nil + + case cdp.CommandTargetSetRemoteLocations: + return emptyVal, nil + + case cdp.EventTargetAttachedToTarget: + v = new(target.EventAttachedToTarget) + + case cdp.EventTargetDetachedFromTarget: + v = new(target.EventDetachedFromTarget) + + case cdp.EventTargetReceivedMessageFromTarget: + v = new(target.EventReceivedMessageFromTarget) + + case cdp.EventTargetTargetCreated: + v = new(target.EventTargetCreated) + + case cdp.EventTargetTargetDestroyed: + v = new(target.EventTargetDestroyed) + + case cdp.EventTargetTargetInfoChanged: + v = new(target.EventTargetInfoChanged) + case cdp.CommandTetheringBind: return emptyVal, nil @@ -1156,162 +1150,72 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.EventTetheringAccepted: v = new(tethering.EventAccepted) - case cdp.CommandBrowserClose: + case cdp.CommandTracingEnd: return emptyVal, nil - case cdp.CommandBrowserGetWindowForTarget: - v = new(browser.GetWindowForTargetReturns) + case cdp.CommandTracingGetCategories: + v = new(tracing.GetCategoriesReturns) - case cdp.CommandBrowserGetVersion: - v = new(browser.GetVersionReturns) - - case cdp.CommandBrowserSetWindowBounds: + case cdp.CommandTracingRecordClockSyncMarker: return emptyVal, nil - case cdp.CommandBrowserGetWindowBounds: - v = new(browser.GetWindowBoundsReturns) + case cdp.CommandTracingRequestMemoryDump: + v = new(tracing.RequestMemoryDumpReturns) - case cdp.CommandRuntimeEvaluate: - v = new(runtime.EvaluateReturns) - - case cdp.CommandRuntimeAwaitPromise: - v = new(runtime.AwaitPromiseReturns) - - case cdp.CommandRuntimeCallFunctionOn: - v = new(runtime.CallFunctionOnReturns) - - case cdp.CommandRuntimeGetProperties: - v = new(runtime.GetPropertiesReturns) - - case cdp.CommandRuntimeReleaseObject: + case cdp.CommandTracingStart: return emptyVal, nil - case cdp.CommandRuntimeReleaseObjectGroup: + case cdp.EventTracingBufferUsage: + v = new(tracing.EventBufferUsage) + + case cdp.EventTracingDataCollected: + v = new(tracing.EventDataCollected) + + case cdp.EventTracingTracingComplete: + v = new(tracing.EventTracingComplete) + + case cdp.CommandDebuggerContinueToLocation: return emptyVal, nil - case cdp.CommandRuntimeRunIfWaitingForDebugger: - return emptyVal, nil - - case cdp.CommandRuntimeEnable: - return emptyVal, nil - - case cdp.CommandRuntimeDisable: - return emptyVal, nil - - case cdp.CommandRuntimeDiscardConsoleEntries: - return emptyVal, nil - - case cdp.CommandRuntimeSetCustomObjectFormatterEnabled: - return emptyVal, nil - - case cdp.CommandRuntimeCompileScript: - v = new(runtime.CompileScriptReturns) - - case cdp.CommandRuntimeRunScript: - v = new(runtime.RunScriptReturns) - - case cdp.CommandRuntimeQueryObjects: - v = new(runtime.QueryObjectsReturns) - - case cdp.CommandRuntimeGlobalLexicalScopeNames: - v = new(runtime.GlobalLexicalScopeNamesReturns) - - case cdp.EventRuntimeExecutionContextCreated: - v = new(runtime.EventExecutionContextCreated) - - case cdp.EventRuntimeExecutionContextDestroyed: - v = new(runtime.EventExecutionContextDestroyed) - - case cdp.EventRuntimeExecutionContextsCleared: - v = new(runtime.EventExecutionContextsCleared) - - case cdp.EventRuntimeExceptionThrown: - v = new(runtime.EventExceptionThrown) - - case cdp.EventRuntimeExceptionRevoked: - v = new(runtime.EventExceptionRevoked) - - case cdp.EventRuntimeConsoleAPICalled: - v = new(runtime.EventConsoleAPICalled) - - case cdp.EventRuntimeInspectRequested: - v = new(runtime.EventInspectRequested) - - case cdp.CommandDebuggerEnable: - v = new(debugger.EnableReturns) - case cdp.CommandDebuggerDisable: return emptyVal, nil - case cdp.CommandDebuggerSetBreakpointsActive: - return emptyVal, nil + case cdp.CommandDebuggerEnable: + v = new(debugger.EnableReturns) - case cdp.CommandDebuggerSetSkipAllPauses: - return emptyVal, nil - - case cdp.CommandDebuggerSetBreakpointByURL: - v = new(debugger.SetBreakpointByURLReturns) - - case cdp.CommandDebuggerSetBreakpoint: - v = new(debugger.SetBreakpointReturns) - - case cdp.CommandDebuggerRemoveBreakpoint: - return emptyVal, nil + case cdp.CommandDebuggerEvaluateOnCallFrame: + v = new(debugger.EvaluateOnCallFrameReturns) case cdp.CommandDebuggerGetPossibleBreakpoints: v = new(debugger.GetPossibleBreakpointsReturns) - case cdp.CommandDebuggerContinueToLocation: + case cdp.CommandDebuggerGetScriptSource: + v = new(debugger.GetScriptSourceReturns) + + case cdp.CommandDebuggerGetStackTrace: + v = new(debugger.GetStackTraceReturns) + + case cdp.CommandDebuggerPause: return emptyVal, nil case cdp.CommandDebuggerPauseOnAsyncCall: return emptyVal, nil - case cdp.CommandDebuggerStepOver: + case cdp.CommandDebuggerRemoveBreakpoint: return emptyVal, nil - case cdp.CommandDebuggerStepInto: - return emptyVal, nil + case cdp.CommandDebuggerRestartFrame: + v = new(debugger.RestartFrameReturns) - case cdp.CommandDebuggerStepOut: - return emptyVal, nil - - case cdp.CommandDebuggerPause: + case cdp.CommandDebuggerResume: return emptyVal, nil case cdp.CommandDebuggerScheduleStepIntoAsync: return emptyVal, nil - case cdp.CommandDebuggerResume: - return emptyVal, nil - - case cdp.CommandDebuggerGetStackTrace: - v = new(debugger.GetStackTraceReturns) - case cdp.CommandDebuggerSearchInContent: v = new(debugger.SearchInContentReturns) - case cdp.CommandDebuggerSetScriptSource: - v = new(debugger.SetScriptSourceReturns) - - case cdp.CommandDebuggerRestartFrame: - v = new(debugger.RestartFrameReturns) - - case cdp.CommandDebuggerGetScriptSource: - v = new(debugger.GetScriptSourceReturns) - - case cdp.CommandDebuggerSetPauseOnExceptions: - return emptyVal, nil - - case cdp.CommandDebuggerEvaluateOnCallFrame: - v = new(debugger.EvaluateOnCallFrameReturns) - - case cdp.CommandDebuggerSetVariableValue: - return emptyVal, nil - - case cdp.CommandDebuggerSetReturnValue: - return emptyVal, nil - case cdp.CommandDebuggerSetAsyncCallStackDepth: return emptyVal, nil @@ -1321,11 +1225,38 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.CommandDebuggerSetBlackboxedRanges: return emptyVal, nil - case cdp.EventDebuggerScriptParsed: - v = new(debugger.EventScriptParsed) + case cdp.CommandDebuggerSetBreakpoint: + v = new(debugger.SetBreakpointReturns) - case cdp.EventDebuggerScriptFailedToParse: - v = new(debugger.EventScriptFailedToParse) + case cdp.CommandDebuggerSetBreakpointByURL: + v = new(debugger.SetBreakpointByURLReturns) + + case cdp.CommandDebuggerSetBreakpointsActive: + return emptyVal, nil + + case cdp.CommandDebuggerSetPauseOnExceptions: + return emptyVal, nil + + case cdp.CommandDebuggerSetReturnValue: + return emptyVal, nil + + case cdp.CommandDebuggerSetScriptSource: + v = new(debugger.SetScriptSourceReturns) + + case cdp.CommandDebuggerSetSkipAllPauses: + return emptyVal, nil + + case cdp.CommandDebuggerSetVariableValue: + return emptyVal, nil + + case cdp.CommandDebuggerStepInto: + return emptyVal, nil + + case cdp.CommandDebuggerStepOut: + return emptyVal, nil + + case cdp.CommandDebuggerStepOver: + return emptyVal, nil case cdp.EventDebuggerBreakpointResolved: v = new(debugger.EventBreakpointResolved) @@ -1336,98 +1267,170 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.EventDebuggerResumed: v = new(debugger.EventResumed) - case cdp.CommandProfilerEnable: + case cdp.EventDebuggerScriptFailedToParse: + v = new(debugger.EventScriptFailedToParse) + + case cdp.EventDebuggerScriptParsed: + v = new(debugger.EventScriptParsed) + + case cdp.CommandHeapProfilerAddInspectedHeapObject: return emptyVal, nil - case cdp.CommandProfilerDisable: - return emptyVal, nil - - case cdp.CommandProfilerSetSamplingInterval: - return emptyVal, nil - - case cdp.CommandProfilerStart: - return emptyVal, nil - - case cdp.CommandProfilerStop: - v = new(profiler.StopReturns) - - case cdp.CommandProfilerStartPreciseCoverage: - return emptyVal, nil - - case cdp.CommandProfilerStopPreciseCoverage: - return emptyVal, nil - - case cdp.CommandProfilerTakePreciseCoverage: - v = new(profiler.TakePreciseCoverageReturns) - - case cdp.CommandProfilerGetBestEffortCoverage: - v = new(profiler.GetBestEffortCoverageReturns) - - case cdp.CommandProfilerStartTypeProfile: - return emptyVal, nil - - case cdp.CommandProfilerStopTypeProfile: - return emptyVal, nil - - case cdp.CommandProfilerTakeTypeProfile: - v = new(profiler.TakeTypeProfileReturns) - - case cdp.EventProfilerConsoleProfileStarted: - v = new(profiler.EventConsoleProfileStarted) - - case cdp.EventProfilerConsoleProfileFinished: - v = new(profiler.EventConsoleProfileFinished) - - case cdp.CommandHeapProfilerEnable: + case cdp.CommandHeapProfilerCollectGarbage: return emptyVal, nil case cdp.CommandHeapProfilerDisable: return emptyVal, nil + case cdp.CommandHeapProfilerEnable: + return emptyVal, nil + + case cdp.CommandHeapProfilerGetHeapObjectID: + v = new(heapprofiler.GetHeapObjectIDReturns) + + case cdp.CommandHeapProfilerGetObjectByHeapObjectID: + v = new(heapprofiler.GetObjectByHeapObjectIDReturns) + + case cdp.CommandHeapProfilerGetSamplingProfile: + v = new(heapprofiler.GetSamplingProfileReturns) + + case cdp.CommandHeapProfilerStartSampling: + return emptyVal, nil + case cdp.CommandHeapProfilerStartTrackingHeapObjects: return emptyVal, nil + case cdp.CommandHeapProfilerStopSampling: + v = new(heapprofiler.StopSamplingReturns) + case cdp.CommandHeapProfilerStopTrackingHeapObjects: return emptyVal, nil case cdp.CommandHeapProfilerTakeHeapSnapshot: return emptyVal, nil - case cdp.CommandHeapProfilerCollectGarbage: - return emptyVal, nil - - case cdp.CommandHeapProfilerGetObjectByHeapObjectID: - v = new(heapprofiler.GetObjectByHeapObjectIDReturns) - - case cdp.CommandHeapProfilerAddInspectedHeapObject: - return emptyVal, nil - - case cdp.CommandHeapProfilerGetHeapObjectID: - v = new(heapprofiler.GetHeapObjectIDReturns) - - case cdp.CommandHeapProfilerStartSampling: - return emptyVal, nil - - case cdp.CommandHeapProfilerStopSampling: - v = new(heapprofiler.StopSamplingReturns) - - case cdp.CommandHeapProfilerGetSamplingProfile: - v = new(heapprofiler.GetSamplingProfileReturns) - case cdp.EventHeapProfilerAddHeapSnapshotChunk: v = new(heapprofiler.EventAddHeapSnapshotChunk) - case cdp.EventHeapProfilerResetProfiles: - v = new(heapprofiler.EventResetProfiles) - - case cdp.EventHeapProfilerReportHeapSnapshotProgress: - v = new(heapprofiler.EventReportHeapSnapshotProgress) + case cdp.EventHeapProfilerHeapStatsUpdate: + v = new(heapprofiler.EventHeapStatsUpdate) case cdp.EventHeapProfilerLastSeenObjectID: v = new(heapprofiler.EventLastSeenObjectID) - case cdp.EventHeapProfilerHeapStatsUpdate: - v = new(heapprofiler.EventHeapStatsUpdate) + case cdp.EventHeapProfilerReportHeapSnapshotProgress: + v = new(heapprofiler.EventReportHeapSnapshotProgress) + + case cdp.EventHeapProfilerResetProfiles: + v = new(heapprofiler.EventResetProfiles) + + case cdp.CommandProfilerDisable: + return emptyVal, nil + + case cdp.CommandProfilerEnable: + return emptyVal, nil + + case cdp.CommandProfilerGetBestEffortCoverage: + v = new(profiler.GetBestEffortCoverageReturns) + + case cdp.CommandProfilerSetSamplingInterval: + return emptyVal, nil + + case cdp.CommandProfilerStart: + return emptyVal, nil + + case cdp.CommandProfilerStartPreciseCoverage: + return emptyVal, nil + + case cdp.CommandProfilerStartTypeProfile: + return emptyVal, nil + + case cdp.CommandProfilerStop: + v = new(profiler.StopReturns) + + case cdp.CommandProfilerStopPreciseCoverage: + return emptyVal, nil + + case cdp.CommandProfilerStopTypeProfile: + return emptyVal, nil + + case cdp.CommandProfilerTakePreciseCoverage: + v = new(profiler.TakePreciseCoverageReturns) + + case cdp.CommandProfilerTakeTypeProfile: + v = new(profiler.TakeTypeProfileReturns) + + case cdp.EventProfilerConsoleProfileFinished: + v = new(profiler.EventConsoleProfileFinished) + + case cdp.EventProfilerConsoleProfileStarted: + v = new(profiler.EventConsoleProfileStarted) + + case cdp.CommandRuntimeAwaitPromise: + v = new(runtime.AwaitPromiseReturns) + + case cdp.CommandRuntimeCallFunctionOn: + v = new(runtime.CallFunctionOnReturns) + + case cdp.CommandRuntimeCompileScript: + v = new(runtime.CompileScriptReturns) + + case cdp.CommandRuntimeDisable: + return emptyVal, nil + + case cdp.CommandRuntimeDiscardConsoleEntries: + return emptyVal, nil + + case cdp.CommandRuntimeEnable: + return emptyVal, nil + + case cdp.CommandRuntimeEvaluate: + v = new(runtime.EvaluateReturns) + + case cdp.CommandRuntimeGetProperties: + v = new(runtime.GetPropertiesReturns) + + case cdp.CommandRuntimeGlobalLexicalScopeNames: + v = new(runtime.GlobalLexicalScopeNamesReturns) + + case cdp.CommandRuntimeQueryObjects: + v = new(runtime.QueryObjectsReturns) + + case cdp.CommandRuntimeReleaseObject: + return emptyVal, nil + + case cdp.CommandRuntimeReleaseObjectGroup: + return emptyVal, nil + + case cdp.CommandRuntimeRunIfWaitingForDebugger: + return emptyVal, nil + + case cdp.CommandRuntimeRunScript: + v = new(runtime.RunScriptReturns) + + case cdp.CommandRuntimeSetCustomObjectFormatterEnabled: + return emptyVal, nil + + case cdp.EventRuntimeConsoleAPICalled: + v = new(runtime.EventConsoleAPICalled) + + case cdp.EventRuntimeExceptionRevoked: + v = new(runtime.EventExceptionRevoked) + + case cdp.EventRuntimeExceptionThrown: + v = new(runtime.EventExceptionThrown) + + case cdp.EventRuntimeExecutionContextCreated: + v = new(runtime.EventExecutionContextCreated) + + case cdp.EventRuntimeExecutionContextDestroyed: + v = new(runtime.EventExecutionContextDestroyed) + + case cdp.EventRuntimeExecutionContextsCleared: + v = new(runtime.EventExecutionContextsCleared) + + case cdp.EventRuntimeInspectRequested: + v = new(runtime.EventInspectRequested) } var buf easyjson.RawMessage diff --git a/cdp/css/css.go b/cdp/css/css.go index 9062204..e127af2 100644 --- a/cdp/css/css.go +++ b/cdp/css/css.go @@ -21,6 +21,138 @@ import ( cdp "github.com/knq/chromedp/cdp" ) +// AddRuleParams inserts a new rule with the given ruleText in a stylesheet +// with given styleSheetId, at the position specified by location. +type AddRuleParams struct { + StyleSheetID StyleSheetID `json:"styleSheetId"` // The css style sheet identifier where a new rule should be inserted. + RuleText string `json:"ruleText"` // The text of a new rule. + Location *SourceRange `json:"location"` // Text position of a new rule in the target style sheet. +} + +// AddRule inserts a new rule with the given ruleText in a stylesheet with +// given styleSheetId, at the position specified by location. +// +// parameters: +// styleSheetID - The css style sheet identifier where a new rule should be inserted. +// ruleText - The text of a new rule. +// location - Text position of a new rule in the target style sheet. +func AddRule(styleSheetID StyleSheetID, ruleText string, location *SourceRange) *AddRuleParams { + return &AddRuleParams{ + StyleSheetID: styleSheetID, + RuleText: ruleText, + Location: location, + } +} + +// AddRuleReturns return values. +type AddRuleReturns struct { + Rule *Rule `json:"rule,omitempty"` // The newly created rule. +} + +// Do executes CSS.addRule against the provided context and +// target handler. +// +// returns: +// rule - The newly created rule. +func (p *AddRuleParams) Do(ctxt context.Context, h cdp.Handler) (rule *Rule, err error) { + // execute + var res AddRuleReturns + err = h.Execute(ctxt, cdp.CommandCSSAddRule, p, &res) + if err != nil { + return nil, err + } + + return res.Rule, nil +} + +// CollectClassNamesParams returns all class names from specified stylesheet. +type CollectClassNamesParams struct { + StyleSheetID StyleSheetID `json:"styleSheetId"` +} + +// CollectClassNames returns all class names from specified stylesheet. +// +// parameters: +// styleSheetID +func CollectClassNames(styleSheetID StyleSheetID) *CollectClassNamesParams { + return &CollectClassNamesParams{ + StyleSheetID: styleSheetID, + } +} + +// CollectClassNamesReturns return values. +type CollectClassNamesReturns struct { + ClassNames []string `json:"classNames,omitempty"` // Class name list. +} + +// Do executes CSS.collectClassNames against the provided context and +// target handler. +// +// returns: +// classNames - Class name list. +func (p *CollectClassNamesParams) Do(ctxt context.Context, h cdp.Handler) (classNames []string, err error) { + // execute + var res CollectClassNamesReturns + err = h.Execute(ctxt, cdp.CommandCSSCollectClassNames, p, &res) + if err != nil { + return nil, err + } + + return res.ClassNames, nil +} + +// CreateStyleSheetParams creates a new special "via-inspector" stylesheet in +// the frame with given frameId. +type CreateStyleSheetParams struct { + FrameID cdp.FrameID `json:"frameId"` // Identifier of the frame where "via-inspector" stylesheet should be created. +} + +// CreateStyleSheet creates a new special "via-inspector" stylesheet in the +// frame with given frameId. +// +// parameters: +// frameID - Identifier of the frame where "via-inspector" stylesheet should be created. +func CreateStyleSheet(frameID cdp.FrameID) *CreateStyleSheetParams { + return &CreateStyleSheetParams{ + FrameID: frameID, + } +} + +// CreateStyleSheetReturns return values. +type CreateStyleSheetReturns struct { + StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the created "via-inspector" stylesheet. +} + +// Do executes CSS.createStyleSheet against the provided context and +// target handler. +// +// returns: +// styleSheetID - Identifier of the created "via-inspector" stylesheet. +func (p *CreateStyleSheetParams) Do(ctxt context.Context, h cdp.Handler) (styleSheetID StyleSheetID, err error) { + // execute + var res CreateStyleSheetReturns + err = h.Execute(ctxt, cdp.CommandCSSCreateStyleSheet, p, &res) + if err != nil { + return "", err + } + + return res.StyleSheetID, nil +} + +// DisableParams disables the CSS agent for the given page. +type DisableParams struct{} + +// Disable disables the CSS agent for the given page. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes CSS.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandCSSDisable, nil, nil) +} + // EnableParams enables the CSS agent for the given page. Clients should not // assume that the CSS agent has been enabled until the result of this command // is received. @@ -39,18 +171,152 @@ func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandCSSEnable, nil, nil) } -// DisableParams disables the CSS agent for the given page. -type DisableParams struct{} - -// Disable disables the CSS agent for the given page. -func Disable() *DisableParams { - return &DisableParams{} +// ForcePseudoStateParams ensures that the given node will have specified +// pseudo-classes whenever its style is computed by the browser. +type ForcePseudoStateParams struct { + NodeID cdp.NodeID `json:"nodeId"` // The element id for which to force the pseudo state. + ForcedPseudoClasses []string `json:"forcedPseudoClasses"` // Element pseudo classes to force when computing the element's style. } -// Do executes CSS.disable against the provided context and +// ForcePseudoState ensures that the given node will have specified +// pseudo-classes whenever its style is computed by the browser. +// +// parameters: +// nodeID - The element id for which to force the pseudo state. +// forcedPseudoClasses - Element pseudo classes to force when computing the element's style. +func ForcePseudoState(nodeID cdp.NodeID, forcedPseudoClasses []string) *ForcePseudoStateParams { + return &ForcePseudoStateParams{ + NodeID: nodeID, + ForcedPseudoClasses: forcedPseudoClasses, + } +} + +// Do executes CSS.forcePseudoState against the provided context and // target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandCSSDisable, nil, nil) +func (p *ForcePseudoStateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandCSSForcePseudoState, p, nil) +} + +// GetBackgroundColorsParams [no description]. +type GetBackgroundColorsParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get background colors for. +} + +// GetBackgroundColors [no description]. +// +// parameters: +// nodeID - Id of the node to get background colors for. +func GetBackgroundColors(nodeID cdp.NodeID) *GetBackgroundColorsParams { + return &GetBackgroundColorsParams{ + NodeID: nodeID, + } +} + +// GetBackgroundColorsReturns return values. +type GetBackgroundColorsReturns struct { + BackgroundColors []string `json:"backgroundColors,omitempty"` // The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). + ComputedFontSize string `json:"computedFontSize,omitempty"` // The computed font size for this node, as a CSS computed value string (e.g. '12px'). + ComputedFontWeight string `json:"computedFontWeight,omitempty"` // The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100'). + ComputedBodyFontSize string `json:"computedBodyFontSize,omitempty"` // The computed font size for the document body, as a computed CSS value string (e.g. '16px'). +} + +// Do executes CSS.getBackgroundColors against the provided context and +// target handler. +// +// returns: +// backgroundColors - The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). +// computedFontSize - The computed font size for this node, as a CSS computed value string (e.g. '12px'). +// computedFontWeight - The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100'). +// computedBodyFontSize - The computed font size for the document body, as a computed CSS value string (e.g. '16px'). +func (p *GetBackgroundColorsParams) Do(ctxt context.Context, h cdp.Handler) (backgroundColors []string, computedFontSize string, computedFontWeight string, computedBodyFontSize string, err error) { + // execute + var res GetBackgroundColorsReturns + err = h.Execute(ctxt, cdp.CommandCSSGetBackgroundColors, p, &res) + if err != nil { + return nil, "", "", "", err + } + + return res.BackgroundColors, res.ComputedFontSize, res.ComputedFontWeight, res.ComputedBodyFontSize, nil +} + +// GetComputedStyleForNodeParams returns the computed style for a DOM node +// identified by nodeId. +type GetComputedStyleForNodeParams struct { + NodeID cdp.NodeID `json:"nodeId"` +} + +// GetComputedStyleForNode returns the computed style for a DOM node +// identified by nodeId. +// +// parameters: +// nodeID +func GetComputedStyleForNode(nodeID cdp.NodeID) *GetComputedStyleForNodeParams { + return &GetComputedStyleForNodeParams{ + NodeID: nodeID, + } +} + +// GetComputedStyleForNodeReturns return values. +type GetComputedStyleForNodeReturns struct { + ComputedStyle []*ComputedProperty `json:"computedStyle,omitempty"` // Computed style for the specified DOM node. +} + +// Do executes CSS.getComputedStyleForNode against the provided context and +// target handler. +// +// returns: +// computedStyle - Computed style for the specified DOM node. +func (p *GetComputedStyleForNodeParams) Do(ctxt context.Context, h cdp.Handler) (computedStyle []*ComputedProperty, err error) { + // execute + var res GetComputedStyleForNodeReturns + err = h.Execute(ctxt, cdp.CommandCSSGetComputedStyleForNode, p, &res) + if err != nil { + return nil, err + } + + return res.ComputedStyle, nil +} + +// GetInlineStylesForNodeParams returns the styles defined inline (explicitly +// in the "style" attribute and implicitly, using DOM attributes) for a DOM node +// identified by nodeId. +type GetInlineStylesForNodeParams struct { + NodeID cdp.NodeID `json:"nodeId"` +} + +// GetInlineStylesForNode returns the styles defined inline (explicitly in +// the "style" attribute and implicitly, using DOM attributes) for a DOM node +// identified by nodeId. +// +// parameters: +// nodeID +func GetInlineStylesForNode(nodeID cdp.NodeID) *GetInlineStylesForNodeParams { + return &GetInlineStylesForNodeParams{ + NodeID: nodeID, + } +} + +// GetInlineStylesForNodeReturns return values. +type GetInlineStylesForNodeReturns 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%"). +} + +// Do executes CSS.getInlineStylesForNode against the provided context and +// target handler. +// +// returns: +// inlineStyle - Inline style for the specified DOM node. +// attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%"). +func (p *GetInlineStylesForNodeParams) Do(ctxt context.Context, h cdp.Handler) (inlineStyle *Style, attributesStyle *Style, err error) { + // execute + var res GetInlineStylesForNodeReturns + err = h.Execute(ctxt, cdp.CommandCSSGetInlineStylesForNode, p, &res) + if err != nil { + return nil, nil, err + } + + return res.InlineStyle, res.AttributesStyle, nil } // GetMatchedStylesForNodeParams returns requested styles for a DOM node @@ -101,84 +367,34 @@ func (p *GetMatchedStylesForNodeParams) Do(ctxt context.Context, h cdp.Handler) return res.InlineStyle, res.AttributesStyle, res.MatchedCSSRules, res.PseudoElements, res.Inherited, res.CSSKeyframesRules, nil } -// GetInlineStylesForNodeParams returns the styles defined inline (explicitly -// in the "style" attribute and implicitly, using DOM attributes) for a DOM node -// identified by nodeId. -type GetInlineStylesForNodeParams struct { - NodeID cdp.NodeID `json:"nodeId"` +// GetMediaQueriesParams returns all media queries parsed by the rendering +// engine. +type GetMediaQueriesParams struct{} + +// GetMediaQueries returns all media queries parsed by the rendering engine. +func GetMediaQueries() *GetMediaQueriesParams { + return &GetMediaQueriesParams{} } -// GetInlineStylesForNode returns the styles defined inline (explicitly in -// the "style" attribute and implicitly, using DOM attributes) for a DOM node -// identified by nodeId. -// -// parameters: -// nodeID -func GetInlineStylesForNode(nodeID cdp.NodeID) *GetInlineStylesForNodeParams { - return &GetInlineStylesForNodeParams{ - NodeID: nodeID, - } +// GetMediaQueriesReturns return values. +type GetMediaQueriesReturns struct { + Medias []*Media `json:"medias,omitempty"` } -// GetInlineStylesForNodeReturns return values. -type GetInlineStylesForNodeReturns 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%"). -} - -// Do executes CSS.getInlineStylesForNode against the provided context and +// Do executes CSS.getMediaQueries against the provided context and // target handler. // // returns: -// inlineStyle - Inline style for the specified DOM node. -// attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%"). -func (p *GetInlineStylesForNodeParams) Do(ctxt context.Context, h cdp.Handler) (inlineStyle *Style, attributesStyle *Style, err error) { +// medias +func (p *GetMediaQueriesParams) Do(ctxt context.Context, h cdp.Handler) (medias []*Media, err error) { // execute - var res GetInlineStylesForNodeReturns - err = h.Execute(ctxt, cdp.CommandCSSGetInlineStylesForNode, p, &res) - if err != nil { - return nil, nil, err - } - - return res.InlineStyle, res.AttributesStyle, nil -} - -// GetComputedStyleForNodeParams returns the computed style for a DOM node -// identified by nodeId. -type GetComputedStyleForNodeParams struct { - NodeID cdp.NodeID `json:"nodeId"` -} - -// GetComputedStyleForNode returns the computed style for a DOM node -// identified by nodeId. -// -// parameters: -// nodeID -func GetComputedStyleForNode(nodeID cdp.NodeID) *GetComputedStyleForNodeParams { - return &GetComputedStyleForNodeParams{ - NodeID: nodeID, - } -} - -// GetComputedStyleForNodeReturns return values. -type GetComputedStyleForNodeReturns struct { - ComputedStyle []*ComputedProperty `json:"computedStyle,omitempty"` // Computed style for the specified DOM node. -} - -// Do executes CSS.getComputedStyleForNode against the provided context and -// target handler. -// -// returns: -// computedStyle - Computed style for the specified DOM node. -func (p *GetComputedStyleForNodeParams) Do(ctxt context.Context, h cdp.Handler) (computedStyle []*ComputedProperty, err error) { - // execute - var res GetComputedStyleForNodeReturns - err = h.Execute(ctxt, cdp.CommandCSSGetComputedStyleForNode, p, &res) + var res GetMediaQueriesReturns + err = h.Execute(ctxt, cdp.CommandCSSGetMediaQueries, nil, &res) if err != nil { return nil, err } - return res.ComputedStyle, nil + return res.Medias, nil } // GetPlatformFontsForNodeParams requests information about platform fonts @@ -257,121 +473,33 @@ func (p *GetStyleSheetTextParams) Do(ctxt context.Context, h cdp.Handler) (text return res.Text, nil } -// CollectClassNamesParams returns all class names from specified stylesheet. -type CollectClassNamesParams struct { - StyleSheetID StyleSheetID `json:"styleSheetId"` +// SetEffectivePropertyValueForNodeParams find a rule with the given active +// property for the given node and set the new value for this property. +type SetEffectivePropertyValueForNodeParams struct { + NodeID cdp.NodeID `json:"nodeId"` // The element id for which to set property. + PropertyName string `json:"propertyName"` + Value string `json:"value"` } -// CollectClassNames returns all class names from specified stylesheet. +// SetEffectivePropertyValueForNode find a rule with the given active +// property for the given node and set the new value for this property. // // parameters: -// styleSheetID -func CollectClassNames(styleSheetID StyleSheetID) *CollectClassNamesParams { - return &CollectClassNamesParams{ - StyleSheetID: styleSheetID, +// nodeID - The element id for which to set property. +// propertyName +// value +func SetEffectivePropertyValueForNode(nodeID cdp.NodeID, propertyName string, value string) *SetEffectivePropertyValueForNodeParams { + return &SetEffectivePropertyValueForNodeParams{ + NodeID: nodeID, + PropertyName: propertyName, + Value: value, } } -// CollectClassNamesReturns return values. -type CollectClassNamesReturns struct { - ClassNames []string `json:"classNames,omitempty"` // Class name list. -} - -// Do executes CSS.collectClassNames against the provided context and +// Do executes CSS.setEffectivePropertyValueForNode against the provided context and // target handler. -// -// returns: -// classNames - Class name list. -func (p *CollectClassNamesParams) Do(ctxt context.Context, h cdp.Handler) (classNames []string, err error) { - // execute - var res CollectClassNamesReturns - err = h.Execute(ctxt, cdp.CommandCSSCollectClassNames, p, &res) - if err != nil { - return nil, err - } - - return res.ClassNames, nil -} - -// SetStyleSheetTextParams sets the new stylesheet text. -type SetStyleSheetTextParams struct { - StyleSheetID StyleSheetID `json:"styleSheetId"` - Text string `json:"text"` -} - -// SetStyleSheetText sets the new stylesheet text. -// -// parameters: -// styleSheetID -// text -func SetStyleSheetText(styleSheetID StyleSheetID, text string) *SetStyleSheetTextParams { - return &SetStyleSheetTextParams{ - StyleSheetID: styleSheetID, - Text: text, - } -} - -// SetStyleSheetTextReturns return values. -type SetStyleSheetTextReturns struct { - SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with script (if any). -} - -// Do executes CSS.setStyleSheetText against the provided context and -// target handler. -// -// returns: -// sourceMapURL - URL of source map associated with script (if any). -func (p *SetStyleSheetTextParams) Do(ctxt context.Context, h cdp.Handler) (sourceMapURL string, err error) { - // execute - var res SetStyleSheetTextReturns - err = h.Execute(ctxt, cdp.CommandCSSSetStyleSheetText, p, &res) - if err != nil { - return "", err - } - - return res.SourceMapURL, nil -} - -// SetRuleSelectorParams modifies the rule selector. -type SetRuleSelectorParams struct { - StyleSheetID StyleSheetID `json:"styleSheetId"` - Range *SourceRange `json:"range"` - Selector string `json:"selector"` -} - -// SetRuleSelector modifies the rule selector. -// -// parameters: -// styleSheetID -// range -// selector -func SetRuleSelector(styleSheetID StyleSheetID, rangeVal *SourceRange, selector string) *SetRuleSelectorParams { - return &SetRuleSelectorParams{ - StyleSheetID: styleSheetID, - Range: rangeVal, - Selector: selector, - } -} - -// SetRuleSelectorReturns return values. -type SetRuleSelectorReturns struct { - SelectorList *SelectorList `json:"selectorList,omitempty"` // The resulting selector list after modification. -} - -// Do executes CSS.setRuleSelector against the provided context and -// target handler. -// -// returns: -// selectorList - The resulting selector list after modification. -func (p *SetRuleSelectorParams) Do(ctxt context.Context, h cdp.Handler) (selectorList *SelectorList, err error) { - // execute - var res SetRuleSelectorReturns - err = h.Execute(ctxt, cdp.CommandCSSSetRuleSelector, p, &res) - if err != nil { - return nil, err - } - - return res.SelectorList, nil +func (p *SetEffectivePropertyValueForNodeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandCSSSetEffectivePropertyValueForNode, p, nil) } // SetKeyframeKeyParams modifies the keyframe rule key text. @@ -416,44 +544,6 @@ func (p *SetKeyframeKeyParams) Do(ctxt context.Context, h cdp.Handler) (keyText return res.KeyText, nil } -// SetStyleTextsParams applies specified style edits one after another in the -// given order. -type SetStyleTextsParams struct { - Edits []*StyleDeclarationEdit `json:"edits"` -} - -// SetStyleTexts applies specified style edits one after another in the given -// order. -// -// parameters: -// edits -func SetStyleTexts(edits []*StyleDeclarationEdit) *SetStyleTextsParams { - return &SetStyleTextsParams{ - Edits: edits, - } -} - -// SetStyleTextsReturns return values. -type SetStyleTextsReturns struct { - Styles []*Style `json:"styles,omitempty"` // The resulting styles after modification. -} - -// Do executes CSS.setStyleTexts against the provided context and -// target handler. -// -// returns: -// styles - The resulting styles after modification. -func (p *SetStyleTextsParams) Do(ctxt context.Context, h cdp.Handler) (styles []*Style, err error) { - // execute - var res SetStyleTextsReturns - err = h.Execute(ctxt, cdp.CommandCSSSetStyleTexts, p, &res) - if err != nil { - return nil, err - } - - return res.Styles, nil -} - // SetMediaTextParams modifies the rule selector. type SetMediaTextParams struct { StyleSheetID StyleSheetID `json:"styleSheetId"` @@ -496,213 +586,123 @@ func (p *SetMediaTextParams) Do(ctxt context.Context, h cdp.Handler) (media *Med return res.Media, nil } -// CreateStyleSheetParams creates a new special "via-inspector" stylesheet in -// the frame with given frameId. -type CreateStyleSheetParams struct { - FrameID cdp.FrameID `json:"frameId"` // Identifier of the frame where "via-inspector" stylesheet should be created. +// SetRuleSelectorParams modifies the rule selector. +type SetRuleSelectorParams struct { + StyleSheetID StyleSheetID `json:"styleSheetId"` + Range *SourceRange `json:"range"` + Selector string `json:"selector"` } -// CreateStyleSheet creates a new special "via-inspector" stylesheet in the -// frame with given frameId. +// SetRuleSelector modifies the rule selector. // // parameters: -// frameID - Identifier of the frame where "via-inspector" stylesheet should be created. -func CreateStyleSheet(frameID cdp.FrameID) *CreateStyleSheetParams { - return &CreateStyleSheetParams{ - FrameID: frameID, +// styleSheetID +// range +// selector +func SetRuleSelector(styleSheetID StyleSheetID, rangeVal *SourceRange, selector string) *SetRuleSelectorParams { + return &SetRuleSelectorParams{ + StyleSheetID: styleSheetID, + Range: rangeVal, + Selector: selector, } } -// CreateStyleSheetReturns return values. -type CreateStyleSheetReturns struct { - StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the created "via-inspector" stylesheet. +// SetRuleSelectorReturns return values. +type SetRuleSelectorReturns struct { + SelectorList *SelectorList `json:"selectorList,omitempty"` // The resulting selector list after modification. } -// Do executes CSS.createStyleSheet against the provided context and +// Do executes CSS.setRuleSelector against the provided context and // target handler. // // returns: -// styleSheetID - Identifier of the created "via-inspector" stylesheet. -func (p *CreateStyleSheetParams) Do(ctxt context.Context, h cdp.Handler) (styleSheetID StyleSheetID, err error) { +// selectorList - The resulting selector list after modification. +func (p *SetRuleSelectorParams) Do(ctxt context.Context, h cdp.Handler) (selectorList *SelectorList, err error) { // execute - var res CreateStyleSheetReturns - err = h.Execute(ctxt, cdp.CommandCSSCreateStyleSheet, p, &res) + var res SetRuleSelectorReturns + err = h.Execute(ctxt, cdp.CommandCSSSetRuleSelector, p, &res) + if err != nil { + return nil, err + } + + return res.SelectorList, nil +} + +// SetStyleSheetTextParams sets the new stylesheet text. +type SetStyleSheetTextParams struct { + StyleSheetID StyleSheetID `json:"styleSheetId"` + Text string `json:"text"` +} + +// SetStyleSheetText sets the new stylesheet text. +// +// parameters: +// styleSheetID +// text +func SetStyleSheetText(styleSheetID StyleSheetID, text string) *SetStyleSheetTextParams { + return &SetStyleSheetTextParams{ + StyleSheetID: styleSheetID, + Text: text, + } +} + +// SetStyleSheetTextReturns return values. +type SetStyleSheetTextReturns struct { + SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with script (if any). +} + +// Do executes CSS.setStyleSheetText against the provided context and +// target handler. +// +// returns: +// sourceMapURL - URL of source map associated with script (if any). +func (p *SetStyleSheetTextParams) Do(ctxt context.Context, h cdp.Handler) (sourceMapURL string, err error) { + // execute + var res SetStyleSheetTextReturns + err = h.Execute(ctxt, cdp.CommandCSSSetStyleSheetText, p, &res) if err != nil { return "", err } - return res.StyleSheetID, nil + return res.SourceMapURL, nil } -// AddRuleParams inserts a new rule with the given ruleText in a stylesheet -// with given styleSheetId, at the position specified by location. -type AddRuleParams struct { - StyleSheetID StyleSheetID `json:"styleSheetId"` // The css style sheet identifier where a new rule should be inserted. - RuleText string `json:"ruleText"` // The text of a new rule. - Location *SourceRange `json:"location"` // Text position of a new rule in the target style sheet. +// SetStyleTextsParams applies specified style edits one after another in the +// given order. +type SetStyleTextsParams struct { + Edits []*StyleDeclarationEdit `json:"edits"` } -// AddRule inserts a new rule with the given ruleText in a stylesheet with -// given styleSheetId, at the position specified by location. +// SetStyleTexts applies specified style edits one after another in the given +// order. // // parameters: -// styleSheetID - The css style sheet identifier where a new rule should be inserted. -// ruleText - The text of a new rule. -// location - Text position of a new rule in the target style sheet. -func AddRule(styleSheetID StyleSheetID, ruleText string, location *SourceRange) *AddRuleParams { - return &AddRuleParams{ - StyleSheetID: styleSheetID, - RuleText: ruleText, - Location: location, +// edits +func SetStyleTexts(edits []*StyleDeclarationEdit) *SetStyleTextsParams { + return &SetStyleTextsParams{ + Edits: edits, } } -// AddRuleReturns return values. -type AddRuleReturns struct { - Rule *Rule `json:"rule,omitempty"` // The newly created rule. +// SetStyleTextsReturns return values. +type SetStyleTextsReturns struct { + Styles []*Style `json:"styles,omitempty"` // The resulting styles after modification. } -// Do executes CSS.addRule against the provided context and +// Do executes CSS.setStyleTexts against the provided context and // target handler. // // returns: -// rule - The newly created rule. -func (p *AddRuleParams) Do(ctxt context.Context, h cdp.Handler) (rule *Rule, err error) { +// styles - The resulting styles after modification. +func (p *SetStyleTextsParams) Do(ctxt context.Context, h cdp.Handler) (styles []*Style, err error) { // execute - var res AddRuleReturns - err = h.Execute(ctxt, cdp.CommandCSSAddRule, p, &res) + var res SetStyleTextsReturns + err = h.Execute(ctxt, cdp.CommandCSSSetStyleTexts, p, &res) if err != nil { return nil, err } - return res.Rule, nil -} - -// ForcePseudoStateParams ensures that the given node will have specified -// pseudo-classes whenever its style is computed by the browser. -type ForcePseudoStateParams struct { - NodeID cdp.NodeID `json:"nodeId"` // The element id for which to force the pseudo state. - ForcedPseudoClasses []PseudoClass `json:"forcedPseudoClasses"` // Element pseudo classes to force when computing the element's style. -} - -// ForcePseudoState ensures that the given node will have specified -// pseudo-classes whenever its style is computed by the browser. -// -// parameters: -// nodeID - The element id for which to force the pseudo state. -// forcedPseudoClasses - Element pseudo classes to force when computing the element's style. -func ForcePseudoState(nodeID cdp.NodeID, forcedPseudoClasses []PseudoClass) *ForcePseudoStateParams { - return &ForcePseudoStateParams{ - NodeID: nodeID, - ForcedPseudoClasses: forcedPseudoClasses, - } -} - -// Do executes CSS.forcePseudoState against the provided context and -// target handler. -func (p *ForcePseudoStateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandCSSForcePseudoState, p, nil) -} - -// GetMediaQueriesParams returns all media queries parsed by the rendering -// engine. -type GetMediaQueriesParams struct{} - -// GetMediaQueries returns all media queries parsed by the rendering engine. -func GetMediaQueries() *GetMediaQueriesParams { - return &GetMediaQueriesParams{} -} - -// GetMediaQueriesReturns return values. -type GetMediaQueriesReturns struct { - Medias []*Media `json:"medias,omitempty"` -} - -// Do executes CSS.getMediaQueries against the provided context and -// target handler. -// -// returns: -// medias -func (p *GetMediaQueriesParams) Do(ctxt context.Context, h cdp.Handler) (medias []*Media, err error) { - // execute - var res GetMediaQueriesReturns - err = h.Execute(ctxt, cdp.CommandCSSGetMediaQueries, nil, &res) - if err != nil { - return nil, err - } - - return res.Medias, nil -} - -// SetEffectivePropertyValueForNodeParams find a rule with the given active -// property for the given node and set the new value for this property. -type SetEffectivePropertyValueForNodeParams struct { - NodeID cdp.NodeID `json:"nodeId"` // The element id for which to set property. - PropertyName string `json:"propertyName"` - Value string `json:"value"` -} - -// SetEffectivePropertyValueForNode find a rule with the given active -// property for the given node and set the new value for this property. -// -// parameters: -// nodeID - The element id for which to set property. -// propertyName -// value -func SetEffectivePropertyValueForNode(nodeID cdp.NodeID, propertyName string, value string) *SetEffectivePropertyValueForNodeParams { - return &SetEffectivePropertyValueForNodeParams{ - NodeID: nodeID, - PropertyName: propertyName, - Value: value, - } -} - -// Do executes CSS.setEffectivePropertyValueForNode against the provided context and -// target handler. -func (p *SetEffectivePropertyValueForNodeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandCSSSetEffectivePropertyValueForNode, p, nil) -} - -// GetBackgroundColorsParams [no description]. -type GetBackgroundColorsParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get background colors for. -} - -// GetBackgroundColors [no description]. -// -// parameters: -// nodeID - Id of the node to get background colors for. -func GetBackgroundColors(nodeID cdp.NodeID) *GetBackgroundColorsParams { - return &GetBackgroundColorsParams{ - NodeID: nodeID, - } -} - -// GetBackgroundColorsReturns return values. -type GetBackgroundColorsReturns struct { - BackgroundColors []string `json:"backgroundColors,omitempty"` // The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). - ComputedFontSize string `json:"computedFontSize,omitempty"` // The computed font size for this node, as a CSS computed value string (e.g. '12px'). - ComputedFontWeight string `json:"computedFontWeight,omitempty"` // The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100'). - ComputedBodyFontSize string `json:"computedBodyFontSize,omitempty"` // The computed font size for the document body, as a computed CSS value string (e.g. '16px'). -} - -// Do executes CSS.getBackgroundColors against the provided context and -// target handler. -// -// returns: -// backgroundColors - The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). -// computedFontSize - The computed font size for this node, as a CSS computed value string (e.g. '12px'). -// computedFontWeight - The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100'). -// computedBodyFontSize - The computed font size for the document body, as a computed CSS value string (e.g. '16px'). -func (p *GetBackgroundColorsParams) Do(ctxt context.Context, h cdp.Handler) (backgroundColors []string, computedFontSize string, computedFontWeight string, computedBodyFontSize string, err error) { - // execute - var res GetBackgroundColorsReturns - err = h.Execute(ctxt, cdp.CommandCSSGetBackgroundColors, p, &res) - if err != nil { - return nil, "", "", "", err - } - - return res.BackgroundColors, res.ComputedFontSize, res.ComputedFontWeight, res.ComputedBodyFontSize, nil + return res.Styles, nil } // StartRuleUsageTrackingParams enables the selector recording. @@ -719,37 +719,6 @@ func (p *StartRuleUsageTrackingParams) Do(ctxt context.Context, h cdp.Handler) ( return h.Execute(ctxt, cdp.CommandCSSStartRuleUsageTracking, nil, nil) } -// TakeCoverageDeltaParams obtain list of rules that became used since last -// call to this method (or since start of coverage instrumentation). -type TakeCoverageDeltaParams struct{} - -// TakeCoverageDelta obtain list of rules that became used since last call to -// this method (or since start of coverage instrumentation). -func TakeCoverageDelta() *TakeCoverageDeltaParams { - return &TakeCoverageDeltaParams{} -} - -// TakeCoverageDeltaReturns return values. -type TakeCoverageDeltaReturns struct { - Coverage []*RuleUsage `json:"coverage,omitempty"` -} - -// Do executes CSS.takeCoverageDelta against the provided context and -// target handler. -// -// returns: -// coverage -func (p *TakeCoverageDeltaParams) Do(ctxt context.Context, h cdp.Handler) (coverage []*RuleUsage, err error) { - // execute - var res TakeCoverageDeltaReturns - err = h.Execute(ctxt, cdp.CommandCSSTakeCoverageDelta, nil, &res) - if err != nil { - return nil, err - } - - return res.Coverage, nil -} - // StopRuleUsageTrackingParams the list of rules with an indication of // whether these were used. type StopRuleUsageTrackingParams struct{} @@ -780,3 +749,34 @@ func (p *StopRuleUsageTrackingParams) Do(ctxt context.Context, h cdp.Handler) (r return res.RuleUsage, nil } + +// TakeCoverageDeltaParams obtain list of rules that became used since last +// call to this method (or since start of coverage instrumentation). +type TakeCoverageDeltaParams struct{} + +// TakeCoverageDelta obtain list of rules that became used since last call to +// this method (or since start of coverage instrumentation). +func TakeCoverageDelta() *TakeCoverageDeltaParams { + return &TakeCoverageDeltaParams{} +} + +// TakeCoverageDeltaReturns return values. +type TakeCoverageDeltaReturns struct { + Coverage []*RuleUsage `json:"coverage,omitempty"` +} + +// Do executes CSS.takeCoverageDelta against the provided context and +// target handler. +// +// returns: +// coverage +func (p *TakeCoverageDeltaParams) Do(ctxt context.Context, h cdp.Handler) (coverage []*RuleUsage, err error) { + // execute + var res TakeCoverageDeltaReturns + err = h.Execute(ctxt, cdp.CommandCSSTakeCoverageDelta, nil, &res) + if err != nil { + return nil, err + } + + return res.Coverage, nil +} diff --git a/cdp/css/easyjson.go b/cdp/css/easyjson.go index 165fcd4..f71ff47 100644 --- a/cdp/css/easyjson.go +++ b/cdp/css/easyjson.go @@ -5531,16 +5531,16 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss49(in *jlexer.Lexer, out *F in.Delim('[') if out.ForcedPseudoClasses == nil { if !in.IsDelim(']') { - out.ForcedPseudoClasses = make([]PseudoClass, 0, 4) + out.ForcedPseudoClasses = make([]string, 0, 4) } else { - out.ForcedPseudoClasses = []PseudoClass{} + out.ForcedPseudoClasses = []string{} } } else { out.ForcedPseudoClasses = (out.ForcedPseudoClasses)[:0] } for !in.IsDelim(']') { - var v67 PseudoClass - (v67).UnmarshalEasyJSON(in) + var v67 string + v67 = string(in.String()) out.ForcedPseudoClasses = append(out.ForcedPseudoClasses, v67) in.WantComma() } @@ -5586,7 +5586,7 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss49(out *jwriter.Writer, in if v68 > 0 { out.RawByte(',') } - (v69).MarshalEasyJSON(out) + out.String(string(v69)) } out.RawByte(']') } diff --git a/cdp/css/events.go b/cdp/css/events.go index afc1b6b..ee5c63a 100644 --- a/cdp/css/events.go +++ b/cdp/css/events.go @@ -6,13 +6,19 @@ import ( cdp "github.com/knq/chromedp/cdp" ) +// EventFontsUpdated fires whenever a web font gets loaded. +type EventFontsUpdated struct{} + // EventMediaQueryResultChanged fires whenever a MediaQuery result changes // (for example, after a browser window has been resized.) The current // implementation considers only viewport-dependent media features. type EventMediaQueryResultChanged struct{} -// EventFontsUpdated fires whenever a web font gets loaded. -type EventFontsUpdated struct{} +// EventStyleSheetAdded fired whenever an active document stylesheet is +// added. +type EventStyleSheetAdded struct { + Header *StyleSheetHeader `json:"header"` // Added stylesheet metainfo. +} // EventStyleSheetChanged fired whenever a stylesheet is changed as a result // of the client operation. @@ -20,12 +26,6 @@ type EventStyleSheetChanged struct { StyleSheetID StyleSheetID `json:"styleSheetId"` } -// EventStyleSheetAdded fired whenever an active document stylesheet is -// added. -type EventStyleSheetAdded struct { - Header *StyleSheetHeader `json:"header"` // Added stylesheet metainfo. -} - // EventStyleSheetRemoved fired whenever an active document stylesheet is // removed. type EventStyleSheetRemoved struct { @@ -34,9 +34,9 @@ type EventStyleSheetRemoved struct { // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventCSSMediaQueryResultChanged, cdp.EventCSSFontsUpdated, - cdp.EventCSSStyleSheetChanged, + cdp.EventCSSMediaQueryResultChanged, cdp.EventCSSStyleSheetAdded, + cdp.EventCSSStyleSheetChanged, cdp.EventCSSStyleSheetRemoved, } diff --git a/cdp/css/types.go b/cdp/css/types.go index c23e6a3..386114b 100644 --- a/cdp/css/types.go +++ b/cdp/css/types.go @@ -283,51 +283,3 @@ func (t *MediaSource) UnmarshalEasyJSON(in *jlexer.Lexer) { func (t *MediaSource) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } - -// PseudoClass [no description]. -type PseudoClass string - -// String returns the PseudoClass as string value. -func (t PseudoClass) String() string { - return string(t) -} - -// PseudoClass values. -const ( - PseudoClassActive PseudoClass = "active" - PseudoClassFocus PseudoClass = "focus" - PseudoClassHover PseudoClass = "hover" - PseudoClassVisited PseudoClass = "visited" -) - -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t PseudoClass) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t PseudoClass) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *PseudoClass) UnmarshalEasyJSON(in *jlexer.Lexer) { - switch PseudoClass(in.String()) { - case PseudoClassActive: - *t = PseudoClassActive - case PseudoClassFocus: - *t = PseudoClassFocus - case PseudoClassHover: - *t = PseudoClassHover - case PseudoClassVisited: - *t = PseudoClassVisited - - default: - in.AddError(errors.New("unknown PseudoClass value")) - } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *PseudoClass) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} diff --git a/cdp/database/database.go b/cdp/database/database.go index 6156491..b7480f2 100644 --- a/cdp/database/database.go +++ b/cdp/database/database.go @@ -13,22 +13,6 @@ import ( "github.com/mailru/easyjson" ) -// EnableParams enables database tracking, database events will now be -// delivered to the client. -type EnableParams struct{} - -// Enable enables database tracking, database events will now be delivered to -// the client. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Database.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDatabaseEnable, nil, nil) -} - // DisableParams disables database tracking, prevents database events from // being sent to the client. type DisableParams struct{} @@ -45,40 +29,20 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandDatabaseDisable, nil, nil) } -// GetDatabaseTableNamesParams [no description]. -type GetDatabaseTableNamesParams struct { - DatabaseID ID `json:"databaseId"` +// EnableParams enables database tracking, database events will now be +// delivered to the client. +type EnableParams struct{} + +// Enable enables database tracking, database events will now be delivered to +// the client. +func Enable() *EnableParams { + return &EnableParams{} } -// GetDatabaseTableNames [no description]. -// -// parameters: -// databaseID -func GetDatabaseTableNames(databaseID ID) *GetDatabaseTableNamesParams { - return &GetDatabaseTableNamesParams{ - DatabaseID: databaseID, - } -} - -// GetDatabaseTableNamesReturns return values. -type GetDatabaseTableNamesReturns struct { - TableNames []string `json:"tableNames,omitempty"` -} - -// Do executes Database.getDatabaseTableNames against the provided context and +// Do executes Database.enable against the provided context and // target handler. -// -// returns: -// tableNames -func (p *GetDatabaseTableNamesParams) Do(ctxt context.Context, h cdp.Handler) (tableNames []string, err error) { - // execute - var res GetDatabaseTableNamesReturns - err = h.Execute(ctxt, cdp.CommandDatabaseGetDatabaseTableNames, p, &res) - if err != nil { - return nil, err - } - - return res.TableNames, nil +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDatabaseEnable, nil, nil) } // ExecuteSQLParams [no description]. @@ -123,3 +87,39 @@ func (p *ExecuteSQLParams) Do(ctxt context.Context, h cdp.Handler) (columnNames return res.ColumnNames, res.Values, res.SQLError, nil } + +// GetDatabaseTableNamesParams [no description]. +type GetDatabaseTableNamesParams struct { + DatabaseID ID `json:"databaseId"` +} + +// GetDatabaseTableNames [no description]. +// +// parameters: +// databaseID +func GetDatabaseTableNames(databaseID ID) *GetDatabaseTableNamesParams { + return &GetDatabaseTableNamesParams{ + DatabaseID: databaseID, + } +} + +// GetDatabaseTableNamesReturns return values. +type GetDatabaseTableNamesReturns struct { + TableNames []string `json:"tableNames,omitempty"` +} + +// Do executes Database.getDatabaseTableNames against the provided context and +// target handler. +// +// returns: +// tableNames +func (p *GetDatabaseTableNamesParams) Do(ctxt context.Context, h cdp.Handler) (tableNames []string, err error) { + // execute + var res GetDatabaseTableNamesReturns + err = h.Execute(ctxt, cdp.CommandDatabaseGetDatabaseTableNames, p, &res) + if err != nil { + return nil, err + } + + return res.TableNames, nil +} diff --git a/cdp/debugger/debugger.go b/cdp/debugger/debugger.go index b067f27..c9c2a69 100644 --- a/cdp/debugger/debugger.go +++ b/cdp/debugger/debugger.go @@ -17,6 +17,49 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) +// ContinueToLocationParams continues execution until specific location is +// reached. +type ContinueToLocationParams struct { + Location *Location `json:"location"` // Location to continue to. + TargetCallFrames ContinueToLocationTargetCallFrames `json:"targetCallFrames,omitempty"` +} + +// ContinueToLocation continues execution until specific location is reached. +// +// parameters: +// location - Location to continue to. +func ContinueToLocation(location *Location) *ContinueToLocationParams { + return &ContinueToLocationParams{ + Location: location, + } +} + +// WithTargetCallFrames [no description]. +func (p ContinueToLocationParams) WithTargetCallFrames(targetCallFrames ContinueToLocationTargetCallFrames) *ContinueToLocationParams { + p.TargetCallFrames = targetCallFrames + return &p +} + +// Do executes Debugger.continueToLocation against the provided context and +// target handler. +func (p *ContinueToLocationParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerContinueToLocation, p, nil) +} + +// DisableParams disables debugger for given page. +type DisableParams struct{} + +// Disable disables debugger for given page. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes Debugger.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerDisable, nil, nil) +} + // EnableParams enables debugger for the given page. Clients should not // assume that the debugging has been enabled until the result for this command // is received. @@ -49,670 +92,6 @@ func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (debuggerID runti return res.DebuggerID, nil } -// DisableParams disables debugger for given page. -type DisableParams struct{} - -// Disable disables debugger for given page. -func Disable() *DisableParams { - return &DisableParams{} -} - -// Do executes Debugger.disable against the provided context and -// target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerDisable, nil, nil) -} - -// SetBreakpointsActiveParams activates / deactivates all breakpoints on the -// page. -type SetBreakpointsActiveParams struct { - Active bool `json:"active"` // New value for breakpoints active state. -} - -// SetBreakpointsActive activates / deactivates all breakpoints on the page. -// -// parameters: -// active - New value for breakpoints active state. -func SetBreakpointsActive(active bool) *SetBreakpointsActiveParams { - return &SetBreakpointsActiveParams{ - Active: active, - } -} - -// Do executes Debugger.setBreakpointsActive against the provided context and -// target handler. -func (p *SetBreakpointsActiveParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerSetBreakpointsActive, p, nil) -} - -// SetSkipAllPausesParams makes page not interrupt on any pauses (breakpoint, -// exception, dom exception etc). -type SetSkipAllPausesParams struct { - Skip bool `json:"skip"` // New value for skip pauses state. -} - -// SetSkipAllPauses makes page not interrupt on any pauses (breakpoint, -// exception, dom exception etc). -// -// parameters: -// skip - New value for skip pauses state. -func SetSkipAllPauses(skip bool) *SetSkipAllPausesParams { - return &SetSkipAllPausesParams{ - Skip: skip, - } -} - -// Do executes Debugger.setSkipAllPauses against the provided context and -// target handler. -func (p *SetSkipAllPausesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerSetSkipAllPauses, p, nil) -} - -// SetBreakpointByURLParams sets JavaScript breakpoint at given location -// specified either by URL or URL regex. Once this command is issued, all -// existing parsed scripts will have breakpoints resolved and returned in -// locations property. Further matching script parsing will result in subsequent -// breakpointResolved events issued. This logical breakpoint will survive page -// reloads. -type SetBreakpointByURLParams struct { - LineNumber int64 `json:"lineNumber"` // Line number to set breakpoint at. - URL string `json:"url,omitempty"` // URL of the resources to set breakpoint on. - URLRegex string `json:"urlRegex,omitempty"` // Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - ScriptHash string `json:"scriptHash,omitempty"` // Script hash of the resources to set breakpoint on. - ColumnNumber int64 `json:"columnNumber,omitempty"` // Offset in the line to set breakpoint at. - Condition string `json:"condition,omitempty"` // Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. -} - -// SetBreakpointByURL sets JavaScript breakpoint at given location specified -// either by URL or URL regex. Once this command is issued, all existing parsed -// scripts will have breakpoints resolved and returned in locations property. -// Further matching script parsing will result in subsequent breakpointResolved -// events issued. This logical breakpoint will survive page reloads. -// -// parameters: -// lineNumber - Line number to set breakpoint at. -func SetBreakpointByURL(lineNumber int64) *SetBreakpointByURLParams { - return &SetBreakpointByURLParams{ - LineNumber: lineNumber, - } -} - -// WithURL URL of the resources to set breakpoint on. -func (p SetBreakpointByURLParams) WithURL(url string) *SetBreakpointByURLParams { - p.URL = url - return &p -} - -// WithURLRegex regex pattern for the URLs of the resources to set -// breakpoints on. Either url or urlRegex must be specified. -func (p SetBreakpointByURLParams) WithURLRegex(urlRegex string) *SetBreakpointByURLParams { - p.URLRegex = urlRegex - return &p -} - -// WithScriptHash script hash of the resources to set breakpoint on. -func (p SetBreakpointByURLParams) WithScriptHash(scriptHash string) *SetBreakpointByURLParams { - p.ScriptHash = scriptHash - return &p -} - -// WithColumnNumber offset in the line to set breakpoint at. -func (p SetBreakpointByURLParams) WithColumnNumber(columnNumber int64) *SetBreakpointByURLParams { - p.ColumnNumber = columnNumber - return &p -} - -// WithCondition expression to use as a breakpoint condition. When specified, -// debugger will only stop on the breakpoint if this expression evaluates to -// true. -func (p SetBreakpointByURLParams) WithCondition(condition string) *SetBreakpointByURLParams { - p.Condition = condition - return &p -} - -// SetBreakpointByURLReturns return values. -type SetBreakpointByURLReturns struct { - BreakpointID BreakpointID `json:"breakpointId,omitempty"` // Id of the created breakpoint for further reference. - Locations []*Location `json:"locations,omitempty"` // List of the locations this breakpoint resolved into upon addition. -} - -// Do executes Debugger.setBreakpointByUrl against the provided context and -// target handler. -// -// returns: -// breakpointID - Id of the created breakpoint for further reference. -// locations - List of the locations this breakpoint resolved into upon addition. -func (p *SetBreakpointByURLParams) Do(ctxt context.Context, h cdp.Handler) (breakpointID BreakpointID, locations []*Location, err error) { - // execute - var res SetBreakpointByURLReturns - err = h.Execute(ctxt, cdp.CommandDebuggerSetBreakpointByURL, p, &res) - if err != nil { - return "", nil, err - } - - return res.BreakpointID, res.Locations, nil -} - -// SetBreakpointParams sets JavaScript breakpoint at a given location. -type SetBreakpointParams struct { - Location *Location `json:"location"` // Location to set breakpoint in. - Condition string `json:"condition,omitempty"` // Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. -} - -// SetBreakpoint sets JavaScript breakpoint at a given location. -// -// parameters: -// location - Location to set breakpoint in. -func SetBreakpoint(location *Location) *SetBreakpointParams { - return &SetBreakpointParams{ - Location: location, - } -} - -// WithCondition expression to use as a breakpoint condition. When specified, -// debugger will only stop on the breakpoint if this expression evaluates to -// true. -func (p SetBreakpointParams) WithCondition(condition string) *SetBreakpointParams { - p.Condition = condition - return &p -} - -// SetBreakpointReturns return values. -type SetBreakpointReturns struct { - BreakpointID BreakpointID `json:"breakpointId,omitempty"` // Id of the created breakpoint for further reference. - ActualLocation *Location `json:"actualLocation,omitempty"` // Location this breakpoint resolved into. -} - -// Do executes Debugger.setBreakpoint against the provided context and -// target handler. -// -// returns: -// breakpointID - Id of the created breakpoint for further reference. -// actualLocation - Location this breakpoint resolved into. -func (p *SetBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (breakpointID BreakpointID, actualLocation *Location, err error) { - // execute - var res SetBreakpointReturns - err = h.Execute(ctxt, cdp.CommandDebuggerSetBreakpoint, p, &res) - if err != nil { - return "", nil, err - } - - return res.BreakpointID, res.ActualLocation, nil -} - -// RemoveBreakpointParams removes JavaScript breakpoint. -type RemoveBreakpointParams struct { - BreakpointID BreakpointID `json:"breakpointId"` -} - -// RemoveBreakpoint removes JavaScript breakpoint. -// -// parameters: -// breakpointID -func RemoveBreakpoint(breakpointID BreakpointID) *RemoveBreakpointParams { - return &RemoveBreakpointParams{ - BreakpointID: breakpointID, - } -} - -// Do executes Debugger.removeBreakpoint against the provided context and -// target handler. -func (p *RemoveBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerRemoveBreakpoint, p, nil) -} - -// GetPossibleBreakpointsParams returns possible locations for breakpoint. -// scriptId in start and end range locations should be the same. -type GetPossibleBreakpointsParams struct { - Start *Location `json:"start"` // Start of range to search possible breakpoint locations in. - End *Location `json:"end,omitempty"` // End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - RestrictToFunction bool `json:"restrictToFunction,omitempty"` // Only consider locations which are in the same (non-nested) function as start. -} - -// GetPossibleBreakpoints returns possible locations for breakpoint. scriptId -// in start and end range locations should be the same. -// -// parameters: -// start - Start of range to search possible breakpoint locations in. -func GetPossibleBreakpoints(start *Location) *GetPossibleBreakpointsParams { - return &GetPossibleBreakpointsParams{ - Start: start, - } -} - -// WithEnd end of range to search possible breakpoint locations in -// (excluding). When not specified, end of scripts is used as end of range. -func (p GetPossibleBreakpointsParams) WithEnd(end *Location) *GetPossibleBreakpointsParams { - p.End = end - return &p -} - -// WithRestrictToFunction only consider locations which are in the same -// (non-nested) function as start. -func (p GetPossibleBreakpointsParams) WithRestrictToFunction(restrictToFunction bool) *GetPossibleBreakpointsParams { - p.RestrictToFunction = restrictToFunction - return &p -} - -// GetPossibleBreakpointsReturns return values. -type GetPossibleBreakpointsReturns struct { - Locations []*BreakLocation `json:"locations,omitempty"` // List of the possible breakpoint locations. -} - -// Do executes Debugger.getPossibleBreakpoints against the provided context and -// target handler. -// -// returns: -// locations - List of the possible breakpoint locations. -func (p *GetPossibleBreakpointsParams) Do(ctxt context.Context, h cdp.Handler) (locations []*BreakLocation, err error) { - // execute - var res GetPossibleBreakpointsReturns - err = h.Execute(ctxt, cdp.CommandDebuggerGetPossibleBreakpoints, p, &res) - if err != nil { - return nil, err - } - - return res.Locations, nil -} - -// ContinueToLocationParams continues execution until specific location is -// reached. -type ContinueToLocationParams struct { - Location *Location `json:"location"` // Location to continue to. - TargetCallFrames ContinueToLocationTargetCallFrames `json:"targetCallFrames,omitempty"` -} - -// ContinueToLocation continues execution until specific location is reached. -// -// parameters: -// location - Location to continue to. -func ContinueToLocation(location *Location) *ContinueToLocationParams { - return &ContinueToLocationParams{ - Location: location, - } -} - -// WithTargetCallFrames [no description]. -func (p ContinueToLocationParams) WithTargetCallFrames(targetCallFrames ContinueToLocationTargetCallFrames) *ContinueToLocationParams { - p.TargetCallFrames = targetCallFrames - return &p -} - -// Do executes Debugger.continueToLocation against the provided context and -// target handler. -func (p *ContinueToLocationParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerContinueToLocation, p, nil) -} - -// PauseOnAsyncCallParams [no description]. -type PauseOnAsyncCallParams struct { - ParentStackTraceID *runtime.StackTraceID `json:"parentStackTraceId"` // Debugger will pause when async call with given stack trace is started. -} - -// PauseOnAsyncCall [no description]. -// -// parameters: -// parentStackTraceID - Debugger will pause when async call with given stack trace is started. -func PauseOnAsyncCall(parentStackTraceID *runtime.StackTraceID) *PauseOnAsyncCallParams { - return &PauseOnAsyncCallParams{ - ParentStackTraceID: parentStackTraceID, - } -} - -// Do executes Debugger.pauseOnAsyncCall against the provided context and -// target handler. -func (p *PauseOnAsyncCallParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerPauseOnAsyncCall, p, nil) -} - -// StepOverParams steps over the statement. -type StepOverParams struct{} - -// StepOver steps over the statement. -func StepOver() *StepOverParams { - return &StepOverParams{} -} - -// Do executes Debugger.stepOver against the provided context and -// target handler. -func (p *StepOverParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerStepOver, nil, nil) -} - -// StepIntoParams steps into the function call. -type StepIntoParams struct { - BreakOnAsyncCall bool `json:"breakOnAsyncCall,omitempty"` // Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. -} - -// StepInto steps into the function call. -// -// parameters: -func StepInto() *StepIntoParams { - return &StepIntoParams{} -} - -// WithBreakOnAsyncCall debugger will issue additional Debugger.paused -// notification if any async task is scheduled before next pause. -func (p StepIntoParams) WithBreakOnAsyncCall(breakOnAsyncCall bool) *StepIntoParams { - p.BreakOnAsyncCall = breakOnAsyncCall - return &p -} - -// Do executes Debugger.stepInto against the provided context and -// target handler. -func (p *StepIntoParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerStepInto, p, nil) -} - -// StepOutParams steps out of the function call. -type StepOutParams struct{} - -// StepOut steps out of the function call. -func StepOut() *StepOutParams { - return &StepOutParams{} -} - -// Do executes Debugger.stepOut against the provided context and -// target handler. -func (p *StepOutParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerStepOut, nil, nil) -} - -// PauseParams stops on the next JavaScript statement. -type PauseParams struct{} - -// Pause stops on the next JavaScript statement. -func Pause() *PauseParams { - return &PauseParams{} -} - -// Do executes Debugger.pause against the provided context and -// target handler. -func (p *PauseParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerPause, nil, nil) -} - -// ScheduleStepIntoAsyncParams this method is deprecated - use -// Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask -// instead. Steps into next scheduled async task if any is scheduled before next -// pause. Returns success when async task is actually scheduled, returns error -// if no task were scheduled or another scheduleStepIntoAsync was called. -type ScheduleStepIntoAsyncParams struct{} - -// ScheduleStepIntoAsync this method is deprecated - use Debugger.stepInto -// with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next -// scheduled async task if any is scheduled before next pause. Returns success -// when async task is actually scheduled, returns error if no task were -// scheduled or another scheduleStepIntoAsync was called. -func ScheduleStepIntoAsync() *ScheduleStepIntoAsyncParams { - return &ScheduleStepIntoAsyncParams{} -} - -// Do executes Debugger.scheduleStepIntoAsync against the provided context and -// target handler. -func (p *ScheduleStepIntoAsyncParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerScheduleStepIntoAsync, nil, nil) -} - -// ResumeParams resumes JavaScript execution. -type ResumeParams struct{} - -// Resume resumes JavaScript execution. -func Resume() *ResumeParams { - return &ResumeParams{} -} - -// Do executes Debugger.resume against the provided context and -// target handler. -func (p *ResumeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerResume, nil, nil) -} - -// GetStackTraceParams returns stack trace with given stackTraceId. -type GetStackTraceParams struct { - StackTraceID *runtime.StackTraceID `json:"stackTraceId"` -} - -// GetStackTrace returns stack trace with given stackTraceId. -// -// parameters: -// stackTraceID -func GetStackTrace(stackTraceID *runtime.StackTraceID) *GetStackTraceParams { - return &GetStackTraceParams{ - StackTraceID: stackTraceID, - } -} - -// GetStackTraceReturns return values. -type GetStackTraceReturns struct { - StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` -} - -// Do executes Debugger.getStackTrace against the provided context and -// target handler. -// -// returns: -// stackTrace -func (p *GetStackTraceParams) Do(ctxt context.Context, h cdp.Handler) (stackTrace *runtime.StackTrace, err error) { - // execute - var res GetStackTraceReturns - err = h.Execute(ctxt, cdp.CommandDebuggerGetStackTrace, p, &res) - if err != nil { - return nil, err - } - - return res.StackTrace, nil -} - -// SearchInContentParams searches for given string in script content. -type SearchInContentParams struct { - ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script 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. -} - -// SearchInContent searches for given string in script content. -// -// parameters: -// scriptID - Id of the script to search in. -// query - String to search for. -func SearchInContent(scriptID runtime.ScriptID, query string) *SearchInContentParams { - return &SearchInContentParams{ - ScriptID: scriptID, - Query: query, - } -} - -// WithCaseSensitive if true, search is case sensitive. -func (p SearchInContentParams) WithCaseSensitive(caseSensitive bool) *SearchInContentParams { - p.CaseSensitive = caseSensitive - return &p -} - -// WithIsRegex if true, treats string parameter as regex. -func (p SearchInContentParams) WithIsRegex(isRegex bool) *SearchInContentParams { - p.IsRegex = isRegex - return &p -} - -// SearchInContentReturns return values. -type SearchInContentReturns struct { - Result []*SearchMatch `json:"result,omitempty"` // List of search matches. -} - -// Do executes Debugger.searchInContent against the provided context and -// target handler. -// -// returns: -// result - List of search matches. -func (p *SearchInContentParams) Do(ctxt context.Context, h cdp.Handler) (result []*SearchMatch, err error) { - // execute - var res SearchInContentReturns - err = h.Execute(ctxt, cdp.CommandDebuggerSearchInContent, p, &res) - if err != nil { - return nil, err - } - - return res.Result, nil -} - -// SetScriptSourceParams edits JavaScript source live. -type SetScriptSourceParams struct { - ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script to edit. - ScriptSource string `json:"scriptSource"` // New content of the script. - DryRun bool `json:"dryRun,omitempty"` // If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. -} - -// SetScriptSource edits JavaScript source live. -// -// parameters: -// scriptID - Id of the script to edit. -// scriptSource - New content of the script. -func SetScriptSource(scriptID runtime.ScriptID, scriptSource string) *SetScriptSourceParams { - return &SetScriptSourceParams{ - ScriptID: scriptID, - ScriptSource: scriptSource, - } -} - -// WithDryRun if true the change will not actually be applied. Dry run may be -// used to get result description without actually modifying the code. -func (p SetScriptSourceParams) WithDryRun(dryRun bool) *SetScriptSourceParams { - p.DryRun = dryRun - return &p -} - -// SetScriptSourceReturns return values. -type SetScriptSourceReturns struct { - CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace in case editing has happened while VM was stopped. - StackChanged bool `json:"stackChanged,omitempty"` // Whether current call stack was modified after applying the changes. - AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any. - AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any. - ExceptionDetails *runtime.ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details if any. -} - -// Do executes Debugger.setScriptSource against the provided context and -// target handler. -// -// returns: -// callFrames - New stack trace in case editing has happened while VM was stopped. -// stackChanged - Whether current call stack was modified after applying the changes. -// asyncStackTrace - Async stack trace, if any. -// asyncStackTraceID - Async stack trace, if any. -// exceptionDetails - Exception details if any. -func (p *SetScriptSourceParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, stackChanged bool, asyncStackTrace *runtime.StackTrace, asyncStackTraceID *runtime.StackTraceID, exceptionDetails *runtime.ExceptionDetails, err error) { - // execute - var res SetScriptSourceReturns - err = h.Execute(ctxt, cdp.CommandDebuggerSetScriptSource, p, &res) - if err != nil { - return nil, false, nil, nil, nil, err - } - - return res.CallFrames, res.StackChanged, res.AsyncStackTrace, res.AsyncStackTraceID, res.ExceptionDetails, nil -} - -// RestartFrameParams restarts particular call frame from the beginning. -type RestartFrameParams struct { - CallFrameID CallFrameID `json:"callFrameId"` // Call frame identifier to evaluate on. -} - -// RestartFrame restarts particular call frame from the beginning. -// -// parameters: -// callFrameID - Call frame identifier to evaluate on. -func RestartFrame(callFrameID CallFrameID) *RestartFrameParams { - return &RestartFrameParams{ - CallFrameID: callFrameID, - } -} - -// RestartFrameReturns return values. -type RestartFrameReturns struct { - CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace. - AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any. - AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any. -} - -// Do executes Debugger.restartFrame against the provided context and -// target handler. -// -// returns: -// callFrames - New stack trace. -// asyncStackTrace - Async stack trace, if any. -// asyncStackTraceID - Async stack trace, if any. -func (p *RestartFrameParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, asyncStackTrace *runtime.StackTrace, asyncStackTraceID *runtime.StackTraceID, err error) { - // execute - var res RestartFrameReturns - err = h.Execute(ctxt, cdp.CommandDebuggerRestartFrame, p, &res) - if err != nil { - return nil, nil, nil, err - } - - return res.CallFrames, res.AsyncStackTrace, res.AsyncStackTraceID, nil -} - -// GetScriptSourceParams returns source for the script with given id. -type GetScriptSourceParams struct { - ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script to get source for. -} - -// GetScriptSource returns source for the script with given id. -// -// parameters: -// scriptID - Id of the script to get source for. -func GetScriptSource(scriptID runtime.ScriptID) *GetScriptSourceParams { - return &GetScriptSourceParams{ - ScriptID: scriptID, - } -} - -// GetScriptSourceReturns return values. -type GetScriptSourceReturns struct { - ScriptSource string `json:"scriptSource,omitempty"` // Script source. -} - -// Do executes Debugger.getScriptSource against the provided context and -// target handler. -// -// returns: -// scriptSource - Script source. -func (p *GetScriptSourceParams) Do(ctxt context.Context, h cdp.Handler) (scriptSource string, err error) { - // execute - var res GetScriptSourceReturns - err = h.Execute(ctxt, cdp.CommandDebuggerGetScriptSource, p, &res) - if err != nil { - return "", err - } - - return res.ScriptSource, nil -} - -// SetPauseOnExceptionsParams defines pause on exceptions state. Can be set -// to stop on all exceptions, uncaught exceptions or no exceptions. Initial -// pause on exceptions state is none. -type SetPauseOnExceptionsParams struct { - State ExceptionsState `json:"state"` // Pause on exceptions mode. -} - -// SetPauseOnExceptions defines pause on exceptions state. Can be set to stop -// on all exceptions, uncaught exceptions or no exceptions. Initial pause on -// exceptions state is none. -// -// parameters: -// state - Pause on exceptions mode. -func SetPauseOnExceptions(state ExceptionsState) *SetPauseOnExceptionsParams { - return &SetPauseOnExceptionsParams{ - State: state, - } -} - -// Do executes Debugger.setPauseOnExceptions against the provided context and -// target handler. -func (p *SetPauseOnExceptionsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerSetPauseOnExceptions, p, nil) -} - // EvaluateOnCallFrameParams evaluates expression on a given call frame. type EvaluateOnCallFrameParams struct { CallFrameID CallFrameID `json:"callFrameId"` // Call frame identifier to evaluate on. @@ -801,59 +180,315 @@ func (p *EvaluateOnCallFrameParams) Do(ctxt context.Context, h cdp.Handler) (res return res.Result, res.ExceptionDetails, nil } -// SetVariableValueParams changes value of variable in a callframe. -// Object-based scopes are not supported and must be mutated manually. -type SetVariableValueParams struct { - ScopeNumber int64 `json:"scopeNumber"` // 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - VariableName string `json:"variableName"` // Variable name. - NewValue *runtime.CallArgument `json:"newValue"` // New variable value. - CallFrameID CallFrameID `json:"callFrameId"` // Id of callframe that holds variable. +// GetPossibleBreakpointsParams returns possible locations for breakpoint. +// scriptId in start and end range locations should be the same. +type GetPossibleBreakpointsParams struct { + Start *Location `json:"start"` // Start of range to search possible breakpoint locations in. + End *Location `json:"end,omitempty"` // End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + RestrictToFunction bool `json:"restrictToFunction,omitempty"` // Only consider locations which are in the same (non-nested) function as start. } -// SetVariableValue changes value of variable in a callframe. Object-based -// scopes are not supported and must be mutated manually. +// GetPossibleBreakpoints returns possible locations for breakpoint. scriptId +// in start and end range locations should be the same. // // parameters: -// scopeNumber - 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. -// variableName - Variable name. -// newValue - New variable value. -// callFrameID - Id of callframe that holds variable. -func SetVariableValue(scopeNumber int64, variableName string, newValue *runtime.CallArgument, callFrameID CallFrameID) *SetVariableValueParams { - return &SetVariableValueParams{ - ScopeNumber: scopeNumber, - VariableName: variableName, - NewValue: newValue, - CallFrameID: callFrameID, +// start - Start of range to search possible breakpoint locations in. +func GetPossibleBreakpoints(start *Location) *GetPossibleBreakpointsParams { + return &GetPossibleBreakpointsParams{ + Start: start, } } -// Do executes Debugger.setVariableValue against the provided context and +// WithEnd end of range to search possible breakpoint locations in +// (excluding). When not specified, end of scripts is used as end of range. +func (p GetPossibleBreakpointsParams) WithEnd(end *Location) *GetPossibleBreakpointsParams { + p.End = end + return &p +} + +// WithRestrictToFunction only consider locations which are in the same +// (non-nested) function as start. +func (p GetPossibleBreakpointsParams) WithRestrictToFunction(restrictToFunction bool) *GetPossibleBreakpointsParams { + p.RestrictToFunction = restrictToFunction + return &p +} + +// GetPossibleBreakpointsReturns return values. +type GetPossibleBreakpointsReturns struct { + Locations []*BreakLocation `json:"locations,omitempty"` // List of the possible breakpoint locations. +} + +// Do executes Debugger.getPossibleBreakpoints against the provided context and // target handler. -func (p *SetVariableValueParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerSetVariableValue, p, nil) +// +// returns: +// locations - List of the possible breakpoint locations. +func (p *GetPossibleBreakpointsParams) Do(ctxt context.Context, h cdp.Handler) (locations []*BreakLocation, err error) { + // execute + var res GetPossibleBreakpointsReturns + err = h.Execute(ctxt, cdp.CommandDebuggerGetPossibleBreakpoints, p, &res) + if err != nil { + return nil, err + } + + return res.Locations, nil } -// SetReturnValueParams changes return value in top frame. Available only at -// return break position. -type SetReturnValueParams struct { - NewValue *runtime.CallArgument `json:"newValue"` // New return value. +// GetScriptSourceParams returns source for the script with given id. +type GetScriptSourceParams struct { + ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script to get source for. } -// SetReturnValue changes return value in top frame. Available only at return -// break position. +// GetScriptSource returns source for the script with given id. // // parameters: -// newValue - New return value. -func SetReturnValue(newValue *runtime.CallArgument) *SetReturnValueParams { - return &SetReturnValueParams{ - NewValue: newValue, +// scriptID - Id of the script to get source for. +func GetScriptSource(scriptID runtime.ScriptID) *GetScriptSourceParams { + return &GetScriptSourceParams{ + ScriptID: scriptID, } } -// Do executes Debugger.setReturnValue against the provided context and +// GetScriptSourceReturns return values. +type GetScriptSourceReturns struct { + ScriptSource string `json:"scriptSource,omitempty"` // Script source. +} + +// Do executes Debugger.getScriptSource against the provided context and // target handler. -func (p *SetReturnValueParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDebuggerSetReturnValue, p, nil) +// +// returns: +// scriptSource - Script source. +func (p *GetScriptSourceParams) Do(ctxt context.Context, h cdp.Handler) (scriptSource string, err error) { + // execute + var res GetScriptSourceReturns + err = h.Execute(ctxt, cdp.CommandDebuggerGetScriptSource, p, &res) + if err != nil { + return "", err + } + + return res.ScriptSource, nil +} + +// GetStackTraceParams returns stack trace with given stackTraceId. +type GetStackTraceParams struct { + StackTraceID *runtime.StackTraceID `json:"stackTraceId"` +} + +// GetStackTrace returns stack trace with given stackTraceId. +// +// parameters: +// stackTraceID +func GetStackTrace(stackTraceID *runtime.StackTraceID) *GetStackTraceParams { + return &GetStackTraceParams{ + StackTraceID: stackTraceID, + } +} + +// GetStackTraceReturns return values. +type GetStackTraceReturns struct { + StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` +} + +// Do executes Debugger.getStackTrace against the provided context and +// target handler. +// +// returns: +// stackTrace +func (p *GetStackTraceParams) Do(ctxt context.Context, h cdp.Handler) (stackTrace *runtime.StackTrace, err error) { + // execute + var res GetStackTraceReturns + err = h.Execute(ctxt, cdp.CommandDebuggerGetStackTrace, p, &res) + if err != nil { + return nil, err + } + + return res.StackTrace, nil +} + +// PauseParams stops on the next JavaScript statement. +type PauseParams struct{} + +// Pause stops on the next JavaScript statement. +func Pause() *PauseParams { + return &PauseParams{} +} + +// Do executes Debugger.pause against the provided context and +// target handler. +func (p *PauseParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerPause, nil, nil) +} + +// PauseOnAsyncCallParams [no description]. +type PauseOnAsyncCallParams struct { + ParentStackTraceID *runtime.StackTraceID `json:"parentStackTraceId"` // Debugger will pause when async call with given stack trace is started. +} + +// PauseOnAsyncCall [no description]. +// +// parameters: +// parentStackTraceID - Debugger will pause when async call with given stack trace is started. +func PauseOnAsyncCall(parentStackTraceID *runtime.StackTraceID) *PauseOnAsyncCallParams { + return &PauseOnAsyncCallParams{ + ParentStackTraceID: parentStackTraceID, + } +} + +// Do executes Debugger.pauseOnAsyncCall against the provided context and +// target handler. +func (p *PauseOnAsyncCallParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerPauseOnAsyncCall, p, nil) +} + +// RemoveBreakpointParams removes JavaScript breakpoint. +type RemoveBreakpointParams struct { + BreakpointID BreakpointID `json:"breakpointId"` +} + +// RemoveBreakpoint removes JavaScript breakpoint. +// +// parameters: +// breakpointID +func RemoveBreakpoint(breakpointID BreakpointID) *RemoveBreakpointParams { + return &RemoveBreakpointParams{ + BreakpointID: breakpointID, + } +} + +// Do executes Debugger.removeBreakpoint against the provided context and +// target handler. +func (p *RemoveBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerRemoveBreakpoint, p, nil) +} + +// RestartFrameParams restarts particular call frame from the beginning. +type RestartFrameParams struct { + CallFrameID CallFrameID `json:"callFrameId"` // Call frame identifier to evaluate on. +} + +// RestartFrame restarts particular call frame from the beginning. +// +// parameters: +// callFrameID - Call frame identifier to evaluate on. +func RestartFrame(callFrameID CallFrameID) *RestartFrameParams { + return &RestartFrameParams{ + CallFrameID: callFrameID, + } +} + +// RestartFrameReturns return values. +type RestartFrameReturns struct { + CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace. + AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any. + AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any. +} + +// Do executes Debugger.restartFrame against the provided context and +// target handler. +// +// returns: +// callFrames - New stack trace. +// asyncStackTrace - Async stack trace, if any. +// asyncStackTraceID - Async stack trace, if any. +func (p *RestartFrameParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, asyncStackTrace *runtime.StackTrace, asyncStackTraceID *runtime.StackTraceID, err error) { + // execute + var res RestartFrameReturns + err = h.Execute(ctxt, cdp.CommandDebuggerRestartFrame, p, &res) + if err != nil { + return nil, nil, nil, err + } + + return res.CallFrames, res.AsyncStackTrace, res.AsyncStackTraceID, nil +} + +// ResumeParams resumes JavaScript execution. +type ResumeParams struct{} + +// Resume resumes JavaScript execution. +func Resume() *ResumeParams { + return &ResumeParams{} +} + +// Do executes Debugger.resume against the provided context and +// target handler. +func (p *ResumeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerResume, nil, nil) +} + +// ScheduleStepIntoAsyncParams this method is deprecated - use +// Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask +// instead. Steps into next scheduled async task if any is scheduled before next +// pause. Returns success when async task is actually scheduled, returns error +// if no task were scheduled or another scheduleStepIntoAsync was called. +type ScheduleStepIntoAsyncParams struct{} + +// ScheduleStepIntoAsync this method is deprecated - use Debugger.stepInto +// with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next +// scheduled async task if any is scheduled before next pause. Returns success +// when async task is actually scheduled, returns error if no task were +// scheduled or another scheduleStepIntoAsync was called. +func ScheduleStepIntoAsync() *ScheduleStepIntoAsyncParams { + return &ScheduleStepIntoAsyncParams{} +} + +// Do executes Debugger.scheduleStepIntoAsync against the provided context and +// target handler. +func (p *ScheduleStepIntoAsyncParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerScheduleStepIntoAsync, nil, nil) +} + +// SearchInContentParams searches for given string in script content. +type SearchInContentParams struct { + ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script 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. +} + +// SearchInContent searches for given string in script content. +// +// parameters: +// scriptID - Id of the script to search in. +// query - String to search for. +func SearchInContent(scriptID runtime.ScriptID, query string) *SearchInContentParams { + return &SearchInContentParams{ + ScriptID: scriptID, + Query: query, + } +} + +// WithCaseSensitive if true, search is case sensitive. +func (p SearchInContentParams) WithCaseSensitive(caseSensitive bool) *SearchInContentParams { + p.CaseSensitive = caseSensitive + return &p +} + +// WithIsRegex if true, treats string parameter as regex. +func (p SearchInContentParams) WithIsRegex(isRegex bool) *SearchInContentParams { + p.IsRegex = isRegex + return &p +} + +// SearchInContentReturns return values. +type SearchInContentReturns struct { + Result []*SearchMatch `json:"result,omitempty"` // List of search matches. +} + +// Do executes Debugger.searchInContent against the provided context and +// target handler. +// +// returns: +// result - List of search matches. +func (p *SearchInContentParams) Do(ctxt context.Context, h cdp.Handler) (result []*SearchMatch, err error) { + // execute + var res SearchInContentReturns + err = h.Execute(ctxt, cdp.CommandDebuggerSearchInContent, p, &res) + if err != nil { + return nil, err + } + + return res.Result, nil } // SetAsyncCallStackDepthParams enables or disables async call stacks @@ -936,3 +571,368 @@ func SetBlackboxedRanges(scriptID runtime.ScriptID, positions []*ScriptPosition) func (p *SetBlackboxedRangesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandDebuggerSetBlackboxedRanges, p, nil) } + +// SetBreakpointParams sets JavaScript breakpoint at a given location. +type SetBreakpointParams struct { + Location *Location `json:"location"` // Location to set breakpoint in. + Condition string `json:"condition,omitempty"` // Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. +} + +// SetBreakpoint sets JavaScript breakpoint at a given location. +// +// parameters: +// location - Location to set breakpoint in. +func SetBreakpoint(location *Location) *SetBreakpointParams { + return &SetBreakpointParams{ + Location: location, + } +} + +// WithCondition expression to use as a breakpoint condition. When specified, +// debugger will only stop on the breakpoint if this expression evaluates to +// true. +func (p SetBreakpointParams) WithCondition(condition string) *SetBreakpointParams { + p.Condition = condition + return &p +} + +// SetBreakpointReturns return values. +type SetBreakpointReturns struct { + BreakpointID BreakpointID `json:"breakpointId,omitempty"` // Id of the created breakpoint for further reference. + ActualLocation *Location `json:"actualLocation,omitempty"` // Location this breakpoint resolved into. +} + +// Do executes Debugger.setBreakpoint against the provided context and +// target handler. +// +// returns: +// breakpointID - Id of the created breakpoint for further reference. +// actualLocation - Location this breakpoint resolved into. +func (p *SetBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (breakpointID BreakpointID, actualLocation *Location, err error) { + // execute + var res SetBreakpointReturns + err = h.Execute(ctxt, cdp.CommandDebuggerSetBreakpoint, p, &res) + if err != nil { + return "", nil, err + } + + return res.BreakpointID, res.ActualLocation, nil +} + +// SetBreakpointByURLParams sets JavaScript breakpoint at given location +// specified either by URL or URL regex. Once this command is issued, all +// existing parsed scripts will have breakpoints resolved and returned in +// locations property. Further matching script parsing will result in subsequent +// breakpointResolved events issued. This logical breakpoint will survive page +// reloads. +type SetBreakpointByURLParams struct { + LineNumber int64 `json:"lineNumber"` // Line number to set breakpoint at. + URL string `json:"url,omitempty"` // URL of the resources to set breakpoint on. + URLRegex string `json:"urlRegex,omitempty"` // Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + ScriptHash string `json:"scriptHash,omitempty"` // Script hash of the resources to set breakpoint on. + ColumnNumber int64 `json:"columnNumber,omitempty"` // Offset in the line to set breakpoint at. + Condition string `json:"condition,omitempty"` // Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. +} + +// SetBreakpointByURL sets JavaScript breakpoint at given location specified +// either by URL or URL regex. Once this command is issued, all existing parsed +// scripts will have breakpoints resolved and returned in locations property. +// Further matching script parsing will result in subsequent breakpointResolved +// events issued. This logical breakpoint will survive page reloads. +// +// parameters: +// lineNumber - Line number to set breakpoint at. +func SetBreakpointByURL(lineNumber int64) *SetBreakpointByURLParams { + return &SetBreakpointByURLParams{ + LineNumber: lineNumber, + } +} + +// WithURL URL of the resources to set breakpoint on. +func (p SetBreakpointByURLParams) WithURL(url string) *SetBreakpointByURLParams { + p.URL = url + return &p +} + +// WithURLRegex regex pattern for the URLs of the resources to set +// breakpoints on. Either url or urlRegex must be specified. +func (p SetBreakpointByURLParams) WithURLRegex(urlRegex string) *SetBreakpointByURLParams { + p.URLRegex = urlRegex + return &p +} + +// WithScriptHash script hash of the resources to set breakpoint on. +func (p SetBreakpointByURLParams) WithScriptHash(scriptHash string) *SetBreakpointByURLParams { + p.ScriptHash = scriptHash + return &p +} + +// WithColumnNumber offset in the line to set breakpoint at. +func (p SetBreakpointByURLParams) WithColumnNumber(columnNumber int64) *SetBreakpointByURLParams { + p.ColumnNumber = columnNumber + return &p +} + +// WithCondition expression to use as a breakpoint condition. When specified, +// debugger will only stop on the breakpoint if this expression evaluates to +// true. +func (p SetBreakpointByURLParams) WithCondition(condition string) *SetBreakpointByURLParams { + p.Condition = condition + return &p +} + +// SetBreakpointByURLReturns return values. +type SetBreakpointByURLReturns struct { + BreakpointID BreakpointID `json:"breakpointId,omitempty"` // Id of the created breakpoint for further reference. + Locations []*Location `json:"locations,omitempty"` // List of the locations this breakpoint resolved into upon addition. +} + +// Do executes Debugger.setBreakpointByUrl against the provided context and +// target handler. +// +// returns: +// breakpointID - Id of the created breakpoint for further reference. +// locations - List of the locations this breakpoint resolved into upon addition. +func (p *SetBreakpointByURLParams) Do(ctxt context.Context, h cdp.Handler) (breakpointID BreakpointID, locations []*Location, err error) { + // execute + var res SetBreakpointByURLReturns + err = h.Execute(ctxt, cdp.CommandDebuggerSetBreakpointByURL, p, &res) + if err != nil { + return "", nil, err + } + + return res.BreakpointID, res.Locations, nil +} + +// SetBreakpointsActiveParams activates / deactivates all breakpoints on the +// page. +type SetBreakpointsActiveParams struct { + Active bool `json:"active"` // New value for breakpoints active state. +} + +// SetBreakpointsActive activates / deactivates all breakpoints on the page. +// +// parameters: +// active - New value for breakpoints active state. +func SetBreakpointsActive(active bool) *SetBreakpointsActiveParams { + return &SetBreakpointsActiveParams{ + Active: active, + } +} + +// Do executes Debugger.setBreakpointsActive against the provided context and +// target handler. +func (p *SetBreakpointsActiveParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerSetBreakpointsActive, p, nil) +} + +// SetPauseOnExceptionsParams defines pause on exceptions state. Can be set +// to stop on all exceptions, uncaught exceptions or no exceptions. Initial +// pause on exceptions state is none. +type SetPauseOnExceptionsParams struct { + State ExceptionsState `json:"state"` // Pause on exceptions mode. +} + +// SetPauseOnExceptions defines pause on exceptions state. Can be set to stop +// on all exceptions, uncaught exceptions or no exceptions. Initial pause on +// exceptions state is none. +// +// parameters: +// state - Pause on exceptions mode. +func SetPauseOnExceptions(state ExceptionsState) *SetPauseOnExceptionsParams { + return &SetPauseOnExceptionsParams{ + State: state, + } +} + +// Do executes Debugger.setPauseOnExceptions against the provided context and +// target handler. +func (p *SetPauseOnExceptionsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerSetPauseOnExceptions, p, nil) +} + +// SetReturnValueParams changes return value in top frame. Available only at +// return break position. +type SetReturnValueParams struct { + NewValue *runtime.CallArgument `json:"newValue"` // New return value. +} + +// SetReturnValue changes return value in top frame. Available only at return +// break position. +// +// parameters: +// newValue - New return value. +func SetReturnValue(newValue *runtime.CallArgument) *SetReturnValueParams { + return &SetReturnValueParams{ + NewValue: newValue, + } +} + +// Do executes Debugger.setReturnValue against the provided context and +// target handler. +func (p *SetReturnValueParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerSetReturnValue, p, nil) +} + +// SetScriptSourceParams edits JavaScript source live. +type SetScriptSourceParams struct { + ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script to edit. + ScriptSource string `json:"scriptSource"` // New content of the script. + DryRun bool `json:"dryRun,omitempty"` // If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. +} + +// SetScriptSource edits JavaScript source live. +// +// parameters: +// scriptID - Id of the script to edit. +// scriptSource - New content of the script. +func SetScriptSource(scriptID runtime.ScriptID, scriptSource string) *SetScriptSourceParams { + return &SetScriptSourceParams{ + ScriptID: scriptID, + ScriptSource: scriptSource, + } +} + +// WithDryRun if true the change will not actually be applied. Dry run may be +// used to get result description without actually modifying the code. +func (p SetScriptSourceParams) WithDryRun(dryRun bool) *SetScriptSourceParams { + p.DryRun = dryRun + return &p +} + +// SetScriptSourceReturns return values. +type SetScriptSourceReturns struct { + CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace in case editing has happened while VM was stopped. + StackChanged bool `json:"stackChanged,omitempty"` // Whether current call stack was modified after applying the changes. + AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any. + AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any. + ExceptionDetails *runtime.ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details if any. +} + +// Do executes Debugger.setScriptSource against the provided context and +// target handler. +// +// returns: +// callFrames - New stack trace in case editing has happened while VM was stopped. +// stackChanged - Whether current call stack was modified after applying the changes. +// asyncStackTrace - Async stack trace, if any. +// asyncStackTraceID - Async stack trace, if any. +// exceptionDetails - Exception details if any. +func (p *SetScriptSourceParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, stackChanged bool, asyncStackTrace *runtime.StackTrace, asyncStackTraceID *runtime.StackTraceID, exceptionDetails *runtime.ExceptionDetails, err error) { + // execute + var res SetScriptSourceReturns + err = h.Execute(ctxt, cdp.CommandDebuggerSetScriptSource, p, &res) + if err != nil { + return nil, false, nil, nil, nil, err + } + + return res.CallFrames, res.StackChanged, res.AsyncStackTrace, res.AsyncStackTraceID, res.ExceptionDetails, nil +} + +// SetSkipAllPausesParams makes page not interrupt on any pauses (breakpoint, +// exception, dom exception etc). +type SetSkipAllPausesParams struct { + Skip bool `json:"skip"` // New value for skip pauses state. +} + +// SetSkipAllPauses makes page not interrupt on any pauses (breakpoint, +// exception, dom exception etc). +// +// parameters: +// skip - New value for skip pauses state. +func SetSkipAllPauses(skip bool) *SetSkipAllPausesParams { + return &SetSkipAllPausesParams{ + Skip: skip, + } +} + +// Do executes Debugger.setSkipAllPauses against the provided context and +// target handler. +func (p *SetSkipAllPausesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerSetSkipAllPauses, p, nil) +} + +// SetVariableValueParams changes value of variable in a callframe. +// Object-based scopes are not supported and must be mutated manually. +type SetVariableValueParams struct { + ScopeNumber int64 `json:"scopeNumber"` // 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + VariableName string `json:"variableName"` // Variable name. + NewValue *runtime.CallArgument `json:"newValue"` // New variable value. + CallFrameID CallFrameID `json:"callFrameId"` // Id of callframe that holds variable. +} + +// SetVariableValue changes value of variable in a callframe. Object-based +// scopes are not supported and must be mutated manually. +// +// parameters: +// scopeNumber - 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. +// variableName - Variable name. +// newValue - New variable value. +// callFrameID - Id of callframe that holds variable. +func SetVariableValue(scopeNumber int64, variableName string, newValue *runtime.CallArgument, callFrameID CallFrameID) *SetVariableValueParams { + return &SetVariableValueParams{ + ScopeNumber: scopeNumber, + VariableName: variableName, + NewValue: newValue, + CallFrameID: callFrameID, + } +} + +// Do executes Debugger.setVariableValue against the provided context and +// target handler. +func (p *SetVariableValueParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerSetVariableValue, p, nil) +} + +// StepIntoParams steps into the function call. +type StepIntoParams struct { + BreakOnAsyncCall bool `json:"breakOnAsyncCall,omitempty"` // Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. +} + +// StepInto steps into the function call. +// +// parameters: +func StepInto() *StepIntoParams { + return &StepIntoParams{} +} + +// WithBreakOnAsyncCall debugger will issue additional Debugger.paused +// notification if any async task is scheduled before next pause. +func (p StepIntoParams) WithBreakOnAsyncCall(breakOnAsyncCall bool) *StepIntoParams { + p.BreakOnAsyncCall = breakOnAsyncCall + return &p +} + +// Do executes Debugger.stepInto against the provided context and +// target handler. +func (p *StepIntoParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerStepInto, p, nil) +} + +// StepOutParams steps out of the function call. +type StepOutParams struct{} + +// StepOut steps out of the function call. +func StepOut() *StepOutParams { + return &StepOutParams{} +} + +// Do executes Debugger.stepOut against the provided context and +// target handler. +func (p *StepOutParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerStepOut, nil, nil) +} + +// StepOverParams steps over the statement. +type StepOverParams struct{} + +// StepOver steps over the statement. +func StepOver() *StepOverParams { + return &StepOverParams{} +} + +// Do executes Debugger.stepOver against the provided context and +// target handler. +func (p *StepOverParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDebuggerStepOver, nil, nil) +} diff --git a/cdp/debugger/events.go b/cdp/debugger/events.go index 1674d80..3f675ef 100644 --- a/cdp/debugger/events.go +++ b/cdp/debugger/events.go @@ -8,45 +8,6 @@ import ( "github.com/mailru/easyjson" ) -// EventScriptParsed fired when virtual machine parses script. This event is -// also fired for all known and uncollected scripts upon enabling debugger. -type EventScriptParsed struct { - ScriptID runtime.ScriptID `json:"scriptId"` // Identifier of the script parsed. - URL string `json:"url"` // URL or name of the script parsed (if any). - StartLine int64 `json:"startLine"` // Line offset of the script within the resource with given URL (for script tags). - StartColumn int64 `json:"startColumn"` // Column offset of the script within the resource with given URL. - EndLine int64 `json:"endLine"` // Last line of the script. - EndColumn int64 `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. - ExecutionContextAuxData easyjson.RawMessage `json:"executionContextAuxData,omitempty"` - IsLiveEdit bool `json:"isLiveEdit,omitempty"` // True, if this script is generated as a result of the live edit operation. - 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. - IsModule bool `json:"isModule,omitempty"` // True, if this script is ES6 module. - Length int64 `json:"length,omitempty"` // This script length. - StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript top stack frame of where the script parsed event was triggered if available. -} - -// EventScriptFailedToParse fired when virtual machine fails to parse the -// script. -type EventScriptFailedToParse struct { - ScriptID runtime.ScriptID `json:"scriptId"` // Identifier of the script parsed. - URL string `json:"url"` // URL or name of the script parsed (if any). - StartLine int64 `json:"startLine"` // Line offset of the script within the resource with given URL (for script tags). - StartColumn int64 `json:"startColumn"` // Column offset of the script within the resource with given URL. - EndLine int64 `json:"endLine"` // Last line of the script. - EndColumn int64 `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. - ExecutionContextAuxData easyjson.RawMessage `json:"executionContextAuxData,omitempty"` - 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. - IsModule bool `json:"isModule,omitempty"` // True, if this script is ES6 module. - Length int64 `json:"length,omitempty"` // This script length. - StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript top stack frame of where the script parsed event was triggered if available. -} - // EventBreakpointResolved fired when breakpoint is resolved to an actual // script and location. type EventBreakpointResolved struct { @@ -69,11 +30,50 @@ type EventPaused struct { // EventResumed fired when the virtual machine resumed execution. type EventResumed struct{} +// EventScriptFailedToParse fired when virtual machine fails to parse the +// script. +type EventScriptFailedToParse struct { + ScriptID runtime.ScriptID `json:"scriptId"` // Identifier of the script parsed. + URL string `json:"url"` // URL or name of the script parsed (if any). + StartLine int64 `json:"startLine"` // Line offset of the script within the resource with given URL (for script tags). + StartColumn int64 `json:"startColumn"` // Column offset of the script within the resource with given URL. + EndLine int64 `json:"endLine"` // Last line of the script. + EndColumn int64 `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. + ExecutionContextAuxData easyjson.RawMessage `json:"executionContextAuxData,omitempty"` + 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. + IsModule bool `json:"isModule,omitempty"` // True, if this script is ES6 module. + Length int64 `json:"length,omitempty"` // This script length. + StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript top stack frame of where the script parsed event was triggered if available. +} + +// EventScriptParsed fired when virtual machine parses script. This event is +// also fired for all known and uncollected scripts upon enabling debugger. +type EventScriptParsed struct { + ScriptID runtime.ScriptID `json:"scriptId"` // Identifier of the script parsed. + URL string `json:"url"` // URL or name of the script parsed (if any). + StartLine int64 `json:"startLine"` // Line offset of the script within the resource with given URL (for script tags). + StartColumn int64 `json:"startColumn"` // Column offset of the script within the resource with given URL. + EndLine int64 `json:"endLine"` // Last line of the script. + EndColumn int64 `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. + ExecutionContextAuxData easyjson.RawMessage `json:"executionContextAuxData,omitempty"` + IsLiveEdit bool `json:"isLiveEdit,omitempty"` // True, if this script is generated as a result of the live edit operation. + 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. + IsModule bool `json:"isModule,omitempty"` // True, if this script is ES6 module. + Length int64 `json:"length,omitempty"` // This script length. + StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript top stack frame of where the script parsed event was triggered if available. +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventDebuggerScriptParsed, - cdp.EventDebuggerScriptFailedToParse, cdp.EventDebuggerBreakpointResolved, cdp.EventDebuggerPaused, cdp.EventDebuggerResumed, + cdp.EventDebuggerScriptFailedToParse, + cdp.EventDebuggerScriptParsed, } diff --git a/cdp/deviceorientation/deviceorientation.go b/cdp/deviceorientation/deviceorientation.go index a3ed876..febb6ac 100644 --- a/cdp/deviceorientation/deviceorientation.go +++ b/cdp/deviceorientation/deviceorientation.go @@ -12,6 +12,21 @@ import ( cdp "github.com/knq/chromedp/cdp" ) +// ClearDeviceOrientationOverrideParams clears the overridden Device +// Orientation. +type ClearDeviceOrientationOverrideParams struct{} + +// ClearDeviceOrientationOverride clears the overridden Device Orientation. +func ClearDeviceOrientationOverride() *ClearDeviceOrientationOverrideParams { + return &ClearDeviceOrientationOverrideParams{} +} + +// Do executes DeviceOrientation.clearDeviceOrientationOverride against the provided context and +// target handler. +func (p *ClearDeviceOrientationOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDeviceOrientationClearDeviceOrientationOverride, nil, nil) +} + // SetDeviceOrientationOverrideParams overrides the Device Orientation. type SetDeviceOrientationOverrideParams struct { Alpha float64 `json:"alpha"` // Mock alpha @@ -38,18 +53,3 @@ func SetDeviceOrientationOverride(alpha float64, beta float64, gamma float64) *S func (p *SetDeviceOrientationOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandDeviceOrientationSetDeviceOrientationOverride, p, nil) } - -// ClearDeviceOrientationOverrideParams clears the overridden Device -// Orientation. -type ClearDeviceOrientationOverrideParams struct{} - -// ClearDeviceOrientationOverride clears the overridden Device Orientation. -func ClearDeviceOrientationOverride() *ClearDeviceOrientationOverrideParams { - return &ClearDeviceOrientationOverrideParams{} -} - -// Do executes DeviceOrientation.clearDeviceOrientationOverride against the provided context and -// target handler. -func (p *ClearDeviceOrientationOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDeviceOrientationClearDeviceOrientationOverride, nil, nil) -} diff --git a/cdp/dom/dom.go b/cdp/dom/dom.go index e8d87bc..8b9532f 100644 --- a/cdp/dom/dom.go +++ b/cdp/dom/dom.go @@ -23,18 +23,163 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) -// EnableParams enables DOM agent for the given page. -type EnableParams struct{} - -// Enable enables DOM agent for the given page. -func Enable() *EnableParams { - return &EnableParams{} +// CollectClassNamesFromSubtreeParams collects class names for the node with +// given id and all of it's child nodes. +type CollectClassNamesFromSubtreeParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to collect class names. } -// Do executes DOM.enable against the provided context and +// CollectClassNamesFromSubtree collects class names for the node with given +// id and all of it's child nodes. +// +// parameters: +// nodeID - Id of the node to collect class names. +func CollectClassNamesFromSubtree(nodeID cdp.NodeID) *CollectClassNamesFromSubtreeParams { + return &CollectClassNamesFromSubtreeParams{ + NodeID: nodeID, + } +} + +// CollectClassNamesFromSubtreeReturns return values. +type CollectClassNamesFromSubtreeReturns struct { + ClassNames []string `json:"classNames,omitempty"` // Class name list. +} + +// Do executes DOM.collectClassNamesFromSubtree against the provided context and // target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMEnable, nil, nil) +// +// returns: +// classNames - Class name list. +func (p *CollectClassNamesFromSubtreeParams) Do(ctxt context.Context, h cdp.Handler) (classNames []string, err error) { + // execute + var res CollectClassNamesFromSubtreeReturns + err = h.Execute(ctxt, cdp.CommandDOMCollectClassNamesFromSubtree, p, &res) + if err != nil { + return nil, err + } + + return res.ClassNames, nil +} + +// CopyToParams creates a deep copy of the specified node and places it into +// the target container before the given anchor. +type CopyToParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to copy. + TargetNodeID cdp.NodeID `json:"targetNodeId"` // Id of the element to drop the copy into. + InsertBeforeNodeID cdp.NodeID `json:"insertBeforeNodeId,omitempty"` // Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId). +} + +// CopyTo creates a deep copy of the specified node and places it into the +// target container before the given anchor. +// +// parameters: +// nodeID - Id of the node to copy. +// targetNodeID - Id of the element to drop the copy into. +func CopyTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID) *CopyToParams { + return &CopyToParams{ + NodeID: nodeID, + TargetNodeID: targetNodeID, + } +} + +// WithInsertBeforeNodeID drop the copy before this node (if absent, the copy +// becomes the last child of targetNodeId). +func (p CopyToParams) WithInsertBeforeNodeID(insertBeforeNodeID cdp.NodeID) *CopyToParams { + p.InsertBeforeNodeID = insertBeforeNodeID + return &p +} + +// CopyToReturns return values. +type CopyToReturns struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node clone. +} + +// Do executes DOM.copyTo against the provided context and +// target handler. +// +// returns: +// nodeID - Id of the node clone. +func (p *CopyToParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { + // execute + var res CopyToReturns + err = h.Execute(ctxt, cdp.CommandDOMCopyTo, p, &res) + if err != nil { + return 0, err + } + + return res.NodeID, nil +} + +// DescribeNodeParams describes node given its id, does not require domain to +// be enabled. Does not start tracking any objects, can be used for automation. +type DescribeNodeParams struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. + Depth int64 `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. + Pierce bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). +} + +// DescribeNode describes node given its id, does not require domain to be +// enabled. Does not start tracking any objects, can be used for automation. +// +// parameters: +func DescribeNode() *DescribeNodeParams { + return &DescribeNodeParams{} +} + +// WithNodeID identifier of the node. +func (p DescribeNodeParams) WithNodeID(nodeID cdp.NodeID) *DescribeNodeParams { + p.NodeID = nodeID + return &p +} + +// WithBackendNodeID identifier of the backend node. +func (p DescribeNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *DescribeNodeParams { + p.BackendNodeID = backendNodeID + return &p +} + +// WithObjectID JavaScript object id of the node wrapper. +func (p DescribeNodeParams) WithObjectID(objectID runtime.RemoteObjectID) *DescribeNodeParams { + p.ObjectID = objectID + return &p +} + +// WithDepth the maximum depth at which children should be retrieved, +// defaults to 1. Use -1 for the entire subtree or provide an integer larger +// than 0. +func (p DescribeNodeParams) WithDepth(depth int64) *DescribeNodeParams { + p.Depth = depth + return &p +} + +// WithPierce whether or not iframes and shadow roots should be traversed +// when returning the subtree (default is false). +func (p DescribeNodeParams) WithPierce(pierce bool) *DescribeNodeParams { + p.Pierce = pierce + return &p +} + +// DescribeNodeReturns return values. +type DescribeNodeReturns struct { + Node *cdp.Node `json:"node,omitempty"` // Node description. +} + +// Do executes DOM.describeNode against the provided context and +// target handler. +// +// returns: +// node - Node description. +func (p *DescribeNodeParams) Do(ctxt context.Context, h cdp.Handler) (node *cdp.Node, err error) { + // execute + var res DescribeNodeReturns + err = h.Execute(ctxt, cdp.CommandDOMDescribeNode, p, &res) + if err != nil { + return nil, err + } + + return res.Node, nil } // DisableParams disables DOM agent for the given page. @@ -51,6 +196,170 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandDOMDisable, nil, nil) } +// DiscardSearchResultsParams discards search results from the session with +// the given id. getSearchResults should no longer be called for that search. +type DiscardSearchResultsParams struct { + SearchID string `json:"searchId"` // Unique search session identifier. +} + +// DiscardSearchResults discards search results from the session with the +// given id. getSearchResults should no longer be called for that search. +// +// parameters: +// searchID - Unique search session identifier. +func DiscardSearchResults(searchID string) *DiscardSearchResultsParams { + return &DiscardSearchResultsParams{ + SearchID: searchID, + } +} + +// Do executes DOM.discardSearchResults against the provided context and +// target handler. +func (p *DiscardSearchResultsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDiscardSearchResults, p, nil) +} + +// EnableParams enables DOM agent for the given page. +type EnableParams struct{} + +// Enable enables DOM agent for the given page. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes DOM.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMEnable, nil, nil) +} + +// FocusParams focuses the given element. +type FocusParams struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. +} + +// Focus focuses the given element. +// +// parameters: +func Focus() *FocusParams { + return &FocusParams{} +} + +// WithNodeID identifier of the node. +func (p FocusParams) WithNodeID(nodeID cdp.NodeID) *FocusParams { + p.NodeID = nodeID + return &p +} + +// WithBackendNodeID identifier of the backend node. +func (p FocusParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *FocusParams { + p.BackendNodeID = backendNodeID + return &p +} + +// WithObjectID JavaScript object id of the node wrapper. +func (p FocusParams) WithObjectID(objectID runtime.RemoteObjectID) *FocusParams { + p.ObjectID = objectID + return &p +} + +// Do executes DOM.focus against the provided context and +// target handler. +func (p *FocusParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMFocus, p, nil) +} + +// GetAttributesParams returns attributes for the specified node. +type GetAttributesParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to retrieve attibutes for. +} + +// GetAttributes returns attributes for the specified node. +// +// parameters: +// nodeID - Id of the node to retrieve attibutes for. +func GetAttributes(nodeID cdp.NodeID) *GetAttributesParams { + return &GetAttributesParams{ + NodeID: nodeID, + } +} + +// GetAttributesReturns return values. +type GetAttributesReturns struct { + Attributes []string `json:"attributes,omitempty"` // An interleaved array of node attribute names and values. +} + +// Do executes DOM.getAttributes against the provided context and +// target handler. +// +// returns: +// attributes - An interleaved array of node attribute names and values. +func (p *GetAttributesParams) Do(ctxt context.Context, h cdp.Handler) (attributes []string, err error) { + // execute + var res GetAttributesReturns + err = h.Execute(ctxt, cdp.CommandDOMGetAttributes, p, &res) + if err != nil { + return nil, err + } + + return res.Attributes, nil +} + +// GetBoxModelParams returns boxes for the given node. +type GetBoxModelParams struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. +} + +// GetBoxModel returns boxes for the given node. +// +// parameters: +func GetBoxModel() *GetBoxModelParams { + return &GetBoxModelParams{} +} + +// WithNodeID identifier of the node. +func (p GetBoxModelParams) WithNodeID(nodeID cdp.NodeID) *GetBoxModelParams { + p.NodeID = nodeID + return &p +} + +// WithBackendNodeID identifier of the backend node. +func (p GetBoxModelParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetBoxModelParams { + p.BackendNodeID = backendNodeID + return &p +} + +// WithObjectID JavaScript object id of the node wrapper. +func (p GetBoxModelParams) WithObjectID(objectID runtime.RemoteObjectID) *GetBoxModelParams { + p.ObjectID = objectID + return &p +} + +// GetBoxModelReturns return values. +type GetBoxModelReturns struct { + Model *BoxModel `json:"model,omitempty"` // Box model for the node. +} + +// Do executes DOM.getBoxModel against the provided context and +// target handler. +// +// returns: +// model - Box model for the node. +func (p *GetBoxModelParams) Do(ctxt context.Context, h cdp.Handler) (model *BoxModel, err error) { + // execute + var res GetBoxModelReturns + err = h.Execute(ctxt, cdp.CommandDOMGetBoxModel, p, &res) + if err != nil { + return nil, err + } + + return res.Model, nil +} + // GetDocumentParams returns the root DOM node (and optionally the subtree) // to the caller. type GetDocumentParams struct { @@ -153,86 +462,374 @@ func (p *GetFlattenedDocumentParams) Do(ctxt context.Context, h cdp.Handler) (no return res.Nodes, nil } -// CollectClassNamesFromSubtreeParams collects class names for the node with -// given id and all of it's child nodes. -type CollectClassNamesFromSubtreeParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to collect class names. +// GetNodeForLocationParams returns node id at given location. +type GetNodeForLocationParams struct { + X int64 `json:"x"` // X coordinate. + Y int64 `json:"y"` // Y coordinate. + IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM,omitempty"` // False to skip to the nearest non-UA shadow root ancestor (default: false). } -// CollectClassNamesFromSubtree collects class names for the node with given -// id and all of it's child nodes. +// GetNodeForLocation returns node id at given location. // // parameters: -// nodeID - Id of the node to collect class names. -func CollectClassNamesFromSubtree(nodeID cdp.NodeID) *CollectClassNamesFromSubtreeParams { - return &CollectClassNamesFromSubtreeParams{ +// x - X coordinate. +// y - Y coordinate. +func GetNodeForLocation(x int64, y int64) *GetNodeForLocationParams { + return &GetNodeForLocationParams{ + X: x, + Y: y, + } +} + +// WithIncludeUserAgentShadowDOM false to skip to the nearest non-UA shadow +// root ancestor (default: false). +func (p GetNodeForLocationParams) WithIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *GetNodeForLocationParams { + p.IncludeUserAgentShadowDOM = includeUserAgentShadowDOM + return &p +} + +// GetNodeForLocationReturns return values. +type GetNodeForLocationReturns struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node at given coordinates. +} + +// Do executes DOM.getNodeForLocation against the provided context and +// target handler. +// +// returns: +// nodeID - Id of the node at given coordinates. +func (p *GetNodeForLocationParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { + // execute + var res GetNodeForLocationReturns + err = h.Execute(ctxt, cdp.CommandDOMGetNodeForLocation, p, &res) + if err != nil { + return 0, err + } + + return res.NodeID, nil +} + +// GetOuterHTMLParams returns node's HTML markup. +type GetOuterHTMLParams struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. +} + +// GetOuterHTML returns node's HTML markup. +// +// parameters: +func GetOuterHTML() *GetOuterHTMLParams { + return &GetOuterHTMLParams{} +} + +// WithNodeID identifier of the node. +func (p GetOuterHTMLParams) WithNodeID(nodeID cdp.NodeID) *GetOuterHTMLParams { + p.NodeID = nodeID + return &p +} + +// WithBackendNodeID identifier of the backend node. +func (p GetOuterHTMLParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetOuterHTMLParams { + p.BackendNodeID = backendNodeID + return &p +} + +// WithObjectID JavaScript object id of the node wrapper. +func (p GetOuterHTMLParams) WithObjectID(objectID runtime.RemoteObjectID) *GetOuterHTMLParams { + p.ObjectID = objectID + return &p +} + +// GetOuterHTMLReturns return values. +type GetOuterHTMLReturns struct { + OuterHTML string `json:"outerHTML,omitempty"` // Outer HTML markup. +} + +// Do executes DOM.getOuterHTML against the provided context and +// target handler. +// +// returns: +// outerHTML - Outer HTML markup. +func (p *GetOuterHTMLParams) Do(ctxt context.Context, h cdp.Handler) (outerHTML string, err error) { + // execute + var res GetOuterHTMLReturns + err = h.Execute(ctxt, cdp.CommandDOMGetOuterHTML, p, &res) + if err != nil { + return "", err + } + + return res.OuterHTML, nil +} + +// GetRelayoutBoundaryParams returns the id of the nearest ancestor that is a +// relayout boundary. +type GetRelayoutBoundaryParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node. +} + +// GetRelayoutBoundary returns the id of the nearest ancestor that is a +// relayout boundary. +// +// parameters: +// nodeID - Id of the node. +func GetRelayoutBoundary(nodeID cdp.NodeID) *GetRelayoutBoundaryParams { + return &GetRelayoutBoundaryParams{ NodeID: nodeID, } } -// CollectClassNamesFromSubtreeReturns return values. -type CollectClassNamesFromSubtreeReturns struct { - ClassNames []string `json:"classNames,omitempty"` // Class name list. +// GetRelayoutBoundaryReturns return values. +type GetRelayoutBoundaryReturns struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Relayout boundary node id for the given node. } -// Do executes DOM.collectClassNamesFromSubtree against the provided context and +// Do executes DOM.getRelayoutBoundary against the provided context and // target handler. // // returns: -// classNames - Class name list. -func (p *CollectClassNamesFromSubtreeParams) Do(ctxt context.Context, h cdp.Handler) (classNames []string, err error) { +// nodeID - Relayout boundary node id for the given node. +func (p *GetRelayoutBoundaryParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { // execute - var res CollectClassNamesFromSubtreeReturns - err = h.Execute(ctxt, cdp.CommandDOMCollectClassNamesFromSubtree, p, &res) + var res GetRelayoutBoundaryReturns + err = h.Execute(ctxt, cdp.CommandDOMGetRelayoutBoundary, p, &res) + if err != nil { + return 0, err + } + + return res.NodeID, nil +} + +// GetSearchResultsParams returns search results from given fromIndex to +// given toIndex from the search with the given identifier. +type GetSearchResultsParams struct { + SearchID string `json:"searchId"` // Unique search session identifier. + FromIndex int64 `json:"fromIndex"` // Start index of the search result to be returned. + ToIndex int64 `json:"toIndex"` // End index of the search result to be returned. +} + +// GetSearchResults returns search results from given fromIndex to given +// toIndex from the search with the given identifier. +// +// parameters: +// searchID - Unique search session identifier. +// fromIndex - Start index of the search result to be returned. +// toIndex - End index of the search result to be returned. +func GetSearchResults(searchID string, fromIndex int64, toIndex int64) *GetSearchResultsParams { + return &GetSearchResultsParams{ + SearchID: searchID, + FromIndex: fromIndex, + ToIndex: toIndex, + } +} + +// GetSearchResultsReturns return values. +type GetSearchResultsReturns struct { + NodeIds []cdp.NodeID `json:"nodeIds,omitempty"` // Ids of the search result nodes. +} + +// Do executes DOM.getSearchResults against the provided context and +// target handler. +// +// returns: +// nodeIds - Ids of the search result nodes. +func (p *GetSearchResultsParams) Do(ctxt context.Context, h cdp.Handler) (nodeIds []cdp.NodeID, err error) { + // execute + var res GetSearchResultsReturns + err = h.Execute(ctxt, cdp.CommandDOMGetSearchResults, p, &res) if err != nil { return nil, err } - return res.ClassNames, nil + return res.NodeIds, nil } -// RequestChildNodesParams requests that children of the node with given id -// are returned to the caller in form of setChildNodes events where not only -// immediate children are retrieved, but all children down to the specified -// depth. -type RequestChildNodesParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get children for. - Depth int64 `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. - Pierce bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false). +// MarkUndoableStateParams marks last undoable state. +type MarkUndoableStateParams struct{} + +// MarkUndoableState marks last undoable state. +func MarkUndoableState() *MarkUndoableStateParams { + return &MarkUndoableStateParams{} } -// RequestChildNodes requests that children of the node with given id are -// returned to the caller in form of setChildNodes events where not only -// immediate children are retrieved, but all children down to the specified -// depth. +// Do executes DOM.markUndoableState against the provided context and +// target handler. +func (p *MarkUndoableStateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMMarkUndoableState, nil, nil) +} + +// MoveToParams moves node into the new container, places it before the given +// anchor. +type MoveToParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to move. + TargetNodeID cdp.NodeID `json:"targetNodeId"` // Id of the element to drop the moved node into. + InsertBeforeNodeID cdp.NodeID `json:"insertBeforeNodeId,omitempty"` // Drop node before this one (if absent, the moved node becomes the last child of targetNodeId). +} + +// MoveTo moves node into the new container, places it before the given +// anchor. // // parameters: -// nodeID - Id of the node to get children for. -func RequestChildNodes(nodeID cdp.NodeID) *RequestChildNodesParams { - return &RequestChildNodesParams{ - NodeID: nodeID, +// nodeID - Id of the node to move. +// targetNodeID - Id of the element to drop the moved node into. +func MoveTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID) *MoveToParams { + return &MoveToParams{ + NodeID: nodeID, + TargetNodeID: targetNodeID, } } -// WithDepth the maximum depth at which children should be retrieved, -// defaults to 1. Use -1 for the entire subtree or provide an integer larger -// than 0. -func (p RequestChildNodesParams) WithDepth(depth int64) *RequestChildNodesParams { - p.Depth = depth +// WithInsertBeforeNodeID drop node before this one (if absent, the moved +// node becomes the last child of targetNodeId). +func (p MoveToParams) WithInsertBeforeNodeID(insertBeforeNodeID cdp.NodeID) *MoveToParams { + p.InsertBeforeNodeID = insertBeforeNodeID return &p } -// WithPierce whether or not iframes and shadow roots should be traversed -// when returning the sub-tree (default is false). -func (p RequestChildNodesParams) WithPierce(pierce bool) *RequestChildNodesParams { - p.Pierce = pierce - return &p +// MoveToReturns return values. +type MoveToReturns struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // New id of the moved node. } -// Do executes DOM.requestChildNodes against the provided context and +// Do executes DOM.moveTo against the provided context and // target handler. -func (p *RequestChildNodesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMRequestChildNodes, p, nil) +// +// returns: +// nodeID - New id of the moved node. +func (p *MoveToParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { + // execute + var res MoveToReturns + err = h.Execute(ctxt, cdp.CommandDOMMoveTo, p, &res) + if err != nil { + return 0, err + } + + return res.NodeID, nil +} + +// PerformSearchParams searches for a given string in the DOM tree. Use +// getSearchResults to access search results or cancelSearch to end this search +// session. +type PerformSearchParams struct { + Query string `json:"query"` // Plain text or query selector or XPath search query. + IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM,omitempty"` // True to search in user agent shadow DOM. +} + +// PerformSearch searches for a given string in the DOM tree. Use +// getSearchResults to access search results or cancelSearch to end this search +// session. +// +// parameters: +// query - Plain text or query selector or XPath search query. +func PerformSearch(query string) *PerformSearchParams { + return &PerformSearchParams{ + Query: query, + } +} + +// WithIncludeUserAgentShadowDOM true to search in user agent shadow DOM. +func (p PerformSearchParams) WithIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *PerformSearchParams { + p.IncludeUserAgentShadowDOM = includeUserAgentShadowDOM + return &p +} + +// PerformSearchReturns return values. +type PerformSearchReturns struct { + SearchID string `json:"searchId,omitempty"` // Unique search session identifier. + ResultCount int64 `json:"resultCount,omitempty"` // Number of search results. +} + +// Do executes DOM.performSearch against the provided context and +// target handler. +// +// returns: +// searchID - Unique search session identifier. +// resultCount - Number of search results. +func (p *PerformSearchParams) Do(ctxt context.Context, h cdp.Handler) (searchID string, resultCount int64, err error) { + // execute + var res PerformSearchReturns + err = h.Execute(ctxt, cdp.CommandDOMPerformSearch, p, &res) + if err != nil { + return "", 0, err + } + + return res.SearchID, res.ResultCount, nil +} + +// PushNodeByPathToFrontendParams requests that the node is sent to the +// caller given its path. // FIXME, use XPath. +type PushNodeByPathToFrontendParams struct { + Path string `json:"path"` // Path to node in the proprietary format. +} + +// PushNodeByPathToFrontend requests that the node is sent to the caller +// given its path. // FIXME, use XPath. +// +// parameters: +// path - Path to node in the proprietary format. +func PushNodeByPathToFrontend(path string) *PushNodeByPathToFrontendParams { + return &PushNodeByPathToFrontendParams{ + Path: path, + } +} + +// PushNodeByPathToFrontendReturns return values. +type PushNodeByPathToFrontendReturns struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node for given path. +} + +// Do executes DOM.pushNodeByPathToFrontend against the provided context and +// target handler. +// +// returns: +// nodeID - Id of the node for given path. +func (p *PushNodeByPathToFrontendParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { + // execute + var res PushNodeByPathToFrontendReturns + err = h.Execute(ctxt, cdp.CommandDOMPushNodeByPathToFrontend, p, &res) + if err != nil { + return 0, err + } + + return res.NodeID, nil +} + +// PushNodesByBackendIdsToFrontendParams requests that a batch of nodes is +// sent to the caller given their backend node ids. +type PushNodesByBackendIdsToFrontendParams struct { + BackendNodeIds []cdp.BackendNodeID `json:"backendNodeIds"` // The array of backend node ids. +} + +// PushNodesByBackendIdsToFrontend requests that a batch of nodes is sent to +// the caller given their backend node ids. +// +// parameters: +// backendNodeIds - The array of backend node ids. +func PushNodesByBackendIdsToFrontend(backendNodeIds []cdp.BackendNodeID) *PushNodesByBackendIdsToFrontendParams { + return &PushNodesByBackendIdsToFrontendParams{ + BackendNodeIds: backendNodeIds, + } +} + +// PushNodesByBackendIdsToFrontendReturns return values. +type PushNodesByBackendIdsToFrontendReturns struct { + NodeIds []cdp.NodeID `json:"nodeIds,omitempty"` // The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds. +} + +// Do executes DOM.pushNodesByBackendIdsToFrontend against the provided context and +// target handler. +// +// returns: +// nodeIds - The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds. +func (p *PushNodesByBackendIdsToFrontendParams) Do(ctxt context.Context, h cdp.Handler) (nodeIds []cdp.NodeID, err error) { + // execute + var res PushNodesByBackendIdsToFrontendReturns + err = h.Execute(ctxt, cdp.CommandDOMPushNodesByBackendIdsToFrontend, p, &res) + if err != nil { + return nil, err + } + + return res.NodeIds, nil } // QuerySelectorParams executes querySelector on a given node. @@ -313,67 +910,44 @@ func (p *QuerySelectorAllParams) Do(ctxt context.Context, h cdp.Handler) (nodeId return res.NodeIds, nil } -// SetNodeNameParams sets node name for a node with given id. -type SetNodeNameParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set name for. - Name string `json:"name"` // New node's name. +// RedoParams re-does the last undone action. +type RedoParams struct{} + +// Redo re-does the last undone action. +func Redo() *RedoParams { + return &RedoParams{} } -// SetNodeName sets node name for a node with given id. +// Do executes DOM.redo against the provided context and +// target handler. +func (p *RedoParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMRedo, nil, nil) +} + +// RemoveAttributeParams removes attribute with given name from an element +// with given id. +type RemoveAttributeParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the element to remove attribute from. + Name string `json:"name"` // Name of the attribute to remove. +} + +// RemoveAttribute removes attribute with given name from an element with +// given id. // // parameters: -// nodeID - Id of the node to set name for. -// name - New node's name. -func SetNodeName(nodeID cdp.NodeID, name string) *SetNodeNameParams { - return &SetNodeNameParams{ +// nodeID - Id of the element to remove attribute from. +// name - Name of the attribute to remove. +func RemoveAttribute(nodeID cdp.NodeID, name string) *RemoveAttributeParams { + return &RemoveAttributeParams{ NodeID: nodeID, Name: name, } } -// SetNodeNameReturns return values. -type SetNodeNameReturns struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // New node's id. -} - -// Do executes DOM.setNodeName against the provided context and +// Do executes DOM.removeAttribute against the provided context and // target handler. -// -// returns: -// nodeID - New node's id. -func (p *SetNodeNameParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { - // execute - var res SetNodeNameReturns - err = h.Execute(ctxt, cdp.CommandDOMSetNodeName, p, &res) - if err != nil { - return 0, err - } - - return res.NodeID, nil -} - -// SetNodeValueParams sets node value for a node with given id. -type SetNodeValueParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set value for. - Value string `json:"value"` // New node's value. -} - -// SetNodeValue sets node value for a node with given id. -// -// parameters: -// nodeID - Id of the node to set value for. -// value - New node's value. -func SetNodeValue(nodeID cdp.NodeID, value string) *SetNodeValueParams { - return &SetNodeValueParams{ - NodeID: nodeID, - Value: value, - } -} - -// Do executes DOM.setNodeValue against the provided context and -// target handler. -func (p *SetNodeValueParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMSetNodeValue, p, nil) +func (p *RemoveAttributeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMRemoveAttribute, p, nil) } // RemoveNodeParams removes node with given id. @@ -397,6 +971,148 @@ func (p *RemoveNodeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandDOMRemoveNode, p, nil) } +// RequestChildNodesParams requests that children of the node with given id +// are returned to the caller in form of setChildNodes events where not only +// immediate children are retrieved, but all children down to the specified +// depth. +type RequestChildNodesParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get children for. + Depth int64 `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. + Pierce bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false). +} + +// RequestChildNodes requests that children of the node with given id are +// returned to the caller in form of setChildNodes events where not only +// immediate children are retrieved, but all children down to the specified +// depth. +// +// parameters: +// nodeID - Id of the node to get children for. +func RequestChildNodes(nodeID cdp.NodeID) *RequestChildNodesParams { + return &RequestChildNodesParams{ + NodeID: nodeID, + } +} + +// WithDepth the maximum depth at which children should be retrieved, +// defaults to 1. Use -1 for the entire subtree or provide an integer larger +// than 0. +func (p RequestChildNodesParams) WithDepth(depth int64) *RequestChildNodesParams { + p.Depth = depth + return &p +} + +// WithPierce whether or not iframes and shadow roots should be traversed +// when returning the sub-tree (default is false). +func (p RequestChildNodesParams) WithPierce(pierce bool) *RequestChildNodesParams { + p.Pierce = pierce + return &p +} + +// Do executes DOM.requestChildNodes against the provided context and +// target handler. +func (p *RequestChildNodesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMRequestChildNodes, p, nil) +} + +// RequestNodeParams requests that the node is sent to the caller given the +// JavaScript node object reference. All nodes that form the path from the node +// to the root are also sent to the client as a series of setChildNodes +// notifications. +type RequestNodeParams struct { + ObjectID runtime.RemoteObjectID `json:"objectId"` // JavaScript object id to convert into node. +} + +// RequestNode requests that the node is sent to the caller given the +// JavaScript node object reference. All nodes that form the path from the node +// to the root are also sent to the client as a series of setChildNodes +// notifications. +// +// parameters: +// objectID - JavaScript object id to convert into node. +func RequestNode(objectID runtime.RemoteObjectID) *RequestNodeParams { + return &RequestNodeParams{ + ObjectID: objectID, + } +} + +// RequestNodeReturns return values. +type RequestNodeReturns struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Node id for given object. +} + +// Do executes DOM.requestNode against the provided context and +// target handler. +// +// returns: +// nodeID - Node id for given object. +func (p *RequestNodeParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { + // execute + var res RequestNodeReturns + err = h.Execute(ctxt, cdp.CommandDOMRequestNode, p, &res) + if err != nil { + return 0, err + } + + return res.NodeID, nil +} + +// ResolveNodeParams resolves the JavaScript node object for a given NodeId +// or BackendNodeId. +type ResolveNodeParams struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node to resolve. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Backend identifier of the node to resolve. + ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. +} + +// ResolveNode resolves the JavaScript node object for a given NodeId or +// BackendNodeId. +// +// parameters: +func ResolveNode() *ResolveNodeParams { + return &ResolveNodeParams{} +} + +// WithNodeID ID of the node to resolve. +func (p ResolveNodeParams) WithNodeID(nodeID cdp.NodeID) *ResolveNodeParams { + p.NodeID = nodeID + return &p +} + +// WithBackendNodeID backend identifier of the node to resolve. +func (p ResolveNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *ResolveNodeParams { + p.BackendNodeID = backendNodeID + return &p +} + +// WithObjectGroup symbolic group name that can be used to release multiple +// objects. +func (p ResolveNodeParams) WithObjectGroup(objectGroup string) *ResolveNodeParams { + p.ObjectGroup = objectGroup + return &p +} + +// ResolveNodeReturns return values. +type ResolveNodeReturns struct { + Object *runtime.RemoteObject `json:"object,omitempty"` // JavaScript object wrapper for given node. +} + +// Do executes DOM.resolveNode against the provided context and +// target handler. +// +// returns: +// object - JavaScript object wrapper for given node. +func (p *ResolveNodeParams) Do(ctxt context.Context, h cdp.Handler) (object *runtime.RemoteObject, err error) { + // execute + var res ResolveNodeReturns + err = h.Execute(ctxt, cdp.CommandDOMResolveNode, p, &res) + if err != nil { + return nil, err + } + + return res.Object, nil +} + // SetAttributeValueParams sets attribute for an element with given id. type SetAttributeValueParams struct { NodeID cdp.NodeID `json:"nodeId"` // Id of the element to set attribute for. @@ -460,636 +1176,6 @@ func (p *SetAttributesAsTextParams) Do(ctxt context.Context, h cdp.Handler) (err return h.Execute(ctxt, cdp.CommandDOMSetAttributesAsText, p, nil) } -// RemoveAttributeParams removes attribute with given name from an element -// with given id. -type RemoveAttributeParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the element to remove attribute from. - Name string `json:"name"` // Name of the attribute to remove. -} - -// RemoveAttribute removes attribute with given name from an element with -// given id. -// -// parameters: -// nodeID - Id of the element to remove attribute from. -// name - Name of the attribute to remove. -func RemoveAttribute(nodeID cdp.NodeID, name string) *RemoveAttributeParams { - return &RemoveAttributeParams{ - NodeID: nodeID, - Name: name, - } -} - -// Do executes DOM.removeAttribute against the provided context and -// target handler. -func (p *RemoveAttributeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMRemoveAttribute, p, nil) -} - -// GetOuterHTMLParams returns node's HTML markup. -type GetOuterHTMLParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. -} - -// GetOuterHTML returns node's HTML markup. -// -// parameters: -func GetOuterHTML() *GetOuterHTMLParams { - return &GetOuterHTMLParams{} -} - -// WithNodeID identifier of the node. -func (p GetOuterHTMLParams) WithNodeID(nodeID cdp.NodeID) *GetOuterHTMLParams { - p.NodeID = nodeID - return &p -} - -// WithBackendNodeID identifier of the backend node. -func (p GetOuterHTMLParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetOuterHTMLParams { - p.BackendNodeID = backendNodeID - return &p -} - -// WithObjectID JavaScript object id of the node wrapper. -func (p GetOuterHTMLParams) WithObjectID(objectID runtime.RemoteObjectID) *GetOuterHTMLParams { - p.ObjectID = objectID - return &p -} - -// GetOuterHTMLReturns return values. -type GetOuterHTMLReturns struct { - OuterHTML string `json:"outerHTML,omitempty"` // Outer HTML markup. -} - -// Do executes DOM.getOuterHTML against the provided context and -// target handler. -// -// returns: -// outerHTML - Outer HTML markup. -func (p *GetOuterHTMLParams) Do(ctxt context.Context, h cdp.Handler) (outerHTML string, err error) { - // execute - var res GetOuterHTMLReturns - err = h.Execute(ctxt, cdp.CommandDOMGetOuterHTML, p, &res) - if err != nil { - return "", err - } - - return res.OuterHTML, nil -} - -// SetOuterHTMLParams sets node HTML markup, returns new node id. -type SetOuterHTMLParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set markup for. - OuterHTML string `json:"outerHTML"` // Outer HTML markup to set. -} - -// SetOuterHTML sets node HTML markup, returns new node id. -// -// parameters: -// nodeID - Id of the node to set markup for. -// outerHTML - Outer HTML markup to set. -func SetOuterHTML(nodeID cdp.NodeID, outerHTML string) *SetOuterHTMLParams { - return &SetOuterHTMLParams{ - NodeID: nodeID, - OuterHTML: outerHTML, - } -} - -// Do executes DOM.setOuterHTML against the provided context and -// target handler. -func (p *SetOuterHTMLParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMSetOuterHTML, p, nil) -} - -// PerformSearchParams searches for a given string in the DOM tree. Use -// getSearchResults to access search results or cancelSearch to end this search -// session. -type PerformSearchParams struct { - Query string `json:"query"` // Plain text or query selector or XPath search query. - IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM,omitempty"` // True to search in user agent shadow DOM. -} - -// PerformSearch searches for a given string in the DOM tree. Use -// getSearchResults to access search results or cancelSearch to end this search -// session. -// -// parameters: -// query - Plain text or query selector or XPath search query. -func PerformSearch(query string) *PerformSearchParams { - return &PerformSearchParams{ - Query: query, - } -} - -// WithIncludeUserAgentShadowDOM true to search in user agent shadow DOM. -func (p PerformSearchParams) WithIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *PerformSearchParams { - p.IncludeUserAgentShadowDOM = includeUserAgentShadowDOM - return &p -} - -// PerformSearchReturns return values. -type PerformSearchReturns struct { - SearchID string `json:"searchId,omitempty"` // Unique search session identifier. - ResultCount int64 `json:"resultCount,omitempty"` // Number of search results. -} - -// Do executes DOM.performSearch against the provided context and -// target handler. -// -// returns: -// searchID - Unique search session identifier. -// resultCount - Number of search results. -func (p *PerformSearchParams) Do(ctxt context.Context, h cdp.Handler) (searchID string, resultCount int64, err error) { - // execute - var res PerformSearchReturns - err = h.Execute(ctxt, cdp.CommandDOMPerformSearch, p, &res) - if err != nil { - return "", 0, err - } - - return res.SearchID, res.ResultCount, nil -} - -// GetSearchResultsParams returns search results from given fromIndex to -// given toIndex from the search with the given identifier. -type GetSearchResultsParams struct { - SearchID string `json:"searchId"` // Unique search session identifier. - FromIndex int64 `json:"fromIndex"` // Start index of the search result to be returned. - ToIndex int64 `json:"toIndex"` // End index of the search result to be returned. -} - -// GetSearchResults returns search results from given fromIndex to given -// toIndex from the search with the given identifier. -// -// parameters: -// searchID - Unique search session identifier. -// fromIndex - Start index of the search result to be returned. -// toIndex - End index of the search result to be returned. -func GetSearchResults(searchID string, fromIndex int64, toIndex int64) *GetSearchResultsParams { - return &GetSearchResultsParams{ - SearchID: searchID, - FromIndex: fromIndex, - ToIndex: toIndex, - } -} - -// GetSearchResultsReturns return values. -type GetSearchResultsReturns struct { - NodeIds []cdp.NodeID `json:"nodeIds,omitempty"` // Ids of the search result nodes. -} - -// Do executes DOM.getSearchResults against the provided context and -// target handler. -// -// returns: -// nodeIds - Ids of the search result nodes. -func (p *GetSearchResultsParams) Do(ctxt context.Context, h cdp.Handler) (nodeIds []cdp.NodeID, err error) { - // execute - var res GetSearchResultsReturns - err = h.Execute(ctxt, cdp.CommandDOMGetSearchResults, p, &res) - if err != nil { - return nil, err - } - - return res.NodeIds, nil -} - -// DiscardSearchResultsParams discards search results from the session with -// the given id. getSearchResults should no longer be called for that search. -type DiscardSearchResultsParams struct { - SearchID string `json:"searchId"` // Unique search session identifier. -} - -// DiscardSearchResults discards search results from the session with the -// given id. getSearchResults should no longer be called for that search. -// -// parameters: -// searchID - Unique search session identifier. -func DiscardSearchResults(searchID string) *DiscardSearchResultsParams { - return &DiscardSearchResultsParams{ - SearchID: searchID, - } -} - -// Do executes DOM.discardSearchResults against the provided context and -// target handler. -func (p *DiscardSearchResultsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDiscardSearchResults, p, nil) -} - -// RequestNodeParams requests that the node is sent to the caller given the -// JavaScript node object reference. All nodes that form the path from the node -// to the root are also sent to the client as a series of setChildNodes -// notifications. -type RequestNodeParams struct { - ObjectID runtime.RemoteObjectID `json:"objectId"` // JavaScript object id to convert into node. -} - -// RequestNode requests that the node is sent to the caller given the -// JavaScript node object reference. All nodes that form the path from the node -// to the root are also sent to the client as a series of setChildNodes -// notifications. -// -// parameters: -// objectID - JavaScript object id to convert into node. -func RequestNode(objectID runtime.RemoteObjectID) *RequestNodeParams { - return &RequestNodeParams{ - ObjectID: objectID, - } -} - -// RequestNodeReturns return values. -type RequestNodeReturns struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Node id for given object. -} - -// Do executes DOM.requestNode against the provided context and -// target handler. -// -// returns: -// nodeID - Node id for given object. -func (p *RequestNodeParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { - // execute - var res RequestNodeReturns - err = h.Execute(ctxt, cdp.CommandDOMRequestNode, p, &res) - if err != nil { - return 0, err - } - - return res.NodeID, nil -} - -// PushNodeByPathToFrontendParams requests that the node is sent to the -// caller given its path. // FIXME, use XPath. -type PushNodeByPathToFrontendParams struct { - Path string `json:"path"` // Path to node in the proprietary format. -} - -// PushNodeByPathToFrontend requests that the node is sent to the caller -// given its path. // FIXME, use XPath. -// -// parameters: -// path - Path to node in the proprietary format. -func PushNodeByPathToFrontend(path string) *PushNodeByPathToFrontendParams { - return &PushNodeByPathToFrontendParams{ - Path: path, - } -} - -// PushNodeByPathToFrontendReturns return values. -type PushNodeByPathToFrontendReturns struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node for given path. -} - -// Do executes DOM.pushNodeByPathToFrontend against the provided context and -// target handler. -// -// returns: -// nodeID - Id of the node for given path. -func (p *PushNodeByPathToFrontendParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { - // execute - var res PushNodeByPathToFrontendReturns - err = h.Execute(ctxt, cdp.CommandDOMPushNodeByPathToFrontend, p, &res) - if err != nil { - return 0, err - } - - return res.NodeID, nil -} - -// PushNodesByBackendIdsToFrontendParams requests that a batch of nodes is -// sent to the caller given their backend node ids. -type PushNodesByBackendIdsToFrontendParams struct { - BackendNodeIds []cdp.BackendNodeID `json:"backendNodeIds"` // The array of backend node ids. -} - -// PushNodesByBackendIdsToFrontend requests that a batch of nodes is sent to -// the caller given their backend node ids. -// -// parameters: -// backendNodeIds - The array of backend node ids. -func PushNodesByBackendIdsToFrontend(backendNodeIds []cdp.BackendNodeID) *PushNodesByBackendIdsToFrontendParams { - return &PushNodesByBackendIdsToFrontendParams{ - BackendNodeIds: backendNodeIds, - } -} - -// PushNodesByBackendIdsToFrontendReturns return values. -type PushNodesByBackendIdsToFrontendReturns struct { - NodeIds []cdp.NodeID `json:"nodeIds,omitempty"` // The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds. -} - -// Do executes DOM.pushNodesByBackendIdsToFrontend against the provided context and -// target handler. -// -// returns: -// nodeIds - The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds. -func (p *PushNodesByBackendIdsToFrontendParams) Do(ctxt context.Context, h cdp.Handler) (nodeIds []cdp.NodeID, err error) { - // execute - var res PushNodesByBackendIdsToFrontendReturns - err = h.Execute(ctxt, cdp.CommandDOMPushNodesByBackendIdsToFrontend, p, &res) - if err != nil { - return nil, err - } - - return res.NodeIds, nil -} - -// SetInspectedNodeParams enables console to refer to the node with given id -// via $x (see Command Line API for more details $x functions). -type SetInspectedNodeParams struct { - NodeID cdp.NodeID `json:"nodeId"` // DOM node id to be accessible by means of $x command line API. -} - -// SetInspectedNode enables console to refer to the node with given id via $x -// (see Command Line API for more details $x functions). -// -// parameters: -// nodeID - DOM node id to be accessible by means of $x command line API. -func SetInspectedNode(nodeID cdp.NodeID) *SetInspectedNodeParams { - return &SetInspectedNodeParams{ - NodeID: nodeID, - } -} - -// Do executes DOM.setInspectedNode against the provided context and -// target handler. -func (p *SetInspectedNodeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMSetInspectedNode, p, nil) -} - -// ResolveNodeParams resolves the JavaScript node object for a given NodeId -// or BackendNodeId. -type ResolveNodeParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node to resolve. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Backend identifier of the node to resolve. - ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. -} - -// ResolveNode resolves the JavaScript node object for a given NodeId or -// BackendNodeId. -// -// parameters: -func ResolveNode() *ResolveNodeParams { - return &ResolveNodeParams{} -} - -// WithNodeID ID of the node to resolve. -func (p ResolveNodeParams) WithNodeID(nodeID cdp.NodeID) *ResolveNodeParams { - p.NodeID = nodeID - return &p -} - -// WithBackendNodeID backend identifier of the node to resolve. -func (p ResolveNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *ResolveNodeParams { - p.BackendNodeID = backendNodeID - return &p -} - -// WithObjectGroup symbolic group name that can be used to release multiple -// objects. -func (p ResolveNodeParams) WithObjectGroup(objectGroup string) *ResolveNodeParams { - p.ObjectGroup = objectGroup - return &p -} - -// ResolveNodeReturns return values. -type ResolveNodeReturns struct { - Object *runtime.RemoteObject `json:"object,omitempty"` // JavaScript object wrapper for given node. -} - -// Do executes DOM.resolveNode against the provided context and -// target handler. -// -// returns: -// object - JavaScript object wrapper for given node. -func (p *ResolveNodeParams) Do(ctxt context.Context, h cdp.Handler) (object *runtime.RemoteObject, err error) { - // execute - var res ResolveNodeReturns - err = h.Execute(ctxt, cdp.CommandDOMResolveNode, p, &res) - if err != nil { - return nil, err - } - - return res.Object, nil -} - -// GetAttributesParams returns attributes for the specified node. -type GetAttributesParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to retrieve attibutes for. -} - -// GetAttributes returns attributes for the specified node. -// -// parameters: -// nodeID - Id of the node to retrieve attibutes for. -func GetAttributes(nodeID cdp.NodeID) *GetAttributesParams { - return &GetAttributesParams{ - NodeID: nodeID, - } -} - -// GetAttributesReturns return values. -type GetAttributesReturns struct { - Attributes []string `json:"attributes,omitempty"` // An interleaved array of node attribute names and values. -} - -// Do executes DOM.getAttributes against the provided context and -// target handler. -// -// returns: -// attributes - An interleaved array of node attribute names and values. -func (p *GetAttributesParams) Do(ctxt context.Context, h cdp.Handler) (attributes []string, err error) { - // execute - var res GetAttributesReturns - err = h.Execute(ctxt, cdp.CommandDOMGetAttributes, p, &res) - if err != nil { - return nil, err - } - - return res.Attributes, nil -} - -// CopyToParams creates a deep copy of the specified node and places it into -// the target container before the given anchor. -type CopyToParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to copy. - TargetNodeID cdp.NodeID `json:"targetNodeId"` // Id of the element to drop the copy into. - InsertBeforeNodeID cdp.NodeID `json:"insertBeforeNodeId,omitempty"` // Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId). -} - -// CopyTo creates a deep copy of the specified node and places it into the -// target container before the given anchor. -// -// parameters: -// nodeID - Id of the node to copy. -// targetNodeID - Id of the element to drop the copy into. -func CopyTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID) *CopyToParams { - return &CopyToParams{ - NodeID: nodeID, - TargetNodeID: targetNodeID, - } -} - -// WithInsertBeforeNodeID drop the copy before this node (if absent, the copy -// becomes the last child of targetNodeId). -func (p CopyToParams) WithInsertBeforeNodeID(insertBeforeNodeID cdp.NodeID) *CopyToParams { - p.InsertBeforeNodeID = insertBeforeNodeID - return &p -} - -// CopyToReturns return values. -type CopyToReturns struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node clone. -} - -// Do executes DOM.copyTo against the provided context and -// target handler. -// -// returns: -// nodeID - Id of the node clone. -func (p *CopyToParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { - // execute - var res CopyToReturns - err = h.Execute(ctxt, cdp.CommandDOMCopyTo, p, &res) - if err != nil { - return 0, err - } - - return res.NodeID, nil -} - -// MoveToParams moves node into the new container, places it before the given -// anchor. -type MoveToParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to move. - TargetNodeID cdp.NodeID `json:"targetNodeId"` // Id of the element to drop the moved node into. - InsertBeforeNodeID cdp.NodeID `json:"insertBeforeNodeId,omitempty"` // Drop node before this one (if absent, the moved node becomes the last child of targetNodeId). -} - -// MoveTo moves node into the new container, places it before the given -// anchor. -// -// parameters: -// nodeID - Id of the node to move. -// targetNodeID - Id of the element to drop the moved node into. -func MoveTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID) *MoveToParams { - return &MoveToParams{ - NodeID: nodeID, - TargetNodeID: targetNodeID, - } -} - -// WithInsertBeforeNodeID drop node before this one (if absent, the moved -// node becomes the last child of targetNodeId). -func (p MoveToParams) WithInsertBeforeNodeID(insertBeforeNodeID cdp.NodeID) *MoveToParams { - p.InsertBeforeNodeID = insertBeforeNodeID - return &p -} - -// MoveToReturns return values. -type MoveToReturns struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // New id of the moved node. -} - -// Do executes DOM.moveTo against the provided context and -// target handler. -// -// returns: -// nodeID - New id of the moved node. -func (p *MoveToParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { - // execute - var res MoveToReturns - err = h.Execute(ctxt, cdp.CommandDOMMoveTo, p, &res) - if err != nil { - return 0, err - } - - return res.NodeID, nil -} - -// UndoParams undoes the last performed action. -type UndoParams struct{} - -// Undo undoes the last performed action. -func Undo() *UndoParams { - return &UndoParams{} -} - -// Do executes DOM.undo against the provided context and -// target handler. -func (p *UndoParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMUndo, nil, nil) -} - -// RedoParams re-does the last undone action. -type RedoParams struct{} - -// Redo re-does the last undone action. -func Redo() *RedoParams { - return &RedoParams{} -} - -// Do executes DOM.redo against the provided context and -// target handler. -func (p *RedoParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMRedo, nil, nil) -} - -// MarkUndoableStateParams marks last undoable state. -type MarkUndoableStateParams struct{} - -// MarkUndoableState marks last undoable state. -func MarkUndoableState() *MarkUndoableStateParams { - return &MarkUndoableStateParams{} -} - -// Do executes DOM.markUndoableState against the provided context and -// target handler. -func (p *MarkUndoableStateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMMarkUndoableState, nil, nil) -} - -// FocusParams focuses the given element. -type FocusParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. -} - -// Focus focuses the given element. -// -// parameters: -func Focus() *FocusParams { - return &FocusParams{} -} - -// WithNodeID identifier of the node. -func (p FocusParams) WithNodeID(nodeID cdp.NodeID) *FocusParams { - p.NodeID = nodeID - return &p -} - -// WithBackendNodeID identifier of the backend node. -func (p FocusParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *FocusParams { - p.BackendNodeID = backendNodeID - return &p -} - -// WithObjectID JavaScript object id of the node wrapper. -func (p FocusParams) WithObjectID(objectID runtime.RemoteObjectID) *FocusParams { - p.ObjectID = objectID - return &p -} - -// Do executes DOM.focus against the provided context and -// target handler. -func (p *FocusParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMFocus, p, nil) -} - // SetFileInputFilesParams sets files for the given file input element. type SetFileInputFilesParams struct { Files []string `json:"files"` // Array of file paths to set. @@ -1132,137 +1218,61 @@ func (p *SetFileInputFilesParams) Do(ctxt context.Context, h cdp.Handler) (err e return h.Execute(ctxt, cdp.CommandDOMSetFileInputFiles, p, nil) } -// GetBoxModelParams returns boxes for the given node. -type GetBoxModelParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. +// SetInspectedNodeParams enables console to refer to the node with given id +// via $x (see Command Line API for more details $x functions). +type SetInspectedNodeParams struct { + NodeID cdp.NodeID `json:"nodeId"` // DOM node id to be accessible by means of $x command line API. } -// GetBoxModel returns boxes for the given node. +// SetInspectedNode enables console to refer to the node with given id via $x +// (see Command Line API for more details $x functions). // // parameters: -func GetBoxModel() *GetBoxModelParams { - return &GetBoxModelParams{} -} - -// WithNodeID identifier of the node. -func (p GetBoxModelParams) WithNodeID(nodeID cdp.NodeID) *GetBoxModelParams { - p.NodeID = nodeID - return &p -} - -// WithBackendNodeID identifier of the backend node. -func (p GetBoxModelParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetBoxModelParams { - p.BackendNodeID = backendNodeID - return &p -} - -// WithObjectID JavaScript object id of the node wrapper. -func (p GetBoxModelParams) WithObjectID(objectID runtime.RemoteObjectID) *GetBoxModelParams { - p.ObjectID = objectID - return &p -} - -// GetBoxModelReturns return values. -type GetBoxModelReturns struct { - Model *BoxModel `json:"model,omitempty"` // Box model for the node. -} - -// Do executes DOM.getBoxModel against the provided context and -// target handler. -// -// returns: -// model - Box model for the node. -func (p *GetBoxModelParams) Do(ctxt context.Context, h cdp.Handler) (model *BoxModel, err error) { - // execute - var res GetBoxModelReturns - err = h.Execute(ctxt, cdp.CommandDOMGetBoxModel, p, &res) - if err != nil { - return nil, err - } - - return res.Model, nil -} - -// GetNodeForLocationParams returns node id at given location. -type GetNodeForLocationParams struct { - X int64 `json:"x"` // X coordinate. - Y int64 `json:"y"` // Y coordinate. - IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM,omitempty"` // False to skip to the nearest non-UA shadow root ancestor (default: false). -} - -// GetNodeForLocation returns node id at given location. -// -// parameters: -// x - X coordinate. -// y - Y coordinate. -func GetNodeForLocation(x int64, y int64) *GetNodeForLocationParams { - return &GetNodeForLocationParams{ - X: x, - Y: y, - } -} - -// WithIncludeUserAgentShadowDOM false to skip to the nearest non-UA shadow -// root ancestor (default: false). -func (p GetNodeForLocationParams) WithIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *GetNodeForLocationParams { - p.IncludeUserAgentShadowDOM = includeUserAgentShadowDOM - return &p -} - -// GetNodeForLocationReturns return values. -type GetNodeForLocationReturns struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node at given coordinates. -} - -// Do executes DOM.getNodeForLocation against the provided context and -// target handler. -// -// returns: -// nodeID - Id of the node at given coordinates. -func (p *GetNodeForLocationParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { - // execute - var res GetNodeForLocationReturns - err = h.Execute(ctxt, cdp.CommandDOMGetNodeForLocation, p, &res) - if err != nil { - return 0, err - } - - return res.NodeID, nil -} - -// GetRelayoutBoundaryParams returns the id of the nearest ancestor that is a -// relayout boundary. -type GetRelayoutBoundaryParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node. -} - -// GetRelayoutBoundary returns the id of the nearest ancestor that is a -// relayout boundary. -// -// parameters: -// nodeID - Id of the node. -func GetRelayoutBoundary(nodeID cdp.NodeID) *GetRelayoutBoundaryParams { - return &GetRelayoutBoundaryParams{ +// nodeID - DOM node id to be accessible by means of $x command line API. +func SetInspectedNode(nodeID cdp.NodeID) *SetInspectedNodeParams { + return &SetInspectedNodeParams{ NodeID: nodeID, } } -// GetRelayoutBoundaryReturns return values. -type GetRelayoutBoundaryReturns struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Relayout boundary node id for the given node. +// Do executes DOM.setInspectedNode against the provided context and +// target handler. +func (p *SetInspectedNodeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMSetInspectedNode, p, nil) } -// Do executes DOM.getRelayoutBoundary against the provided context and +// SetNodeNameParams sets node name for a node with given id. +type SetNodeNameParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set name for. + Name string `json:"name"` // New node's name. +} + +// SetNodeName sets node name for a node with given id. +// +// parameters: +// nodeID - Id of the node to set name for. +// name - New node's name. +func SetNodeName(nodeID cdp.NodeID, name string) *SetNodeNameParams { + return &SetNodeNameParams{ + NodeID: nodeID, + Name: name, + } +} + +// SetNodeNameReturns return values. +type SetNodeNameReturns struct { + NodeID cdp.NodeID `json:"nodeId,omitempty"` // New node's id. +} + +// Do executes DOM.setNodeName against the provided context and // target handler. // // returns: -// nodeID - Relayout boundary node id for the given node. -func (p *GetRelayoutBoundaryParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { +// nodeID - New node's id. +func (p *SetNodeNameParams) Do(ctxt context.Context, h cdp.Handler) (nodeID cdp.NodeID, err error) { // execute - var res GetRelayoutBoundaryReturns - err = h.Execute(ctxt, cdp.CommandDOMGetRelayoutBoundary, p, &res) + var res SetNodeNameReturns + err = h.Execute(ctxt, cdp.CommandDOMSetNodeName, p, &res) if err != nil { return 0, err } @@ -1270,74 +1280,64 @@ func (p *GetRelayoutBoundaryParams) Do(ctxt context.Context, h cdp.Handler) (nod return res.NodeID, nil } -// DescribeNodeParams describes node given its id, does not require domain to -// be enabled. Does not start tracking any objects, can be used for automation. -type DescribeNodeParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper. - Depth int64 `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. - Pierce bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). +// SetNodeValueParams sets node value for a node with given id. +type SetNodeValueParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set value for. + Value string `json:"value"` // New node's value. } -// DescribeNode describes node given its id, does not require domain to be -// enabled. Does not start tracking any objects, can be used for automation. +// SetNodeValue sets node value for a node with given id. // // parameters: -func DescribeNode() *DescribeNodeParams { - return &DescribeNodeParams{} -} - -// WithNodeID identifier of the node. -func (p DescribeNodeParams) WithNodeID(nodeID cdp.NodeID) *DescribeNodeParams { - p.NodeID = nodeID - return &p -} - -// WithBackendNodeID identifier of the backend node. -func (p DescribeNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *DescribeNodeParams { - p.BackendNodeID = backendNodeID - return &p -} - -// WithObjectID JavaScript object id of the node wrapper. -func (p DescribeNodeParams) WithObjectID(objectID runtime.RemoteObjectID) *DescribeNodeParams { - p.ObjectID = objectID - return &p -} - -// WithDepth the maximum depth at which children should be retrieved, -// defaults to 1. Use -1 for the entire subtree or provide an integer larger -// than 0. -func (p DescribeNodeParams) WithDepth(depth int64) *DescribeNodeParams { - p.Depth = depth - return &p -} - -// WithPierce whether or not iframes and shadow roots should be traversed -// when returning the subtree (default is false). -func (p DescribeNodeParams) WithPierce(pierce bool) *DescribeNodeParams { - p.Pierce = pierce - return &p -} - -// DescribeNodeReturns return values. -type DescribeNodeReturns struct { - Node *cdp.Node `json:"node,omitempty"` // Node description. -} - -// Do executes DOM.describeNode against the provided context and -// target handler. -// -// returns: -// node - Node description. -func (p *DescribeNodeParams) Do(ctxt context.Context, h cdp.Handler) (node *cdp.Node, err error) { - // execute - var res DescribeNodeReturns - err = h.Execute(ctxt, cdp.CommandDOMDescribeNode, p, &res) - if err != nil { - return nil, err +// nodeID - Id of the node to set value for. +// value - New node's value. +func SetNodeValue(nodeID cdp.NodeID, value string) *SetNodeValueParams { + return &SetNodeValueParams{ + NodeID: nodeID, + Value: value, } - - return res.Node, nil +} + +// Do executes DOM.setNodeValue against the provided context and +// target handler. +func (p *SetNodeValueParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMSetNodeValue, p, nil) +} + +// SetOuterHTMLParams sets node HTML markup, returns new node id. +type SetOuterHTMLParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set markup for. + OuterHTML string `json:"outerHTML"` // Outer HTML markup to set. +} + +// SetOuterHTML sets node HTML markup, returns new node id. +// +// parameters: +// nodeID - Id of the node to set markup for. +// outerHTML - Outer HTML markup to set. +func SetOuterHTML(nodeID cdp.NodeID, outerHTML string) *SetOuterHTMLParams { + return &SetOuterHTMLParams{ + NodeID: nodeID, + OuterHTML: outerHTML, + } +} + +// Do executes DOM.setOuterHTML against the provided context and +// target handler. +func (p *SetOuterHTMLParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMSetOuterHTML, p, nil) +} + +// UndoParams undoes the last performed action. +type UndoParams struct{} + +// Undo undoes the last performed action. +func Undo() *UndoParams { + return &UndoParams{} +} + +// Do executes DOM.undo against the provided context and +// target handler. +func (p *UndoParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMUndo, nil, nil) } diff --git a/cdp/dom/events.go b/cdp/dom/events.go index 8ffb465..0994be4 100644 --- a/cdp/dom/events.go +++ b/cdp/dom/events.go @@ -6,18 +6,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EventDocumentUpdated fired when Document has been totally updated. Node -// ids are no longer valid. -type EventDocumentUpdated struct{} - -// EventSetChildNodes fired when backend wants to provide client with the -// missing DOM structure. This happens upon most of the calls requesting node -// ids. -type EventSetChildNodes struct { - ParentID cdp.NodeID `json:"parentId"` // Parent node id to populate with children. - Nodes []*cdp.Node `json:"nodes"` // Child nodes array. -} - // EventAttributeModified fired when Element's attribute is modified. type EventAttributeModified struct { NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has changed. @@ -31,12 +19,6 @@ type EventAttributeRemoved struct { Name string `json:"name"` // A ttribute name. } -// EventInlineStyleInvalidated fired when Element's inline style is modified -// via a CSS property modification. -type EventInlineStyleInvalidated struct { - NodeIds []cdp.NodeID `json:"nodeIds"` // Ids of the nodes for which the inline styles have been invalidated. -} - // EventCharacterDataModified mirrors DOMCharacterDataModified event. type EventCharacterDataModified struct { NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has changed. @@ -63,16 +45,20 @@ type EventChildNodeRemoved struct { NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has been removed. } -// EventShadowRootPushed called when shadow root is pushed into the element. -type EventShadowRootPushed struct { - HostID cdp.NodeID `json:"hostId"` // Host element id. - Root *cdp.Node `json:"root"` // Shadow root. +// EventDistributedNodesUpdated called when distribution is changed. +type EventDistributedNodesUpdated struct { + InsertionPointID cdp.NodeID `json:"insertionPointId"` // Insertion point where distributed nodes were updated. + DistributedNodes []*cdp.BackendNode `json:"distributedNodes"` // Distributed nodes for given insertion point. } -// EventShadowRootPopped called when shadow root is popped from the element. -type EventShadowRootPopped struct { - HostID cdp.NodeID `json:"hostId"` // Host element id. - RootID cdp.NodeID `json:"rootId"` // Shadow root id. +// EventDocumentUpdated fired when Document has been totally updated. Node +// ids are no longer valid. +type EventDocumentUpdated struct{} + +// EventInlineStyleInvalidated fired when Element's inline style is modified +// via a CSS property modification. +type EventInlineStyleInvalidated struct { + NodeIds []cdp.NodeID `json:"nodeIds"` // Ids of the nodes for which the inline styles have been invalidated. } // EventPseudoElementAdded called when a pseudo element is added to an @@ -89,26 +75,40 @@ type EventPseudoElementRemoved struct { PseudoElementID cdp.NodeID `json:"pseudoElementId"` // The removed pseudo element id. } -// EventDistributedNodesUpdated called when distribution is changed. -type EventDistributedNodesUpdated struct { - InsertionPointID cdp.NodeID `json:"insertionPointId"` // Insertion point where distributed nodes were updated. - DistributedNodes []*cdp.BackendNode `json:"distributedNodes"` // Distributed nodes for given insertion point. +// EventSetChildNodes fired when backend wants to provide client with the +// missing DOM structure. This happens upon most of the calls requesting node +// ids. +type EventSetChildNodes struct { + ParentID cdp.NodeID `json:"parentId"` // Parent node id to populate with children. + Nodes []*cdp.Node `json:"nodes"` // Child nodes array. +} + +// EventShadowRootPopped called when shadow root is popped from the element. +type EventShadowRootPopped struct { + HostID cdp.NodeID `json:"hostId"` // Host element id. + RootID cdp.NodeID `json:"rootId"` // Shadow root id. +} + +// EventShadowRootPushed called when shadow root is pushed into the element. +type EventShadowRootPushed struct { + HostID cdp.NodeID `json:"hostId"` // Host element id. + Root *cdp.Node `json:"root"` // Shadow root. } // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventDOMDocumentUpdated, - cdp.EventDOMSetChildNodes, cdp.EventDOMAttributeModified, cdp.EventDOMAttributeRemoved, - cdp.EventDOMInlineStyleInvalidated, cdp.EventDOMCharacterDataModified, cdp.EventDOMChildNodeCountUpdated, cdp.EventDOMChildNodeInserted, cdp.EventDOMChildNodeRemoved, - cdp.EventDOMShadowRootPushed, - cdp.EventDOMShadowRootPopped, + cdp.EventDOMDistributedNodesUpdated, + cdp.EventDOMDocumentUpdated, + cdp.EventDOMInlineStyleInvalidated, cdp.EventDOMPseudoElementAdded, cdp.EventDOMPseudoElementRemoved, - cdp.EventDOMDistributedNodesUpdated, + cdp.EventDOMSetChildNodes, + cdp.EventDOMShadowRootPopped, + cdp.EventDOMShadowRootPushed, } diff --git a/cdp/domdebugger/domdebugger.go b/cdp/domdebugger/domdebugger.go index c6a3a54..f813408 100644 --- a/cdp/domdebugger/domdebugger.go +++ b/cdp/domdebugger/domdebugger.go @@ -17,201 +17,6 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) -// SetDOMBreakpointParams sets breakpoint on particular operation with DOM. -type SetDOMBreakpointParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to set breakpoint on. - Type DOMBreakpointType `json:"type"` // Type of the operation to stop upon. -} - -// SetDOMBreakpoint sets breakpoint on particular operation with DOM. -// -// parameters: -// nodeID - Identifier of the node to set breakpoint on. -// type - Type of the operation to stop upon. -func SetDOMBreakpoint(nodeID cdp.NodeID, typeVal DOMBreakpointType) *SetDOMBreakpointParams { - return &SetDOMBreakpointParams{ - NodeID: nodeID, - Type: typeVal, - } -} - -// Do executes DOMDebugger.setDOMBreakpoint against the provided context and -// target handler. -func (p *SetDOMBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerSetDOMBreakpoint, p, nil) -} - -// RemoveDOMBreakpointParams removes DOM breakpoint that was set using -// setDOMBreakpoint. -type RemoveDOMBreakpointParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to remove breakpoint from. - Type DOMBreakpointType `json:"type"` // Type of the breakpoint to remove. -} - -// RemoveDOMBreakpoint removes DOM breakpoint that was set using -// setDOMBreakpoint. -// -// parameters: -// nodeID - Identifier of the node to remove breakpoint from. -// type - Type of the breakpoint to remove. -func RemoveDOMBreakpoint(nodeID cdp.NodeID, typeVal DOMBreakpointType) *RemoveDOMBreakpointParams { - return &RemoveDOMBreakpointParams{ - NodeID: nodeID, - Type: typeVal, - } -} - -// Do executes DOMDebugger.removeDOMBreakpoint against the provided context and -// target handler. -func (p *RemoveDOMBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveDOMBreakpoint, p, nil) -} - -// SetEventListenerBreakpointParams sets breakpoint on particular DOM event. -type SetEventListenerBreakpointParams struct { - EventName string `json:"eventName"` // DOM Event name to stop on (any DOM event will do). - TargetName string `json:"targetName,omitempty"` // EventTarget interface name to stop on. If equal to "*" or not provided, will stop on any EventTarget. -} - -// SetEventListenerBreakpoint sets breakpoint on particular DOM event. -// -// parameters: -// eventName - DOM Event name to stop on (any DOM event will do). -func SetEventListenerBreakpoint(eventName string) *SetEventListenerBreakpointParams { - return &SetEventListenerBreakpointParams{ - EventName: eventName, - } -} - -// WithTargetName eventTarget interface name to stop on. If equal to "*" or -// not provided, will stop on any EventTarget. -func (p SetEventListenerBreakpointParams) WithTargetName(targetName string) *SetEventListenerBreakpointParams { - p.TargetName = targetName - return &p -} - -// Do executes DOMDebugger.setEventListenerBreakpoint against the provided context and -// target handler. -func (p *SetEventListenerBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerSetEventListenerBreakpoint, p, nil) -} - -// RemoveEventListenerBreakpointParams removes breakpoint on particular DOM -// event. -type RemoveEventListenerBreakpointParams struct { - EventName string `json:"eventName"` // Event name. - TargetName string `json:"targetName,omitempty"` // EventTarget interface name. -} - -// RemoveEventListenerBreakpoint removes breakpoint on particular DOM event. -// -// parameters: -// eventName - Event name. -func RemoveEventListenerBreakpoint(eventName string) *RemoveEventListenerBreakpointParams { - return &RemoveEventListenerBreakpointParams{ - EventName: eventName, - } -} - -// WithTargetName eventTarget interface name. -func (p RemoveEventListenerBreakpointParams) WithTargetName(targetName string) *RemoveEventListenerBreakpointParams { - p.TargetName = targetName - return &p -} - -// Do executes DOMDebugger.removeEventListenerBreakpoint against the provided context and -// target handler. -func (p *RemoveEventListenerBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveEventListenerBreakpoint, p, nil) -} - -// SetInstrumentationBreakpointParams sets breakpoint on particular native -// event. -type SetInstrumentationBreakpointParams struct { - EventName string `json:"eventName"` // Instrumentation name to stop on. -} - -// SetInstrumentationBreakpoint sets breakpoint on particular native event. -// -// parameters: -// eventName - Instrumentation name to stop on. -func SetInstrumentationBreakpoint(eventName string) *SetInstrumentationBreakpointParams { - return &SetInstrumentationBreakpointParams{ - EventName: eventName, - } -} - -// Do executes DOMDebugger.setInstrumentationBreakpoint against the provided context and -// target handler. -func (p *SetInstrumentationBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerSetInstrumentationBreakpoint, p, nil) -} - -// RemoveInstrumentationBreakpointParams removes breakpoint on particular -// native event. -type RemoveInstrumentationBreakpointParams struct { - EventName string `json:"eventName"` // Instrumentation name to stop on. -} - -// RemoveInstrumentationBreakpoint removes breakpoint on particular native -// event. -// -// parameters: -// eventName - Instrumentation name to stop on. -func RemoveInstrumentationBreakpoint(eventName string) *RemoveInstrumentationBreakpointParams { - return &RemoveInstrumentationBreakpointParams{ - EventName: eventName, - } -} - -// Do executes DOMDebugger.removeInstrumentationBreakpoint against the provided context and -// target handler. -func (p *RemoveInstrumentationBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveInstrumentationBreakpoint, p, nil) -} - -// SetXHRBreakpointParams sets breakpoint on XMLHttpRequest. -type SetXHRBreakpointParams struct { - URL string `json:"url"` // Resource URL substring. All XHRs having this substring in the URL will get stopped upon. -} - -// SetXHRBreakpoint sets breakpoint on XMLHttpRequest. -// -// parameters: -// url - Resource URL substring. All XHRs having this substring in the URL will get stopped upon. -func SetXHRBreakpoint(url string) *SetXHRBreakpointParams { - return &SetXHRBreakpointParams{ - URL: url, - } -} - -// Do executes DOMDebugger.setXHRBreakpoint against the provided context and -// target handler. -func (p *SetXHRBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerSetXHRBreakpoint, p, nil) -} - -// RemoveXHRBreakpointParams removes breakpoint from XMLHttpRequest. -type RemoveXHRBreakpointParams struct { - URL string `json:"url"` // Resource URL substring. -} - -// RemoveXHRBreakpoint removes breakpoint from XMLHttpRequest. -// -// parameters: -// url - Resource URL substring. -func RemoveXHRBreakpoint(url string) *RemoveXHRBreakpointParams { - return &RemoveXHRBreakpointParams{ - URL: url, - } -} - -// Do executes DOMDebugger.removeXHRBreakpoint against the provided context and -// target handler. -func (p *RemoveXHRBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveXHRBreakpoint, p, nil) -} - // GetEventListenersParams returns event listeners of the given object. type GetEventListenersParams struct { ObjectID runtime.RemoteObjectID `json:"objectId"` // Identifier of the object to return listeners for. @@ -265,3 +70,198 @@ func (p *GetEventListenersParams) Do(ctxt context.Context, h cdp.Handler) (liste return res.Listeners, nil } + +// RemoveDOMBreakpointParams removes DOM breakpoint that was set using +// setDOMBreakpoint. +type RemoveDOMBreakpointParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to remove breakpoint from. + Type DOMBreakpointType `json:"type"` // Type of the breakpoint to remove. +} + +// RemoveDOMBreakpoint removes DOM breakpoint that was set using +// setDOMBreakpoint. +// +// parameters: +// nodeID - Identifier of the node to remove breakpoint from. +// type - Type of the breakpoint to remove. +func RemoveDOMBreakpoint(nodeID cdp.NodeID, typeVal DOMBreakpointType) *RemoveDOMBreakpointParams { + return &RemoveDOMBreakpointParams{ + NodeID: nodeID, + Type: typeVal, + } +} + +// Do executes DOMDebugger.removeDOMBreakpoint against the provided context and +// target handler. +func (p *RemoveDOMBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveDOMBreakpoint, p, nil) +} + +// RemoveEventListenerBreakpointParams removes breakpoint on particular DOM +// event. +type RemoveEventListenerBreakpointParams struct { + EventName string `json:"eventName"` // Event name. + TargetName string `json:"targetName,omitempty"` // EventTarget interface name. +} + +// RemoveEventListenerBreakpoint removes breakpoint on particular DOM event. +// +// parameters: +// eventName - Event name. +func RemoveEventListenerBreakpoint(eventName string) *RemoveEventListenerBreakpointParams { + return &RemoveEventListenerBreakpointParams{ + EventName: eventName, + } +} + +// WithTargetName eventTarget interface name. +func (p RemoveEventListenerBreakpointParams) WithTargetName(targetName string) *RemoveEventListenerBreakpointParams { + p.TargetName = targetName + return &p +} + +// Do executes DOMDebugger.removeEventListenerBreakpoint against the provided context and +// target handler. +func (p *RemoveEventListenerBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveEventListenerBreakpoint, p, nil) +} + +// RemoveInstrumentationBreakpointParams removes breakpoint on particular +// native event. +type RemoveInstrumentationBreakpointParams struct { + EventName string `json:"eventName"` // Instrumentation name to stop on. +} + +// RemoveInstrumentationBreakpoint removes breakpoint on particular native +// event. +// +// parameters: +// eventName - Instrumentation name to stop on. +func RemoveInstrumentationBreakpoint(eventName string) *RemoveInstrumentationBreakpointParams { + return &RemoveInstrumentationBreakpointParams{ + EventName: eventName, + } +} + +// Do executes DOMDebugger.removeInstrumentationBreakpoint against the provided context and +// target handler. +func (p *RemoveInstrumentationBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveInstrumentationBreakpoint, p, nil) +} + +// RemoveXHRBreakpointParams removes breakpoint from XMLHttpRequest. +type RemoveXHRBreakpointParams struct { + URL string `json:"url"` // Resource URL substring. +} + +// RemoveXHRBreakpoint removes breakpoint from XMLHttpRequest. +// +// parameters: +// url - Resource URL substring. +func RemoveXHRBreakpoint(url string) *RemoveXHRBreakpointParams { + return &RemoveXHRBreakpointParams{ + URL: url, + } +} + +// Do executes DOMDebugger.removeXHRBreakpoint against the provided context and +// target handler. +func (p *RemoveXHRBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveXHRBreakpoint, p, nil) +} + +// SetDOMBreakpointParams sets breakpoint on particular operation with DOM. +type SetDOMBreakpointParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to set breakpoint on. + Type DOMBreakpointType `json:"type"` // Type of the operation to stop upon. +} + +// SetDOMBreakpoint sets breakpoint on particular operation with DOM. +// +// parameters: +// nodeID - Identifier of the node to set breakpoint on. +// type - Type of the operation to stop upon. +func SetDOMBreakpoint(nodeID cdp.NodeID, typeVal DOMBreakpointType) *SetDOMBreakpointParams { + return &SetDOMBreakpointParams{ + NodeID: nodeID, + Type: typeVal, + } +} + +// Do executes DOMDebugger.setDOMBreakpoint against the provided context and +// target handler. +func (p *SetDOMBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerSetDOMBreakpoint, p, nil) +} + +// SetEventListenerBreakpointParams sets breakpoint on particular DOM event. +type SetEventListenerBreakpointParams struct { + EventName string `json:"eventName"` // DOM Event name to stop on (any DOM event will do). + TargetName string `json:"targetName,omitempty"` // EventTarget interface name to stop on. If equal to "*" or not provided, will stop on any EventTarget. +} + +// SetEventListenerBreakpoint sets breakpoint on particular DOM event. +// +// parameters: +// eventName - DOM Event name to stop on (any DOM event will do). +func SetEventListenerBreakpoint(eventName string) *SetEventListenerBreakpointParams { + return &SetEventListenerBreakpointParams{ + EventName: eventName, + } +} + +// WithTargetName eventTarget interface name to stop on. If equal to "*" or +// not provided, will stop on any EventTarget. +func (p SetEventListenerBreakpointParams) WithTargetName(targetName string) *SetEventListenerBreakpointParams { + p.TargetName = targetName + return &p +} + +// Do executes DOMDebugger.setEventListenerBreakpoint against the provided context and +// target handler. +func (p *SetEventListenerBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerSetEventListenerBreakpoint, p, nil) +} + +// SetInstrumentationBreakpointParams sets breakpoint on particular native +// event. +type SetInstrumentationBreakpointParams struct { + EventName string `json:"eventName"` // Instrumentation name to stop on. +} + +// SetInstrumentationBreakpoint sets breakpoint on particular native event. +// +// parameters: +// eventName - Instrumentation name to stop on. +func SetInstrumentationBreakpoint(eventName string) *SetInstrumentationBreakpointParams { + return &SetInstrumentationBreakpointParams{ + EventName: eventName, + } +} + +// Do executes DOMDebugger.setInstrumentationBreakpoint against the provided context and +// target handler. +func (p *SetInstrumentationBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerSetInstrumentationBreakpoint, p, nil) +} + +// SetXHRBreakpointParams sets breakpoint on XMLHttpRequest. +type SetXHRBreakpointParams struct { + URL string `json:"url"` // Resource URL substring. All XHRs having this substring in the URL will get stopped upon. +} + +// SetXHRBreakpoint sets breakpoint on XMLHttpRequest. +// +// parameters: +// url - Resource URL substring. All XHRs having this substring in the URL will get stopped upon. +func SetXHRBreakpoint(url string) *SetXHRBreakpointParams { + return &SetXHRBreakpointParams{ + URL: url, + } +} + +// Do executes DOMDebugger.setXHRBreakpoint against the provided context and +// target handler. +func (p *SetXHRBreakpointParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMDebuggerSetXHRBreakpoint, p, nil) +} diff --git a/cdp/domstorage/domstorage.go b/cdp/domstorage/domstorage.go index 9bea2d0..ff8ae38 100644 --- a/cdp/domstorage/domstorage.go +++ b/cdp/domstorage/domstorage.go @@ -14,38 +14,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EnableParams enables storage tracking, storage events will now be -// delivered to the client. -type EnableParams struct{} - -// Enable enables storage tracking, storage events will now be delivered to -// the client. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes DOMStorage.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMStorageEnable, nil, nil) -} - -// DisableParams disables storage tracking, prevents storage events from -// being sent to the client. -type DisableParams struct{} - -// Disable disables storage tracking, prevents storage events from being sent -// to the client. -func Disable() *DisableParams { - return &DisableParams{} -} - -// Do executes DOMStorage.disable against the provided context and -// target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMStorageDisable, nil, nil) -} - // ClearParams [no description]. type ClearParams struct { StorageID *StorageID `json:"storageId"` @@ -67,6 +35,38 @@ func (p *ClearParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandDOMStorageClear, p, nil) } +// DisableParams disables storage tracking, prevents storage events from +// being sent to the client. +type DisableParams struct{} + +// Disable disables storage tracking, prevents storage events from being sent +// to the client. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes DOMStorage.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMStorageDisable, nil, nil) +} + +// EnableParams enables storage tracking, storage events will now be +// delivered to the client. +type EnableParams struct{} + +// Enable enables storage tracking, storage events will now be delivered to +// the client. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes DOMStorage.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMStorageEnable, nil, nil) +} + // GetDOMStorageItemsParams [no description]. type GetDOMStorageItemsParams struct { StorageID *StorageID `json:"storageId"` @@ -103,6 +103,30 @@ func (p *GetDOMStorageItemsParams) Do(ctxt context.Context, h cdp.Handler) (entr return res.Entries, nil } +// RemoveDOMStorageItemParams [no description]. +type RemoveDOMStorageItemParams struct { + StorageID *StorageID `json:"storageId"` + Key string `json:"key"` +} + +// RemoveDOMStorageItem [no description]. +// +// parameters: +// storageID +// key +func RemoveDOMStorageItem(storageID *StorageID, key string) *RemoveDOMStorageItemParams { + return &RemoveDOMStorageItemParams{ + StorageID: storageID, + Key: key, + } +} + +// Do executes DOMStorage.removeDOMStorageItem against the provided context and +// target handler. +func (p *RemoveDOMStorageItemParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandDOMStorageRemoveDOMStorageItem, p, nil) +} + // SetDOMStorageItemParams [no description]. type SetDOMStorageItemParams struct { StorageID *StorageID `json:"storageId"` @@ -129,27 +153,3 @@ func SetDOMStorageItem(storageID *StorageID, key string, value string) *SetDOMSt func (p *SetDOMStorageItemParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandDOMStorageSetDOMStorageItem, p, nil) } - -// RemoveDOMStorageItemParams [no description]. -type RemoveDOMStorageItemParams struct { - StorageID *StorageID `json:"storageId"` - Key string `json:"key"` -} - -// RemoveDOMStorageItem [no description]. -// -// parameters: -// storageID -// key -func RemoveDOMStorageItem(storageID *StorageID, key string) *RemoveDOMStorageItemParams { - return &RemoveDOMStorageItemParams{ - StorageID: storageID, - Key: key, - } -} - -// Do executes DOMStorage.removeDOMStorageItem against the provided context and -// target handler. -func (p *RemoveDOMStorageItemParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandDOMStorageRemoveDOMStorageItem, p, nil) -} diff --git a/cdp/domstorage/events.go b/cdp/domstorage/events.go index 6b82f71..abd979e 100644 --- a/cdp/domstorage/events.go +++ b/cdp/domstorage/events.go @@ -6,9 +6,11 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EventDomStorageItemsCleared [no description]. -type EventDomStorageItemsCleared struct { +// EventDomStorageItemAdded [no description]. +type EventDomStorageItemAdded struct { StorageID *StorageID `json:"storageId"` + Key string `json:"key"` + NewValue string `json:"newValue"` } // EventDomStorageItemRemoved [no description]. @@ -17,13 +19,6 @@ type EventDomStorageItemRemoved struct { Key string `json:"key"` } -// EventDomStorageItemAdded [no description]. -type EventDomStorageItemAdded struct { - StorageID *StorageID `json:"storageId"` - Key string `json:"key"` - NewValue string `json:"newValue"` -} - // EventDomStorageItemUpdated [no description]. type EventDomStorageItemUpdated struct { StorageID *StorageID `json:"storageId"` @@ -32,10 +27,15 @@ type EventDomStorageItemUpdated struct { NewValue string `json:"newValue"` } +// EventDomStorageItemsCleared [no description]. +type EventDomStorageItemsCleared struct { + StorageID *StorageID `json:"storageId"` +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventDOMStorageDomStorageItemsCleared, - cdp.EventDOMStorageDomStorageItemRemoved, cdp.EventDOMStorageDomStorageItemAdded, + cdp.EventDOMStorageDomStorageItemRemoved, cdp.EventDOMStorageDomStorageItemUpdated, + cdp.EventDOMStorageDomStorageItemsCleared, } diff --git a/cdp/emulation/emulation.go b/cdp/emulation/emulation.go index 44832bd..7b0ca4d 100644 --- a/cdp/emulation/emulation.go +++ b/cdp/emulation/emulation.go @@ -16,6 +16,131 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) +// CanEmulateParams tells whether emulation is supported. +type CanEmulateParams struct{} + +// CanEmulate tells whether emulation is supported. +func CanEmulate() *CanEmulateParams { + return &CanEmulateParams{} +} + +// CanEmulateReturns return values. +type CanEmulateReturns struct { + Result bool `json:"result,omitempty"` // True if emulation is supported. +} + +// Do executes Emulation.canEmulate against the provided context and +// target handler. +// +// returns: +// result - True if emulation is supported. +func (p *CanEmulateParams) Do(ctxt context.Context, h cdp.Handler) (result bool, err error) { + // execute + var res CanEmulateReturns + err = h.Execute(ctxt, cdp.CommandEmulationCanEmulate, nil, &res) + if err != nil { + return false, err + } + + return res.Result, nil +} + +// ClearDeviceMetricsOverrideParams clears the overridden device metrics. +type ClearDeviceMetricsOverrideParams struct{} + +// ClearDeviceMetricsOverride clears the overridden device metrics. +func ClearDeviceMetricsOverride() *ClearDeviceMetricsOverrideParams { + return &ClearDeviceMetricsOverrideParams{} +} + +// Do executes Emulation.clearDeviceMetricsOverride against the provided context and +// target handler. +func (p *ClearDeviceMetricsOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationClearDeviceMetricsOverride, nil, nil) +} + +// ClearGeolocationOverrideParams clears the overridden Geolocation Position +// and Error. +type ClearGeolocationOverrideParams struct{} + +// ClearGeolocationOverride clears the overridden Geolocation Position and +// Error. +func ClearGeolocationOverride() *ClearGeolocationOverrideParams { + return &ClearGeolocationOverrideParams{} +} + +// Do executes Emulation.clearGeolocationOverride against the provided context and +// target handler. +func (p *ClearGeolocationOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationClearGeolocationOverride, nil, nil) +} + +// ResetPageScaleFactorParams requests that page scale factor is reset to +// initial values. +type ResetPageScaleFactorParams struct{} + +// ResetPageScaleFactor requests that page scale factor is reset to initial +// values. +func ResetPageScaleFactor() *ResetPageScaleFactorParams { + return &ResetPageScaleFactorParams{} +} + +// Do executes Emulation.resetPageScaleFactor against the provided context and +// target handler. +func (p *ResetPageScaleFactorParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationResetPageScaleFactor, nil, nil) +} + +// SetCPUThrottlingRateParams enables CPU throttling to emulate slow CPUs. +type SetCPUThrottlingRateParams struct { + Rate float64 `json:"rate"` // Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). +} + +// SetCPUThrottlingRate enables CPU throttling to emulate slow CPUs. +// +// parameters: +// rate - Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). +func SetCPUThrottlingRate(rate float64) *SetCPUThrottlingRateParams { + return &SetCPUThrottlingRateParams{ + Rate: rate, + } +} + +// Do executes Emulation.setCPUThrottlingRate against the provided context and +// target handler. +func (p *SetCPUThrottlingRateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationSetCPUThrottlingRate, p, nil) +} + +// SetDefaultBackgroundColorOverrideParams sets or clears an override of the +// default background color of the frame. This override is used if the content +// does not specify one. +type SetDefaultBackgroundColorOverrideParams struct { + Color *cdp.RGBA `json:"color,omitempty"` // RGBA of the default background color. If not specified, any existing override will be cleared. +} + +// SetDefaultBackgroundColorOverride sets or clears an override of the +// default background color of the frame. This override is used if the content +// does not specify one. +// +// parameters: +func SetDefaultBackgroundColorOverride() *SetDefaultBackgroundColorOverrideParams { + return &SetDefaultBackgroundColorOverrideParams{} +} + +// WithColor rGBA of the default background color. If not specified, any +// existing override will be cleared. +func (p SetDefaultBackgroundColorOverrideParams) WithColor(color *cdp.RGBA) *SetDefaultBackgroundColorOverrideParams { + p.Color = color + return &p +} + +// Do executes Emulation.setDefaultBackgroundColorOverride against the provided context and +// target handler. +func (p *SetDefaultBackgroundColorOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationSetDefaultBackgroundColorOverride, p, nil) +} + // SetDeviceMetricsOverrideParams overrides the values of device screen // dimensions (window.screen.width, window.screen.height, window.innerWidth, // window.innerHeight, and "device-width"/"device-height"-related CSS media @@ -115,164 +240,6 @@ func (p *SetDeviceMetricsOverrideParams) Do(ctxt context.Context, h cdp.Handler) return h.Execute(ctxt, cdp.CommandEmulationSetDeviceMetricsOverride, p, nil) } -// ClearDeviceMetricsOverrideParams clears the overridden device metrics. -type ClearDeviceMetricsOverrideParams struct{} - -// ClearDeviceMetricsOverride clears the overridden device metrics. -func ClearDeviceMetricsOverride() *ClearDeviceMetricsOverrideParams { - return &ClearDeviceMetricsOverrideParams{} -} - -// Do executes Emulation.clearDeviceMetricsOverride against the provided context and -// target handler. -func (p *ClearDeviceMetricsOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationClearDeviceMetricsOverride, nil, nil) -} - -// ResetPageScaleFactorParams requests that page scale factor is reset to -// initial values. -type ResetPageScaleFactorParams struct{} - -// ResetPageScaleFactor requests that page scale factor is reset to initial -// values. -func ResetPageScaleFactor() *ResetPageScaleFactorParams { - return &ResetPageScaleFactorParams{} -} - -// Do executes Emulation.resetPageScaleFactor against the provided context and -// target handler. -func (p *ResetPageScaleFactorParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationResetPageScaleFactor, nil, nil) -} - -// SetPageScaleFactorParams sets a specified page scale factor. -type SetPageScaleFactorParams struct { - PageScaleFactor float64 `json:"pageScaleFactor"` // Page scale factor. -} - -// SetPageScaleFactor sets a specified page scale factor. -// -// parameters: -// pageScaleFactor - Page scale factor. -func SetPageScaleFactor(pageScaleFactor float64) *SetPageScaleFactorParams { - return &SetPageScaleFactorParams{ - PageScaleFactor: pageScaleFactor, - } -} - -// Do executes Emulation.setPageScaleFactor against the provided context and -// target handler. -func (p *SetPageScaleFactorParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationSetPageScaleFactor, p, nil) -} - -// SetScriptExecutionDisabledParams switches script execution in the page. -type SetScriptExecutionDisabledParams struct { - Value bool `json:"value"` // Whether script execution should be disabled in the page. -} - -// SetScriptExecutionDisabled switches script execution in the page. -// -// parameters: -// value - Whether script execution should be disabled in the page. -func SetScriptExecutionDisabled(value bool) *SetScriptExecutionDisabledParams { - return &SetScriptExecutionDisabledParams{ - Value: value, - } -} - -// Do executes Emulation.setScriptExecutionDisabled against the provided context and -// target handler. -func (p *SetScriptExecutionDisabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationSetScriptExecutionDisabled, p, nil) -} - -// SetGeolocationOverrideParams overrides the Geolocation Position or Error. -// Omitting any of the parameters emulates position unavailable. -type SetGeolocationOverrideParams struct { - Latitude float64 `json:"latitude,omitempty"` // Mock latitude - Longitude float64 `json:"longitude,omitempty"` // Mock longitude - Accuracy float64 `json:"accuracy,omitempty"` // Mock accuracy -} - -// SetGeolocationOverride overrides the Geolocation Position or Error. -// Omitting any of the parameters emulates position unavailable. -// -// parameters: -func SetGeolocationOverride() *SetGeolocationOverrideParams { - return &SetGeolocationOverrideParams{} -} - -// WithLatitude mock latitude. -func (p SetGeolocationOverrideParams) WithLatitude(latitude float64) *SetGeolocationOverrideParams { - p.Latitude = latitude - return &p -} - -// WithLongitude mock longitude. -func (p SetGeolocationOverrideParams) WithLongitude(longitude float64) *SetGeolocationOverrideParams { - p.Longitude = longitude - return &p -} - -// WithAccuracy mock accuracy. -func (p SetGeolocationOverrideParams) WithAccuracy(accuracy float64) *SetGeolocationOverrideParams { - p.Accuracy = accuracy - return &p -} - -// Do executes Emulation.setGeolocationOverride against the provided context and -// target handler. -func (p *SetGeolocationOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationSetGeolocationOverride, p, nil) -} - -// ClearGeolocationOverrideParams clears the overridden Geolocation Position -// and Error. -type ClearGeolocationOverrideParams struct{} - -// ClearGeolocationOverride clears the overridden Geolocation Position and -// Error. -func ClearGeolocationOverride() *ClearGeolocationOverrideParams { - return &ClearGeolocationOverrideParams{} -} - -// Do executes Emulation.clearGeolocationOverride against the provided context and -// target handler. -func (p *ClearGeolocationOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationClearGeolocationOverride, nil, nil) -} - -// SetTouchEmulationEnabledParams enables touch on platforms which do not -// support them. -type SetTouchEmulationEnabledParams struct { - Enabled bool `json:"enabled"` // Whether the touch event emulation should be enabled. - MaxTouchPoints int64 `json:"maxTouchPoints,omitempty"` // Maximum touch points supported. Defaults to one. -} - -// SetTouchEmulationEnabled enables touch on platforms which do not support -// them. -// -// parameters: -// enabled - Whether the touch event emulation should be enabled. -func SetTouchEmulationEnabled(enabled bool) *SetTouchEmulationEnabledParams { - return &SetTouchEmulationEnabledParams{ - Enabled: enabled, - } -} - -// WithMaxTouchPoints maximum touch points supported. Defaults to one. -func (p SetTouchEmulationEnabledParams) WithMaxTouchPoints(maxTouchPoints int64) *SetTouchEmulationEnabledParams { - p.MaxTouchPoints = maxTouchPoints - return &p -} - -// Do executes Emulation.setTouchEmulationEnabled against the provided context and -// target handler. -func (p *SetTouchEmulationEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationSetTouchEmulationEnabled, p, nil) -} - // SetEmitTouchEventsForMouseParams [no description]. type SetEmitTouchEventsForMouseParams struct { Enabled bool `json:"enabled"` // Whether touch emulation based on mouse input should be enabled. @@ -323,54 +290,139 @@ func (p *SetEmulatedMediaParams) Do(ctxt context.Context, h cdp.Handler) (err er return h.Execute(ctxt, cdp.CommandEmulationSetEmulatedMedia, p, nil) } -// SetCPUThrottlingRateParams enables CPU throttling to emulate slow CPUs. -type SetCPUThrottlingRateParams struct { - Rate float64 `json:"rate"` // Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). +// SetGeolocationOverrideParams overrides the Geolocation Position or Error. +// Omitting any of the parameters emulates position unavailable. +type SetGeolocationOverrideParams struct { + Latitude float64 `json:"latitude,omitempty"` // Mock latitude + Longitude float64 `json:"longitude,omitempty"` // Mock longitude + Accuracy float64 `json:"accuracy,omitempty"` // Mock accuracy } -// SetCPUThrottlingRate enables CPU throttling to emulate slow CPUs. +// SetGeolocationOverride overrides the Geolocation Position or Error. +// Omitting any of the parameters emulates position unavailable. // // parameters: -// rate - Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). -func SetCPUThrottlingRate(rate float64) *SetCPUThrottlingRateParams { - return &SetCPUThrottlingRateParams{ - Rate: rate, - } +func SetGeolocationOverride() *SetGeolocationOverrideParams { + return &SetGeolocationOverrideParams{} } -// Do executes Emulation.setCPUThrottlingRate against the provided context and +// WithLatitude mock latitude. +func (p SetGeolocationOverrideParams) WithLatitude(latitude float64) *SetGeolocationOverrideParams { + p.Latitude = latitude + return &p +} + +// WithLongitude mock longitude. +func (p SetGeolocationOverrideParams) WithLongitude(longitude float64) *SetGeolocationOverrideParams { + p.Longitude = longitude + return &p +} + +// WithAccuracy mock accuracy. +func (p SetGeolocationOverrideParams) WithAccuracy(accuracy float64) *SetGeolocationOverrideParams { + p.Accuracy = accuracy + return &p +} + +// Do executes Emulation.setGeolocationOverride against the provided context and // target handler. -func (p *SetCPUThrottlingRateParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationSetCPUThrottlingRate, p, nil) +func (p *SetGeolocationOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationSetGeolocationOverride, p, nil) } -// CanEmulateParams tells whether emulation is supported. -type CanEmulateParams struct{} - -// CanEmulate tells whether emulation is supported. -func CanEmulate() *CanEmulateParams { - return &CanEmulateParams{} +// SetNavigatorOverridesParams overrides value returned by the javascript +// navigator object. +type SetNavigatorOverridesParams struct { + Platform string `json:"platform"` // The platform navigator.platform should return. } -// CanEmulateReturns return values. -type CanEmulateReturns struct { - Result bool `json:"result,omitempty"` // True if emulation is supported. -} - -// Do executes Emulation.canEmulate against the provided context and -// target handler. +// SetNavigatorOverrides overrides value returned by the javascript navigator +// object. // -// returns: -// result - True if emulation is supported. -func (p *CanEmulateParams) Do(ctxt context.Context, h cdp.Handler) (result bool, err error) { - // execute - var res CanEmulateReturns - err = h.Execute(ctxt, cdp.CommandEmulationCanEmulate, nil, &res) - if err != nil { - return false, err +// parameters: +// platform - The platform navigator.platform should return. +func SetNavigatorOverrides(platform string) *SetNavigatorOverridesParams { + return &SetNavigatorOverridesParams{ + Platform: platform, } +} - return res.Result, nil +// Do executes Emulation.setNavigatorOverrides against the provided context and +// target handler. +func (p *SetNavigatorOverridesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationSetNavigatorOverrides, p, nil) +} + +// SetPageScaleFactorParams sets a specified page scale factor. +type SetPageScaleFactorParams struct { + PageScaleFactor float64 `json:"pageScaleFactor"` // Page scale factor. +} + +// SetPageScaleFactor sets a specified page scale factor. +// +// parameters: +// pageScaleFactor - Page scale factor. +func SetPageScaleFactor(pageScaleFactor float64) *SetPageScaleFactorParams { + return &SetPageScaleFactorParams{ + PageScaleFactor: pageScaleFactor, + } +} + +// Do executes Emulation.setPageScaleFactor against the provided context and +// target handler. +func (p *SetPageScaleFactorParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationSetPageScaleFactor, p, nil) +} + +// SetScriptExecutionDisabledParams switches script execution in the page. +type SetScriptExecutionDisabledParams struct { + Value bool `json:"value"` // Whether script execution should be disabled in the page. +} + +// SetScriptExecutionDisabled switches script execution in the page. +// +// parameters: +// value - Whether script execution should be disabled in the page. +func SetScriptExecutionDisabled(value bool) *SetScriptExecutionDisabledParams { + return &SetScriptExecutionDisabledParams{ + Value: value, + } +} + +// Do executes Emulation.setScriptExecutionDisabled against the provided context and +// target handler. +func (p *SetScriptExecutionDisabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationSetScriptExecutionDisabled, p, nil) +} + +// SetTouchEmulationEnabledParams enables touch on platforms which do not +// support them. +type SetTouchEmulationEnabledParams struct { + Enabled bool `json:"enabled"` // Whether the touch event emulation should be enabled. + MaxTouchPoints int64 `json:"maxTouchPoints,omitempty"` // Maximum touch points supported. Defaults to one. +} + +// SetTouchEmulationEnabled enables touch on platforms which do not support +// them. +// +// parameters: +// enabled - Whether the touch event emulation should be enabled. +func SetTouchEmulationEnabled(enabled bool) *SetTouchEmulationEnabledParams { + return &SetTouchEmulationEnabledParams{ + Enabled: enabled, + } +} + +// WithMaxTouchPoints maximum touch points supported. Defaults to one. +func (p SetTouchEmulationEnabledParams) WithMaxTouchPoints(maxTouchPoints int64) *SetTouchEmulationEnabledParams { + p.MaxTouchPoints = maxTouchPoints + return &p +} + +// Do executes Emulation.setTouchEmulationEnabled against the provided context and +// target handler. +func (p *SetTouchEmulationEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandEmulationSetTouchEmulationEnabled, p, nil) } // SetVirtualTimePolicyParams turns on virtual time for all frames (replacing @@ -429,55 +481,3 @@ func (p *SetVirtualTimePolicyParams) Do(ctxt context.Context, h cdp.Handler) (vi return res.VirtualTimeBase, nil } - -// SetNavigatorOverridesParams overrides value returned by the javascript -// navigator object. -type SetNavigatorOverridesParams struct { - Platform string `json:"platform"` // The platform navigator.platform should return. -} - -// SetNavigatorOverrides overrides value returned by the javascript navigator -// object. -// -// parameters: -// platform - The platform navigator.platform should return. -func SetNavigatorOverrides(platform string) *SetNavigatorOverridesParams { - return &SetNavigatorOverridesParams{ - Platform: platform, - } -} - -// Do executes Emulation.setNavigatorOverrides against the provided context and -// target handler. -func (p *SetNavigatorOverridesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationSetNavigatorOverrides, p, nil) -} - -// SetDefaultBackgroundColorOverrideParams sets or clears an override of the -// default background color of the frame. This override is used if the content -// does not specify one. -type SetDefaultBackgroundColorOverrideParams struct { - Color *cdp.RGBA `json:"color,omitempty"` // RGBA of the default background color. If not specified, any existing override will be cleared. -} - -// SetDefaultBackgroundColorOverride sets or clears an override of the -// default background color of the frame. This override is used if the content -// does not specify one. -// -// parameters: -func SetDefaultBackgroundColorOverride() *SetDefaultBackgroundColorOverrideParams { - return &SetDefaultBackgroundColorOverrideParams{} -} - -// WithColor rGBA of the default background color. If not specified, any -// existing override will be cleared. -func (p SetDefaultBackgroundColorOverrideParams) WithColor(color *cdp.RGBA) *SetDefaultBackgroundColorOverrideParams { - p.Color = color - return &p -} - -// Do executes Emulation.setDefaultBackgroundColorOverride against the provided context and -// target handler. -func (p *SetDefaultBackgroundColorOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandEmulationSetDefaultBackgroundColorOverride, p, nil) -} diff --git a/cdp/emulation/events.go b/cdp/emulation/events.go index 259246b..42c4ab6 100644 --- a/cdp/emulation/events.go +++ b/cdp/emulation/events.go @@ -6,16 +6,16 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EventVirtualTimeBudgetExpired notification sent after the virtual time -// budget for the current VirtualTimePolicy has run out. -type EventVirtualTimeBudgetExpired struct{} - // EventVirtualTimeAdvanced notification sent after the virtual time has // advanced. type EventVirtualTimeAdvanced struct { VirtualTimeElapsed float64 `json:"virtualTimeElapsed"` // The amount of virtual time that has elapsed in milliseconds since virtual time was first enabled. } +// EventVirtualTimeBudgetExpired notification sent after the virtual time +// budget for the current VirtualTimePolicy has run out. +type EventVirtualTimeBudgetExpired struct{} + // EventVirtualTimePaused notification sent after the virtual time has // paused. type EventVirtualTimePaused struct { @@ -24,7 +24,7 @@ type EventVirtualTimePaused struct { // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventEmulationVirtualTimeBudgetExpired, cdp.EventEmulationVirtualTimeAdvanced, + cdp.EventEmulationVirtualTimeBudgetExpired, cdp.EventEmulationVirtualTimePaused, } diff --git a/cdp/headlessexperimental/events.go b/cdp/headlessexperimental/events.go index 02a46dd..e68a007 100644 --- a/cdp/headlessexperimental/events.go +++ b/cdp/headlessexperimental/events.go @@ -6,19 +6,19 @@ import ( cdp "github.com/knq/chromedp/cdp" ) +// EventMainFrameReadyForScreenshots issued when the main frame has first +// submitted a frame to the browser. May only be fired while a BeginFrame is in +// flight. Before this event, screenshotting requests may fail. +type EventMainFrameReadyForScreenshots struct{} + // EventNeedsBeginFramesChanged issued when the target starts or stops // needing BeginFrames. type EventNeedsBeginFramesChanged struct { NeedsBeginFrames bool `json:"needsBeginFrames"` // True if BeginFrames are needed, false otherwise. } -// EventMainFrameReadyForScreenshots issued when the main frame has first -// submitted a frame to the browser. May only be fired while a BeginFrame is in -// flight. Before this event, screenshotting requests may fail. -type EventMainFrameReadyForScreenshots struct{} - // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventHeadlessExperimentalNeedsBeginFramesChanged, cdp.EventHeadlessExperimentalMainFrameReadyForScreenshots, + cdp.EventHeadlessExperimentalNeedsBeginFramesChanged, } diff --git a/cdp/headlessexperimental/headlessexperimental.go b/cdp/headlessexperimental/headlessexperimental.go index a29441b..b3b9b75 100644 --- a/cdp/headlessexperimental/headlessexperimental.go +++ b/cdp/headlessexperimental/headlessexperimental.go @@ -17,34 +17,6 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) -// EnableParams enables headless events for the target. -type EnableParams struct{} - -// Enable enables headless events for the target. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes HeadlessExperimental.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandHeadlessExperimentalEnable, nil, nil) -} - -// DisableParams disables headless events for the target. -type DisableParams struct{} - -// Disable disables headless events for the target. -func Disable() *DisableParams { - return &DisableParams{} -} - -// Do executes HeadlessExperimental.disable against the provided context and -// target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandHeadlessExperimentalDisable, nil, nil) -} - // BeginFrameParams sends a BeginFrame to 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. @@ -123,3 +95,31 @@ func (p *BeginFrameParams) Do(ctxt context.Context, h cdp.Handler) (hasDamage bo } return res.HasDamage, res.MainFrameContentUpdated, dec, nil } + +// DisableParams disables headless events for the target. +type DisableParams struct{} + +// Disable disables headless events for the target. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes HeadlessExperimental.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandHeadlessExperimentalDisable, nil, nil) +} + +// EnableParams enables headless events for the target. +type EnableParams struct{} + +// Enable enables headless events for the target. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes HeadlessExperimental.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandHeadlessExperimentalEnable, nil, nil) +} diff --git a/cdp/heapprofiler/events.go b/cdp/heapprofiler/events.go index 1d87378..c3b089c 100644 --- a/cdp/heapprofiler/events.go +++ b/cdp/heapprofiler/events.go @@ -11,14 +11,10 @@ type EventAddHeapSnapshotChunk struct { Chunk string `json:"chunk"` } -// EventResetProfiles [no description]. -type EventResetProfiles struct{} - -// EventReportHeapSnapshotProgress [no description]. -type EventReportHeapSnapshotProgress struct { - Done int64 `json:"done"` - Total int64 `json:"total"` - Finished bool `json:"finished,omitempty"` +// EventHeapStatsUpdate if heap objects tracking has been started then +// backend may send update for one or more fragments. +type EventHeapStatsUpdate struct { + StatsUpdate []int64 `json:"statsUpdate"` // An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. } // EventLastSeenObjectID if heap objects tracking has been started then @@ -31,17 +27,21 @@ type EventLastSeenObjectID struct { Timestamp float64 `json:"timestamp"` } -// EventHeapStatsUpdate if heap objects tracking has been started then -// backend may send update for one or more fragments. -type EventHeapStatsUpdate struct { - StatsUpdate []int64 `json:"statsUpdate"` // An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. +// EventReportHeapSnapshotProgress [no description]. +type EventReportHeapSnapshotProgress struct { + Done int64 `json:"done"` + Total int64 `json:"total"` + Finished bool `json:"finished,omitempty"` } +// EventResetProfiles [no description]. +type EventResetProfiles struct{} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ cdp.EventHeapProfilerAddHeapSnapshotChunk, - cdp.EventHeapProfilerResetProfiles, - cdp.EventHeapProfilerReportHeapSnapshotProgress, - cdp.EventHeapProfilerLastSeenObjectID, cdp.EventHeapProfilerHeapStatsUpdate, + cdp.EventHeapProfilerLastSeenObjectID, + cdp.EventHeapProfilerReportHeapSnapshotProgress, + cdp.EventHeapProfilerResetProfiles, } diff --git a/cdp/heapprofiler/heapprofiler.go b/cdp/heapprofiler/heapprofiler.go index 22fcd83..509ab97 100644 --- a/cdp/heapprofiler/heapprofiler.go +++ b/cdp/heapprofiler/heapprofiler.go @@ -13,18 +13,41 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) -// EnableParams [no description]. -type EnableParams struct{} - -// Enable [no description]. -func Enable() *EnableParams { - return &EnableParams{} +// AddInspectedHeapObjectParams enables console to refer to the node with +// given id via $x (see Command Line API for more details $x functions). +type AddInspectedHeapObjectParams struct { + HeapObjectID HeapSnapshotObjectID `json:"heapObjectId"` // Heap snapshot object id to be accessible by means of $x command line API. } -// Do executes HeapProfiler.enable against the provided context and +// AddInspectedHeapObject enables console to refer to the node with given id +// via $x (see Command Line API for more details $x functions). +// +// parameters: +// heapObjectID - Heap snapshot object id to be accessible by means of $x command line API. +func AddInspectedHeapObject(heapObjectID HeapSnapshotObjectID) *AddInspectedHeapObjectParams { + return &AddInspectedHeapObjectParams{ + HeapObjectID: heapObjectID, + } +} + +// Do executes HeapProfiler.addInspectedHeapObject against the provided context and // target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandHeapProfilerEnable, nil, nil) +func (p *AddInspectedHeapObjectParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandHeapProfilerAddInspectedHeapObject, p, nil) +} + +// CollectGarbageParams [no description]. +type CollectGarbageParams struct{} + +// CollectGarbage [no description]. +func CollectGarbage() *CollectGarbageParams { + return &CollectGarbageParams{} +} + +// Do executes HeapProfiler.collectGarbage against the provided context and +// target handler. +func (p *CollectGarbageParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandHeapProfilerCollectGarbage, nil, nil) } // DisableParams [no description]. @@ -41,6 +64,154 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandHeapProfilerDisable, nil, nil) } +// EnableParams [no description]. +type EnableParams struct{} + +// Enable [no description]. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes HeapProfiler.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandHeapProfilerEnable, nil, nil) +} + +// GetHeapObjectIDParams [no description]. +type GetHeapObjectIDParams struct { + ObjectID runtime.RemoteObjectID `json:"objectId"` // Identifier of the object to get heap object id for. +} + +// GetHeapObjectID [no description]. +// +// parameters: +// objectID - Identifier of the object to get heap object id for. +func GetHeapObjectID(objectID runtime.RemoteObjectID) *GetHeapObjectIDParams { + return &GetHeapObjectIDParams{ + ObjectID: objectID, + } +} + +// GetHeapObjectIDReturns return values. +type GetHeapObjectIDReturns struct { + HeapSnapshotObjectID HeapSnapshotObjectID `json:"heapSnapshotObjectId,omitempty"` // Id of the heap snapshot object corresponding to the passed remote object id. +} + +// Do executes HeapProfiler.getHeapObjectId against the provided context and +// target handler. +// +// returns: +// heapSnapshotObjectID - Id of the heap snapshot object corresponding to the passed remote object id. +func (p *GetHeapObjectIDParams) Do(ctxt context.Context, h cdp.Handler) (heapSnapshotObjectID HeapSnapshotObjectID, err error) { + // execute + var res GetHeapObjectIDReturns + err = h.Execute(ctxt, cdp.CommandHeapProfilerGetHeapObjectID, p, &res) + if err != nil { + return "", err + } + + return res.HeapSnapshotObjectID, nil +} + +// GetObjectByHeapObjectIDParams [no description]. +type GetObjectByHeapObjectIDParams struct { + ObjectID HeapSnapshotObjectID `json:"objectId"` + ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. +} + +// GetObjectByHeapObjectID [no description]. +// +// parameters: +// objectID +func GetObjectByHeapObjectID(objectID HeapSnapshotObjectID) *GetObjectByHeapObjectIDParams { + return &GetObjectByHeapObjectIDParams{ + ObjectID: objectID, + } +} + +// WithObjectGroup symbolic group name that can be used to release multiple +// objects. +func (p GetObjectByHeapObjectIDParams) WithObjectGroup(objectGroup string) *GetObjectByHeapObjectIDParams { + p.ObjectGroup = objectGroup + return &p +} + +// GetObjectByHeapObjectIDReturns return values. +type GetObjectByHeapObjectIDReturns struct { + Result *runtime.RemoteObject `json:"result,omitempty"` // Evaluation result. +} + +// Do executes HeapProfiler.getObjectByHeapObjectId against the provided context and +// target handler. +// +// returns: +// result - Evaluation result. +func (p *GetObjectByHeapObjectIDParams) Do(ctxt context.Context, h cdp.Handler) (result *runtime.RemoteObject, err error) { + // execute + var res GetObjectByHeapObjectIDReturns + err = h.Execute(ctxt, cdp.CommandHeapProfilerGetObjectByHeapObjectID, p, &res) + if err != nil { + return nil, err + } + + return res.Result, nil +} + +// GetSamplingProfileParams [no description]. +type GetSamplingProfileParams struct{} + +// GetSamplingProfile [no description]. +func GetSamplingProfile() *GetSamplingProfileParams { + return &GetSamplingProfileParams{} +} + +// GetSamplingProfileReturns return values. +type GetSamplingProfileReturns struct { + Profile *SamplingHeapProfile `json:"profile,omitempty"` // Return the sampling profile being collected. +} + +// Do executes HeapProfiler.getSamplingProfile against the provided context and +// target handler. +// +// returns: +// profile - Return the sampling profile being collected. +func (p *GetSamplingProfileParams) Do(ctxt context.Context, h cdp.Handler) (profile *SamplingHeapProfile, err error) { + // execute + var res GetSamplingProfileReturns + err = h.Execute(ctxt, cdp.CommandHeapProfilerGetSamplingProfile, nil, &res) + if err != nil { + return nil, err + } + + return res.Profile, nil +} + +// StartSamplingParams [no description]. +type StartSamplingParams struct { + SamplingInterval float64 `json:"samplingInterval,omitempty"` // Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. +} + +// StartSampling [no description]. +// +// parameters: +func StartSampling() *StartSamplingParams { + return &StartSamplingParams{} +} + +// WithSamplingInterval average sample interval in bytes. Poisson +// distribution is used for the intervals. The default value is 32768 bytes. +func (p StartSamplingParams) WithSamplingInterval(samplingInterval float64) *StartSamplingParams { + p.SamplingInterval = samplingInterval + return &p +} + +// Do executes HeapProfiler.startSampling against the provided context and +// target handler. +func (p *StartSamplingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandHeapProfilerStartSampling, p, nil) +} + // StartTrackingHeapObjectsParams [no description]. type StartTrackingHeapObjectsParams struct { TrackAllocations bool `json:"trackAllocations,omitempty"` @@ -65,6 +236,35 @@ func (p *StartTrackingHeapObjectsParams) Do(ctxt context.Context, h cdp.Handler) return h.Execute(ctxt, cdp.CommandHeapProfilerStartTrackingHeapObjects, p, nil) } +// StopSamplingParams [no description]. +type StopSamplingParams struct{} + +// StopSampling [no description]. +func StopSampling() *StopSamplingParams { + return &StopSamplingParams{} +} + +// StopSamplingReturns return values. +type StopSamplingReturns struct { + Profile *SamplingHeapProfile `json:"profile,omitempty"` // Recorded sampling heap profile. +} + +// Do executes HeapProfiler.stopSampling against the provided context and +// target handler. +// +// returns: +// profile - Recorded sampling heap profile. +func (p *StopSamplingParams) Do(ctxt context.Context, h cdp.Handler) (profile *SamplingHeapProfile, err error) { + // execute + var res StopSamplingReturns + err = h.Execute(ctxt, cdp.CommandHeapProfilerStopSampling, nil, &res) + if err != nil { + return nil, err + } + + return res.Profile, nil +} + // StopTrackingHeapObjectsParams [no description]. type StopTrackingHeapObjectsParams struct { ReportProgress bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. @@ -114,203 +314,3 @@ func (p TakeHeapSnapshotParams) WithReportProgress(reportProgress bool) *TakeHea func (p *TakeHeapSnapshotParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandHeapProfilerTakeHeapSnapshot, p, nil) } - -// CollectGarbageParams [no description]. -type CollectGarbageParams struct{} - -// CollectGarbage [no description]. -func CollectGarbage() *CollectGarbageParams { - return &CollectGarbageParams{} -} - -// Do executes HeapProfiler.collectGarbage against the provided context and -// target handler. -func (p *CollectGarbageParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandHeapProfilerCollectGarbage, nil, nil) -} - -// GetObjectByHeapObjectIDParams [no description]. -type GetObjectByHeapObjectIDParams struct { - ObjectID HeapSnapshotObjectID `json:"objectId"` - ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. -} - -// GetObjectByHeapObjectID [no description]. -// -// parameters: -// objectID -func GetObjectByHeapObjectID(objectID HeapSnapshotObjectID) *GetObjectByHeapObjectIDParams { - return &GetObjectByHeapObjectIDParams{ - ObjectID: objectID, - } -} - -// WithObjectGroup symbolic group name that can be used to release multiple -// objects. -func (p GetObjectByHeapObjectIDParams) WithObjectGroup(objectGroup string) *GetObjectByHeapObjectIDParams { - p.ObjectGroup = objectGroup - return &p -} - -// GetObjectByHeapObjectIDReturns return values. -type GetObjectByHeapObjectIDReturns struct { - Result *runtime.RemoteObject `json:"result,omitempty"` // Evaluation result. -} - -// Do executes HeapProfiler.getObjectByHeapObjectId against the provided context and -// target handler. -// -// returns: -// result - Evaluation result. -func (p *GetObjectByHeapObjectIDParams) Do(ctxt context.Context, h cdp.Handler) (result *runtime.RemoteObject, err error) { - // execute - var res GetObjectByHeapObjectIDReturns - err = h.Execute(ctxt, cdp.CommandHeapProfilerGetObjectByHeapObjectID, p, &res) - if err != nil { - return nil, err - } - - return res.Result, nil -} - -// AddInspectedHeapObjectParams enables console to refer to the node with -// given id via $x (see Command Line API for more details $x functions). -type AddInspectedHeapObjectParams struct { - HeapObjectID HeapSnapshotObjectID `json:"heapObjectId"` // Heap snapshot object id to be accessible by means of $x command line API. -} - -// AddInspectedHeapObject enables console to refer to the node with given id -// via $x (see Command Line API for more details $x functions). -// -// parameters: -// heapObjectID - Heap snapshot object id to be accessible by means of $x command line API. -func AddInspectedHeapObject(heapObjectID HeapSnapshotObjectID) *AddInspectedHeapObjectParams { - return &AddInspectedHeapObjectParams{ - HeapObjectID: heapObjectID, - } -} - -// Do executes HeapProfiler.addInspectedHeapObject against the provided context and -// target handler. -func (p *AddInspectedHeapObjectParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandHeapProfilerAddInspectedHeapObject, p, nil) -} - -// GetHeapObjectIDParams [no description]. -type GetHeapObjectIDParams struct { - ObjectID runtime.RemoteObjectID `json:"objectId"` // Identifier of the object to get heap object id for. -} - -// GetHeapObjectID [no description]. -// -// parameters: -// objectID - Identifier of the object to get heap object id for. -func GetHeapObjectID(objectID runtime.RemoteObjectID) *GetHeapObjectIDParams { - return &GetHeapObjectIDParams{ - ObjectID: objectID, - } -} - -// GetHeapObjectIDReturns return values. -type GetHeapObjectIDReturns struct { - HeapSnapshotObjectID HeapSnapshotObjectID `json:"heapSnapshotObjectId,omitempty"` // Id of the heap snapshot object corresponding to the passed remote object id. -} - -// Do executes HeapProfiler.getHeapObjectId against the provided context and -// target handler. -// -// returns: -// heapSnapshotObjectID - Id of the heap snapshot object corresponding to the passed remote object id. -func (p *GetHeapObjectIDParams) Do(ctxt context.Context, h cdp.Handler) (heapSnapshotObjectID HeapSnapshotObjectID, err error) { - // execute - var res GetHeapObjectIDReturns - err = h.Execute(ctxt, cdp.CommandHeapProfilerGetHeapObjectID, p, &res) - if err != nil { - return "", err - } - - return res.HeapSnapshotObjectID, nil -} - -// StartSamplingParams [no description]. -type StartSamplingParams struct { - SamplingInterval float64 `json:"samplingInterval,omitempty"` // Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. -} - -// StartSampling [no description]. -// -// parameters: -func StartSampling() *StartSamplingParams { - return &StartSamplingParams{} -} - -// WithSamplingInterval average sample interval in bytes. Poisson -// distribution is used for the intervals. The default value is 32768 bytes. -func (p StartSamplingParams) WithSamplingInterval(samplingInterval float64) *StartSamplingParams { - p.SamplingInterval = samplingInterval - return &p -} - -// Do executes HeapProfiler.startSampling against the provided context and -// target handler. -func (p *StartSamplingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandHeapProfilerStartSampling, p, nil) -} - -// StopSamplingParams [no description]. -type StopSamplingParams struct{} - -// StopSampling [no description]. -func StopSampling() *StopSamplingParams { - return &StopSamplingParams{} -} - -// StopSamplingReturns return values. -type StopSamplingReturns struct { - Profile *SamplingHeapProfile `json:"profile,omitempty"` // Recorded sampling heap profile. -} - -// Do executes HeapProfiler.stopSampling against the provided context and -// target handler. -// -// returns: -// profile - Recorded sampling heap profile. -func (p *StopSamplingParams) Do(ctxt context.Context, h cdp.Handler) (profile *SamplingHeapProfile, err error) { - // execute - var res StopSamplingReturns - err = h.Execute(ctxt, cdp.CommandHeapProfilerStopSampling, nil, &res) - if err != nil { - return nil, err - } - - return res.Profile, nil -} - -// GetSamplingProfileParams [no description]. -type GetSamplingProfileParams struct{} - -// GetSamplingProfile [no description]. -func GetSamplingProfile() *GetSamplingProfileParams { - return &GetSamplingProfileParams{} -} - -// GetSamplingProfileReturns return values. -type GetSamplingProfileReturns struct { - Profile *SamplingHeapProfile `json:"profile,omitempty"` // Return the sampling profile being collected. -} - -// Do executes HeapProfiler.getSamplingProfile against the provided context and -// target handler. -// -// returns: -// profile - Return the sampling profile being collected. -func (p *GetSamplingProfileParams) Do(ctxt context.Context, h cdp.Handler) (profile *SamplingHeapProfile, err error) { - // execute - var res GetSamplingProfileReturns - err = h.Execute(ctxt, cdp.CommandHeapProfilerGetSamplingProfile, nil, &res) - if err != nil { - return nil, err - } - - return res.Profile, nil -} diff --git a/cdp/indexeddb/easyjson.go b/cdp/indexeddb/easyjson.go index 40688ea..45ddc61 100644 --- a/cdp/indexeddb/easyjson.go +++ b/cdp/indexeddb/easyjson.go @@ -1437,7 +1437,126 @@ func (v *DisableParams) UnmarshalJSON(data []byte) error { func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb12(l, v) } -func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(in *jlexer.Lexer, out *DeleteDatabaseParams) { +func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(in *jlexer.Lexer, out *DeleteObjectStoreEntriesParams) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "securityOrigin": + out.SecurityOrigin = string(in.String()) + case "databaseName": + out.DatabaseName = string(in.String()) + case "objectStoreName": + out.ObjectStoreName = string(in.String()) + case "keyRange": + if in.IsNull() { + in.Skip() + out.KeyRange = nil + } else { + if out.KeyRange == nil { + out.KeyRange = new(KeyRange) + } + (*out.KeyRange).UnmarshalEasyJSON(in) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Writer, in DeleteObjectStoreEntriesParams) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"securityOrigin\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.SecurityOrigin)) + } + { + const prefix string = ",\"databaseName\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.DatabaseName)) + } + { + const prefix string = ",\"objectStoreName\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.ObjectStoreName)) + } + { + const prefix string = ",\"keyRange\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + if in.KeyRange == nil { + out.RawString("null") + } else { + (*in.KeyRange).MarshalEasyJSON(out) + } + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v DeleteObjectStoreEntriesParams) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v DeleteObjectStoreEntriesParams) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *DeleteObjectStoreEntriesParams) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *DeleteObjectStoreEntriesParams) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(l, v) +} +func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(in *jlexer.Lexer, out *DeleteDatabaseParams) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1470,7 +1589,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(in *jlexer.Lexer, in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Writer, in DeleteDatabaseParams) { +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Writer, in DeleteDatabaseParams) { out.RawByte('{') first := true _ = first @@ -1500,27 +1619,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Write // MarshalJSON supports json.Marshaler interface func (v DeleteDatabaseParams) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(&w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DeleteDatabaseParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DeleteDatabaseParams) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(&r, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DeleteDatabaseParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(l, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(l, v) } -func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(in *jlexer.Lexer, out *DatabaseWithObjectStores) { +func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(in *jlexer.Lexer, out *DatabaseWithObjectStores) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1584,7 +1703,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(in *jlexer.Lexer, in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Writer, in DatabaseWithObjectStores) { +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Writer, in DatabaseWithObjectStores) { out.RawByte('{') first := true _ = first @@ -1639,27 +1758,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Write // MarshalJSON supports json.Marshaler interface func (v DatabaseWithObjectStores) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(&w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DatabaseWithObjectStores) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DatabaseWithObjectStores) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(&r, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DatabaseWithObjectStores) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(l, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(l, v) } -func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(in *jlexer.Lexer, out *DataEntry) { +func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(in *jlexer.Lexer, out *DataEntry) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1718,7 +1837,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(in *jlexer.Lexer, in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Writer, in DataEntry) { +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(out *jwriter.Writer, in DataEntry) { out.RawByte('{') first := true _ = first @@ -1770,27 +1889,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Write // MarshalJSON supports json.Marshaler interface func (v DataEntry) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(&w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DataEntry) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DataEntry) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(&r, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DataEntry) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(l, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(l, v) } -func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(in *jlexer.Lexer, out *ClearObjectStoreParams) { +func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb17(in *jlexer.Lexer, out *ClearObjectStoreParams) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1825,7 +1944,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(in *jlexer.Lexer, in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(out *jwriter.Writer, in ClearObjectStoreParams) { +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb17(out *jwriter.Writer, in ClearObjectStoreParams) { out.RawByte('{') first := true _ = first @@ -1865,23 +1984,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(out *jwriter.Write // MarshalJSON supports json.Marshaler interface func (v ClearObjectStoreParams) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(&w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb17(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ClearObjectStoreParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb17(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ClearObjectStoreParams) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(&r, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb17(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ClearObjectStoreParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(l, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb17(l, v) } diff --git a/cdp/indexeddb/indexeddb.go b/cdp/indexeddb/indexeddb.go index e4cc0df..881d699 100644 --- a/cdp/indexeddb/indexeddb.go +++ b/cdp/indexeddb/indexeddb.go @@ -12,18 +12,86 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EnableParams enables events from backend. -type EnableParams struct{} - -// Enable enables events from backend. -func Enable() *EnableParams { - return &EnableParams{} +// ClearObjectStoreParams clears all entries from an object store. +type ClearObjectStoreParams struct { + SecurityOrigin string `json:"securityOrigin"` // Security origin. + DatabaseName string `json:"databaseName"` // Database name. + ObjectStoreName string `json:"objectStoreName"` // Object store name. } -// Do executes IndexedDB.enable against the provided context and +// ClearObjectStore clears all entries from an object store. +// +// parameters: +// securityOrigin - Security origin. +// databaseName - Database name. +// objectStoreName - Object store name. +func ClearObjectStore(securityOrigin string, databaseName string, objectStoreName string) *ClearObjectStoreParams { + return &ClearObjectStoreParams{ + SecurityOrigin: securityOrigin, + DatabaseName: databaseName, + ObjectStoreName: objectStoreName, + } +} + +// Do executes IndexedDB.clearObjectStore against the provided context and // target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandIndexedDBEnable, nil, nil) +func (p *ClearObjectStoreParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandIndexedDBClearObjectStore, p, nil) +} + +// DeleteDatabaseParams deletes a database. +type DeleteDatabaseParams struct { + SecurityOrigin string `json:"securityOrigin"` // Security origin. + DatabaseName string `json:"databaseName"` // Database name. +} + +// DeleteDatabase deletes a database. +// +// parameters: +// securityOrigin - Security origin. +// databaseName - Database name. +func DeleteDatabase(securityOrigin string, databaseName string) *DeleteDatabaseParams { + return &DeleteDatabaseParams{ + SecurityOrigin: securityOrigin, + DatabaseName: databaseName, + } +} + +// Do executes IndexedDB.deleteDatabase against the provided context and +// target handler. +func (p *DeleteDatabaseParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandIndexedDBDeleteDatabase, p, nil) +} + +// DeleteObjectStoreEntriesParams delete a range of entries from an object +// store. +type DeleteObjectStoreEntriesParams struct { + SecurityOrigin string `json:"securityOrigin"` + DatabaseName string `json:"databaseName"` + ObjectStoreName string `json:"objectStoreName"` + KeyRange *KeyRange `json:"keyRange"` // Range of entry keys to delete +} + +// DeleteObjectStoreEntries delete a range of entries from an object store. +// +// parameters: +// securityOrigin +// databaseName +// objectStoreName +// keyRange - Range of entry keys to delete +func DeleteObjectStoreEntries(securityOrigin string, databaseName string, objectStoreName string, keyRange *KeyRange) *DeleteObjectStoreEntriesParams { + return &DeleteObjectStoreEntriesParams{ + SecurityOrigin: securityOrigin, + DatabaseName: databaseName, + ObjectStoreName: objectStoreName, + KeyRange: keyRange, + } +} + +// Do executes IndexedDB.deleteObjectStoreEntries against the provided context and +// target handler. +func (p *DeleteObjectStoreEntriesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandIndexedDBDeleteObjectStoreEntries, p, nil) } // DisableParams disables events from backend. @@ -40,80 +108,18 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandIndexedDBDisable, nil, nil) } -// RequestDatabaseNamesParams requests database names for given security -// origin. -type RequestDatabaseNamesParams struct { - SecurityOrigin string `json:"securityOrigin"` // Security origin. +// EnableParams enables events from backend. +type EnableParams struct{} + +// Enable enables events from backend. +func Enable() *EnableParams { + return &EnableParams{} } -// RequestDatabaseNames requests database names for given security origin. -// -// parameters: -// securityOrigin - Security origin. -func RequestDatabaseNames(securityOrigin string) *RequestDatabaseNamesParams { - return &RequestDatabaseNamesParams{ - SecurityOrigin: securityOrigin, - } -} - -// RequestDatabaseNamesReturns return values. -type RequestDatabaseNamesReturns struct { - DatabaseNames []string `json:"databaseNames,omitempty"` // Database names for origin. -} - -// Do executes IndexedDB.requestDatabaseNames against the provided context and +// Do executes IndexedDB.enable against the provided context and // target handler. -// -// returns: -// databaseNames - Database names for origin. -func (p *RequestDatabaseNamesParams) Do(ctxt context.Context, h cdp.Handler) (databaseNames []string, err error) { - // execute - var res RequestDatabaseNamesReturns - err = h.Execute(ctxt, cdp.CommandIndexedDBRequestDatabaseNames, p, &res) - if err != nil { - return nil, err - } - - return res.DatabaseNames, nil -} - -// RequestDatabaseParams requests database with given name in given frame. -type RequestDatabaseParams struct { - SecurityOrigin string `json:"securityOrigin"` // Security origin. - DatabaseName string `json:"databaseName"` // Database name. -} - -// RequestDatabase requests database with given name in given frame. -// -// parameters: -// securityOrigin - Security origin. -// databaseName - Database name. -func RequestDatabase(securityOrigin string, databaseName string) *RequestDatabaseParams { - return &RequestDatabaseParams{ - SecurityOrigin: securityOrigin, - DatabaseName: databaseName, - } -} - -// RequestDatabaseReturns return values. -type RequestDatabaseReturns struct { - DatabaseWithObjectStores *DatabaseWithObjectStores `json:"databaseWithObjectStores,omitempty"` // Database with an array of object stores. -} - -// Do executes IndexedDB.requestDatabase against the provided context and -// target handler. -// -// returns: -// databaseWithObjectStores - Database with an array of object stores. -func (p *RequestDatabaseParams) Do(ctxt context.Context, h cdp.Handler) (databaseWithObjectStores *DatabaseWithObjectStores, err error) { - // execute - var res RequestDatabaseReturns - err = h.Execute(ctxt, cdp.CommandIndexedDBRequestDatabase, p, &res) - if err != nil { - return nil, err - } - - return res.DatabaseWithObjectStores, nil +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandIndexedDBEnable, nil, nil) } // RequestDataParams requests data from object store or index. @@ -176,53 +182,78 @@ func (p *RequestDataParams) Do(ctxt context.Context, h cdp.Handler) (objectStore return res.ObjectStoreDataEntries, res.HasMore, nil } -// ClearObjectStoreParams clears all entries from an object store. -type ClearObjectStoreParams struct { - SecurityOrigin string `json:"securityOrigin"` // Security origin. - DatabaseName string `json:"databaseName"` // Database name. - ObjectStoreName string `json:"objectStoreName"` // Object store name. -} - -// ClearObjectStore clears all entries from an object store. -// -// parameters: -// securityOrigin - Security origin. -// databaseName - Database name. -// objectStoreName - Object store name. -func ClearObjectStore(securityOrigin string, databaseName string, objectStoreName string) *ClearObjectStoreParams { - return &ClearObjectStoreParams{ - SecurityOrigin: securityOrigin, - DatabaseName: databaseName, - ObjectStoreName: objectStoreName, - } -} - -// Do executes IndexedDB.clearObjectStore against the provided context and -// target handler. -func (p *ClearObjectStoreParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandIndexedDBClearObjectStore, p, nil) -} - -// DeleteDatabaseParams deletes a database. -type DeleteDatabaseParams struct { +// RequestDatabaseParams requests database with given name in given frame. +type RequestDatabaseParams struct { SecurityOrigin string `json:"securityOrigin"` // Security origin. DatabaseName string `json:"databaseName"` // Database name. } -// DeleteDatabase deletes a database. +// RequestDatabase requests database with given name in given frame. // // parameters: // securityOrigin - Security origin. // databaseName - Database name. -func DeleteDatabase(securityOrigin string, databaseName string) *DeleteDatabaseParams { - return &DeleteDatabaseParams{ +func RequestDatabase(securityOrigin string, databaseName string) *RequestDatabaseParams { + return &RequestDatabaseParams{ SecurityOrigin: securityOrigin, DatabaseName: databaseName, } } -// Do executes IndexedDB.deleteDatabase against the provided context and -// target handler. -func (p *DeleteDatabaseParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandIndexedDBDeleteDatabase, p, nil) +// RequestDatabaseReturns return values. +type RequestDatabaseReturns struct { + DatabaseWithObjectStores *DatabaseWithObjectStores `json:"databaseWithObjectStores,omitempty"` // Database with an array of object stores. +} + +// Do executes IndexedDB.requestDatabase against the provided context and +// target handler. +// +// returns: +// databaseWithObjectStores - Database with an array of object stores. +func (p *RequestDatabaseParams) Do(ctxt context.Context, h cdp.Handler) (databaseWithObjectStores *DatabaseWithObjectStores, err error) { + // execute + var res RequestDatabaseReturns + err = h.Execute(ctxt, cdp.CommandIndexedDBRequestDatabase, p, &res) + if err != nil { + return nil, err + } + + return res.DatabaseWithObjectStores, nil +} + +// RequestDatabaseNamesParams requests database names for given security +// origin. +type RequestDatabaseNamesParams struct { + SecurityOrigin string `json:"securityOrigin"` // Security origin. +} + +// RequestDatabaseNames requests database names for given security origin. +// +// parameters: +// securityOrigin - Security origin. +func RequestDatabaseNames(securityOrigin string) *RequestDatabaseNamesParams { + return &RequestDatabaseNamesParams{ + SecurityOrigin: securityOrigin, + } +} + +// RequestDatabaseNamesReturns return values. +type RequestDatabaseNamesReturns struct { + DatabaseNames []string `json:"databaseNames,omitempty"` // Database names for origin. +} + +// Do executes IndexedDB.requestDatabaseNames against the provided context and +// target handler. +// +// returns: +// databaseNames - Database names for origin. +func (p *RequestDatabaseNamesParams) Do(ctxt context.Context, h cdp.Handler) (databaseNames []string, err error) { + // execute + var res RequestDatabaseNamesReturns + err = h.Execute(ctxt, cdp.CommandIndexedDBRequestDatabaseNames, p, &res) + if err != nil { + return nil, err + } + + return res.DatabaseNames, nil } diff --git a/cdp/input/input.go b/cdp/input/input.go index ffe9ede..c673fb0 100644 --- a/cdp/input/input.go +++ b/cdp/input/input.go @@ -12,28 +12,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// SetIgnoreInputEventsParams ignores input events (useful while auditing -// page). -type SetIgnoreInputEventsParams struct { - Ignore bool `json:"ignore"` // Ignores input events processing when set to true. -} - -// SetIgnoreInputEvents ignores input events (useful while auditing page). -// -// parameters: -// ignore - Ignores input events processing when set to true. -func SetIgnoreInputEvents(ignore bool) *SetIgnoreInputEventsParams { - return &SetIgnoreInputEventsParams{ - Ignore: ignore, - } -} - -// Do executes Input.setIgnoreInputEvents against the provided context and -// target handler. -func (p *SetIgnoreInputEventsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandInputSetIgnoreInputEvents, p, nil) -} - // DispatchKeyEventParams dispatches a key event to the page. type DispatchKeyEventParams struct { Type KeyType `json:"type"` // Type of the key event. @@ -330,6 +308,28 @@ func (p *EmulateTouchFromMouseEventParams) Do(ctxt context.Context, h cdp.Handle return h.Execute(ctxt, cdp.CommandInputEmulateTouchFromMouseEvent, p, nil) } +// SetIgnoreInputEventsParams ignores input events (useful while auditing +// page). +type SetIgnoreInputEventsParams struct { + Ignore bool `json:"ignore"` // Ignores input events processing when set to true. +} + +// SetIgnoreInputEvents ignores input events (useful while auditing page). +// +// parameters: +// ignore - Ignores input events processing when set to true. +func SetIgnoreInputEvents(ignore bool) *SetIgnoreInputEventsParams { + return &SetIgnoreInputEventsParams{ + Ignore: ignore, + } +} + +// Do executes Input.setIgnoreInputEvents against the provided context and +// target handler. +func (p *SetIgnoreInputEventsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandInputSetIgnoreInputEvents, p, nil) +} + // SynthesizePinchGestureParams synthesizes a pinch gesture over a time // period by issuing appropriate touch events. type SynthesizePinchGestureParams struct { diff --git a/cdp/inspector/inspector.go b/cdp/inspector/inspector.go index 5350e59..61bc09b 100644 --- a/cdp/inspector/inspector.go +++ b/cdp/inspector/inspector.go @@ -12,20 +12,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EnableParams enables inspector domain notifications. -type EnableParams struct{} - -// Enable enables inspector domain notifications. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Inspector.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandInspectorEnable, nil, nil) -} - // DisableParams disables inspector domain notifications. type DisableParams struct{} @@ -39,3 +25,17 @@ func Disable() *DisableParams { func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandInspectorDisable, nil, nil) } + +// EnableParams enables inspector domain notifications. +type EnableParams struct{} + +// Enable enables inspector domain notifications. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes Inspector.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandInspectorEnable, nil, nil) +} diff --git a/cdp/io/io.go b/cdp/io/io.go index 70ee548..48cec07 100644 --- a/cdp/io/io.go +++ b/cdp/io/io.go @@ -15,6 +15,27 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) +// CloseParams close the stream, discard any temporary backing storage. +type CloseParams struct { + Handle StreamHandle `json:"handle"` // Handle of the stream to close. +} + +// Close close the stream, discard any temporary backing storage. +// +// parameters: +// handle - Handle of the stream to close. +func Close(handle StreamHandle) *CloseParams { + return &CloseParams{ + Handle: handle, + } +} + +// Do executes IO.close against the provided context and +// target handler. +func (p *CloseParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandIOClose, p, nil) +} + // ReadParams read a chunk of the stream. type ReadParams struct { Handle StreamHandle `json:"handle"` // Handle of the stream to read. @@ -70,27 +91,6 @@ func (p *ReadParams) Do(ctxt context.Context, h cdp.Handler) (data string, eof b return res.Data, res.EOF, nil } -// CloseParams close the stream, discard any temporary backing storage. -type CloseParams struct { - Handle StreamHandle `json:"handle"` // Handle of the stream to close. -} - -// Close close the stream, discard any temporary backing storage. -// -// parameters: -// handle - Handle of the stream to close. -func Close(handle StreamHandle) *CloseParams { - return &CloseParams{ - Handle: handle, - } -} - -// Do executes IO.close against the provided context and -// target handler. -func (p *CloseParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandIOClose, p, nil) -} - // ResolveBlobParams return UUID of Blob object specified by a remote object // id. type ResolveBlobParams struct { diff --git a/cdp/layertree/events.go b/cdp/layertree/events.go index d19617e..d7a5dbe 100644 --- a/cdp/layertree/events.go +++ b/cdp/layertree/events.go @@ -7,19 +7,19 @@ import ( "github.com/knq/chromedp/cdp/dom" ) -// EventLayerTreeDidChange [no description]. -type EventLayerTreeDidChange struct { - Layers []*Layer `json:"layers,omitempty"` // Layer tree, absent if not in the comspositing mode. -} - // EventLayerPainted [no description]. type EventLayerPainted struct { LayerID LayerID `json:"layerId"` // The id of the painted layer. Clip *dom.Rect `json:"clip"` // Clip rectangle. } +// EventLayerTreeDidChange [no description]. +type EventLayerTreeDidChange struct { + Layers []*Layer `json:"layers,omitempty"` // Layer tree, absent if not in the comspositing mode. +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventLayerTreeLayerTreeDidChange, cdp.EventLayerTreeLayerPainted, + cdp.EventLayerTreeLayerTreeDidChange, } diff --git a/cdp/layertree/layertree.go b/cdp/layertree/layertree.go index 7a06ce5..77804b6 100644 --- a/cdp/layertree/layertree.go +++ b/cdp/layertree/layertree.go @@ -14,34 +14,6 @@ import ( "github.com/mailru/easyjson" ) -// EnableParams enables compositing tree inspection. -type EnableParams struct{} - -// Enable enables compositing tree inspection. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes LayerTree.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandLayerTreeEnable, nil, nil) -} - -// DisableParams disables compositing tree inspection. -type DisableParams struct{} - -// Disable disables compositing tree inspection. -func Disable() *DisableParams { - return &DisableParams{} -} - -// Do executes LayerTree.disable against the provided context and -// target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandLayerTreeDisable, nil, nil) -} - // CompositingReasonsParams provides the reasons why the given layer was // composited. type CompositingReasonsParams struct { @@ -80,40 +52,32 @@ func (p *CompositingReasonsParams) Do(ctxt context.Context, h cdp.Handler) (comp return res.CompositingReasons, nil } -// MakeSnapshotParams returns the layer snapshot identifier. -type MakeSnapshotParams struct { - LayerID LayerID `json:"layerId"` // The id of the layer. +// DisableParams disables compositing tree inspection. +type DisableParams struct{} + +// Disable disables compositing tree inspection. +func Disable() *DisableParams { + return &DisableParams{} } -// MakeSnapshot returns the layer snapshot identifier. -// -// parameters: -// layerID - The id of the layer. -func MakeSnapshot(layerID LayerID) *MakeSnapshotParams { - return &MakeSnapshotParams{ - LayerID: layerID, - } -} - -// MakeSnapshotReturns return values. -type MakeSnapshotReturns struct { - SnapshotID SnapshotID `json:"snapshotId,omitempty"` // The id of the layer snapshot. -} - -// Do executes LayerTree.makeSnapshot against the provided context and +// Do executes LayerTree.disable against the provided context and // target handler. -// -// returns: -// snapshotID - The id of the layer snapshot. -func (p *MakeSnapshotParams) Do(ctxt context.Context, h cdp.Handler) (snapshotID SnapshotID, err error) { - // execute - var res MakeSnapshotReturns - err = h.Execute(ctxt, cdp.CommandLayerTreeMakeSnapshot, p, &res) - if err != nil { - return "", err - } +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandLayerTreeDisable, nil, nil) +} - return res.SnapshotID, nil +// EnableParams enables compositing tree inspection. +type EnableParams struct{} + +// Enable enables compositing tree inspection. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes LayerTree.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandLayerTreeEnable, nil, nil) } // LoadSnapshotParams returns the snapshot identifier. @@ -152,25 +116,40 @@ func (p *LoadSnapshotParams) Do(ctxt context.Context, h cdp.Handler) (snapshotID return res.SnapshotID, nil } -// ReleaseSnapshotParams releases layer snapshot captured by the back-end. -type ReleaseSnapshotParams struct { - SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot. +// MakeSnapshotParams returns the layer snapshot identifier. +type MakeSnapshotParams struct { + LayerID LayerID `json:"layerId"` // The id of the layer. } -// ReleaseSnapshot releases layer snapshot captured by the back-end. +// MakeSnapshot returns the layer snapshot identifier. // // parameters: -// snapshotID - The id of the layer snapshot. -func ReleaseSnapshot(snapshotID SnapshotID) *ReleaseSnapshotParams { - return &ReleaseSnapshotParams{ - SnapshotID: snapshotID, +// layerID - The id of the layer. +func MakeSnapshot(layerID LayerID) *MakeSnapshotParams { + return &MakeSnapshotParams{ + LayerID: layerID, } } -// Do executes LayerTree.releaseSnapshot against the provided context and +// MakeSnapshotReturns return values. +type MakeSnapshotReturns struct { + SnapshotID SnapshotID `json:"snapshotId,omitempty"` // The id of the layer snapshot. +} + +// Do executes LayerTree.makeSnapshot against the provided context and // target handler. -func (p *ReleaseSnapshotParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandLayerTreeReleaseSnapshot, p, nil) +// +// returns: +// snapshotID - The id of the layer snapshot. +func (p *MakeSnapshotParams) Do(ctxt context.Context, h cdp.Handler) (snapshotID SnapshotID, err error) { + // execute + var res MakeSnapshotReturns + err = h.Execute(ctxt, cdp.CommandLayerTreeMakeSnapshot, p, &res) + if err != nil { + return "", err + } + + return res.SnapshotID, nil } // ProfileSnapshotParams [no description]. @@ -231,6 +210,27 @@ func (p *ProfileSnapshotParams) Do(ctxt context.Context, h cdp.Handler) (timings return res.Timings, nil } +// ReleaseSnapshotParams releases layer snapshot captured by the back-end. +type ReleaseSnapshotParams struct { + SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot. +} + +// ReleaseSnapshot releases layer snapshot captured by the back-end. +// +// parameters: +// snapshotID - The id of the layer snapshot. +func ReleaseSnapshot(snapshotID SnapshotID) *ReleaseSnapshotParams { + return &ReleaseSnapshotParams{ + SnapshotID: snapshotID, + } +} + +// Do executes LayerTree.releaseSnapshot against the provided context and +// target handler. +func (p *ReleaseSnapshotParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandLayerTreeReleaseSnapshot, p, nil) +} + // ReplaySnapshotParams replays the layer snapshot and returns the resulting // bitmap. type ReplaySnapshotParams struct { diff --git a/cdp/log/log.go b/cdp/log/log.go index 1794944..5bfdd1c 100644 --- a/cdp/log/log.go +++ b/cdp/log/log.go @@ -14,20 +14,18 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EnableParams enables log domain, sends the entries collected so far to the -// client by means of the entryAdded notification. -type EnableParams struct{} +// ClearParams clears the log. +type ClearParams struct{} -// Enable enables log domain, sends the entries collected so far to the -// client by means of the entryAdded notification. -func Enable() *EnableParams { - return &EnableParams{} +// Clear clears the log. +func Clear() *ClearParams { + return &ClearParams{} } -// Do executes Log.enable against the provided context and +// Do executes Log.clear against the provided context and // target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandLogEnable, nil, nil) +func (p *ClearParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandLogClear, nil, nil) } // DisableParams disables log domain, prevents further log entries from being @@ -46,18 +44,20 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandLogDisable, nil, nil) } -// ClearParams clears the log. -type ClearParams struct{} +// EnableParams enables log domain, sends the entries collected so far to the +// client by means of the entryAdded notification. +type EnableParams struct{} -// Clear clears the log. -func Clear() *ClearParams { - return &ClearParams{} +// Enable enables log domain, sends the entries collected so far to the +// client by means of the entryAdded notification. +func Enable() *EnableParams { + return &EnableParams{} } -// Do executes Log.clear against the provided context and +// Do executes Log.enable against the provided context and // target handler. -func (p *ClearParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandLogClear, nil, nil) +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandLogEnable, nil, nil) } // StartViolationsReportParams start violation reporting. diff --git a/cdp/network/events.go b/cdp/network/events.go index 4cc1465..dfb6131 100644 --- a/cdp/network/events.go +++ b/cdp/network/events.go @@ -7,43 +7,6 @@ import ( "github.com/knq/chromedp/cdp/page" ) -// EventResourceChangedPriority fired when resource loading priority is -// changed. -type EventResourceChangedPriority struct { - RequestID RequestID `json:"requestId"` // Request identifier. - NewPriority ResourcePriority `json:"newPriority"` // New priority - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. -} - -// EventRequestWillBeSent fired when page is about to send HTTP request. -type EventRequestWillBeSent struct { - RequestID RequestID `json:"requestId"` // Request identifier. - LoaderID cdp.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 *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - WallTime *cdp.TimeSinceEpoch `json:"wallTime"` // Timestamp. - Initiator *Initiator `json:"initiator"` // Request initiator. - RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data. - Type page.ResourceType `json:"type,omitempty"` // Type of this resource. - FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier. -} - -// EventRequestServedFromCache fired if request ended up loading from cache. -type EventRequestServedFromCache struct { - RequestID RequestID `json:"requestId"` // Request identifier. -} - -// EventResponseReceived fired when HTTP response is available. -type EventResponseReceived struct { - RequestID RequestID `json:"requestId"` // Request identifier. - LoaderID cdp.LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - Type page.ResourceType `json:"type"` // Resource type. - Response *Response `json:"response"` // Response data. - FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier. -} - // EventDataReceived fired when data chunk was received over the network. type EventDataReceived struct { RequestID RequestID `json:"requestId"` // Request identifier. @@ -52,11 +15,14 @@ type EventDataReceived struct { EncodedDataLength int64 `json:"encodedDataLength"` // Actual bytes received (might be less than dataLength for compressed encodings). } -// EventLoadingFinished fired when HTTP request has finished loading. -type EventLoadingFinished struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - EncodedDataLength float64 `json:"encodedDataLength"` // Total number of bytes received for this request. +// EventEventSourceMessageReceived fired when EventSource message is +// received. +type EventEventSourceMessageReceived struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + EventName string `json:"eventName"` // Message type. + EventID string `json:"eventId"` // Message identifier. + Data string `json:"data"` // Message content. } // EventLoadingFailed fired when HTTP request has failed to load. @@ -69,65 +35,11 @@ type EventLoadingFailed struct { BlockedReason BlockedReason `json:"blockedReason,omitempty"` // The reason why loading was blocked, if any. } -// EventWebSocketWillSendHandshakeRequest fired when WebSocket is about to -// initiate handshake. -type EventWebSocketWillSendHandshakeRequest struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - WallTime *cdp.TimeSinceEpoch `json:"wallTime"` // UTC Timestamp. - Request *WebSocketRequest `json:"request"` // WebSocket request data. -} - -// EventWebSocketHandshakeResponseReceived fired when WebSocket handshake -// response becomes available. -type EventWebSocketHandshakeResponseReceived struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - Response *WebSocketResponse `json:"response"` // WebSocket response data. -} - -// EventWebSocketCreated fired upon WebSocket creation. -type EventWebSocketCreated struct { - RequestID RequestID `json:"requestId"` // Request identifier. - URL string `json:"url"` // WebSocket request URL. - Initiator *Initiator `json:"initiator,omitempty"` // Request initiator. -} - -// EventWebSocketClosed fired when WebSocket is closed. -type EventWebSocketClosed struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. -} - -// EventWebSocketFrameReceived fired when WebSocket frame is received. -type EventWebSocketFrameReceived struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - Response *WebSocketFrame `json:"response"` // WebSocket response data. -} - -// EventWebSocketFrameError fired when WebSocket frame error occurs. -type EventWebSocketFrameError struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - ErrorMessage string `json:"errorMessage"` // WebSocket frame error message. -} - -// EventWebSocketFrameSent fired when WebSocket frame is sent. -type EventWebSocketFrameSent struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - Response *WebSocketFrame `json:"response"` // WebSocket response data. -} - -// EventEventSourceMessageReceived fired when EventSource message is -// received. -type EventEventSourceMessageReceived struct { - RequestID RequestID `json:"requestId"` // Request identifier. - Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. - EventName string `json:"eventName"` // Message type. - EventID string `json:"eventId"` // Message identifier. - Data string `json:"data"` // Message content. +// EventLoadingFinished fired when HTTP request has finished loading. +type EventLoadingFinished struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + EncodedDataLength float64 `json:"encodedDataLength"` // Total number of bytes received for this request. } // EventRequestIntercepted details of an intercepted HTTP request, which must @@ -145,22 +57,110 @@ type EventRequestIntercepted struct { ResponseHeaders Headers `json:"responseHeaders,omitempty"` // Response headers if intercepted at the response stage or if redirect occurred while intercepting request or auth retry occurred. } +// EventRequestServedFromCache fired if request ended up loading from cache. +type EventRequestServedFromCache struct { + RequestID RequestID `json:"requestId"` // Request identifier. +} + +// EventRequestWillBeSent fired when page is about to send HTTP request. +type EventRequestWillBeSent struct { + RequestID RequestID `json:"requestId"` // Request identifier. + LoaderID cdp.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 *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + WallTime *cdp.TimeSinceEpoch `json:"wallTime"` // Timestamp. + Initiator *Initiator `json:"initiator"` // Request initiator. + RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data. + Type page.ResourceType `json:"type,omitempty"` // Type of this resource. + FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier. +} + +// EventResourceChangedPriority fired when resource loading priority is +// changed. +type EventResourceChangedPriority struct { + RequestID RequestID `json:"requestId"` // Request identifier. + NewPriority ResourcePriority `json:"newPriority"` // New priority + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. +} + +// EventResponseReceived fired when HTTP response is available. +type EventResponseReceived struct { + RequestID RequestID `json:"requestId"` // Request identifier. + LoaderID cdp.LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + Type page.ResourceType `json:"type"` // Resource type. + Response *Response `json:"response"` // Response data. + FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier. +} + +// EventWebSocketClosed fired when WebSocket is closed. +type EventWebSocketClosed struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. +} + +// EventWebSocketCreated fired upon WebSocket creation. +type EventWebSocketCreated struct { + RequestID RequestID `json:"requestId"` // Request identifier. + URL string `json:"url"` // WebSocket request URL. + Initiator *Initiator `json:"initiator,omitempty"` // Request initiator. +} + +// EventWebSocketFrameError fired when WebSocket frame error occurs. +type EventWebSocketFrameError struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + ErrorMessage string `json:"errorMessage"` // WebSocket frame error message. +} + +// EventWebSocketFrameReceived fired when WebSocket frame is received. +type EventWebSocketFrameReceived struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + Response *WebSocketFrame `json:"response"` // WebSocket response data. +} + +// EventWebSocketFrameSent fired when WebSocket frame is sent. +type EventWebSocketFrameSent struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + Response *WebSocketFrame `json:"response"` // WebSocket response data. +} + +// EventWebSocketHandshakeResponseReceived fired when WebSocket handshake +// response becomes available. +type EventWebSocketHandshakeResponseReceived struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + Response *WebSocketResponse `json:"response"` // WebSocket response data. +} + +// EventWebSocketWillSendHandshakeRequest fired when WebSocket is about to +// initiate handshake. +type EventWebSocketWillSendHandshakeRequest struct { + RequestID RequestID `json:"requestId"` // Request identifier. + Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp. + WallTime *cdp.TimeSinceEpoch `json:"wallTime"` // UTC Timestamp. + Request *WebSocketRequest `json:"request"` // WebSocket request data. +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventNetworkResourceChangedPriority, - cdp.EventNetworkRequestWillBeSent, - cdp.EventNetworkRequestServedFromCache, - cdp.EventNetworkResponseReceived, cdp.EventNetworkDataReceived, - cdp.EventNetworkLoadingFinished, - cdp.EventNetworkLoadingFailed, - cdp.EventNetworkWebSocketWillSendHandshakeRequest, - cdp.EventNetworkWebSocketHandshakeResponseReceived, - cdp.EventNetworkWebSocketCreated, - cdp.EventNetworkWebSocketClosed, - cdp.EventNetworkWebSocketFrameReceived, - cdp.EventNetworkWebSocketFrameError, - cdp.EventNetworkWebSocketFrameSent, cdp.EventNetworkEventSourceMessageReceived, + cdp.EventNetworkLoadingFailed, + cdp.EventNetworkLoadingFinished, cdp.EventNetworkRequestIntercepted, + cdp.EventNetworkRequestServedFromCache, + cdp.EventNetworkRequestWillBeSent, + cdp.EventNetworkResourceChangedPriority, + cdp.EventNetworkResponseReceived, + cdp.EventNetworkWebSocketClosed, + cdp.EventNetworkWebSocketCreated, + cdp.EventNetworkWebSocketFrameError, + cdp.EventNetworkWebSocketFrameReceived, + cdp.EventNetworkWebSocketFrameSent, + cdp.EventNetworkWebSocketHandshakeResponseReceived, + cdp.EventNetworkWebSocketWillSendHandshakeRequest, } diff --git a/cdp/network/network.go b/cdp/network/network.go index 871ab72..0f7a36a 100644 --- a/cdp/network/network.go +++ b/cdp/network/network.go @@ -18,6 +18,219 @@ import ( "github.com/knq/chromedp/cdp/debugger" ) +// ClearBrowserCacheParams clears browser cache. +type ClearBrowserCacheParams struct{} + +// ClearBrowserCache clears browser cache. +func ClearBrowserCache() *ClearBrowserCacheParams { + return &ClearBrowserCacheParams{} +} + +// Do executes Network.clearBrowserCache against the provided context and +// target handler. +func (p *ClearBrowserCacheParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkClearBrowserCache, nil, nil) +} + +// ClearBrowserCookiesParams clears browser cookies. +type ClearBrowserCookiesParams struct{} + +// ClearBrowserCookies clears browser cookies. +func ClearBrowserCookies() *ClearBrowserCookiesParams { + return &ClearBrowserCookiesParams{} +} + +// Do executes Network.clearBrowserCookies against the provided context and +// target handler. +func (p *ClearBrowserCookiesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkClearBrowserCookies, nil, nil) +} + +// ContinueInterceptedRequestParams response to Network.requestIntercepted +// which either modifies the request to continue with any modifications, or +// blocks it, or completes it with the provided response bytes. If a network +// fetch occurs as a result which encounters a redirect an additional +// Network.requestIntercepted event will be sent with the same InterceptionId. +type ContinueInterceptedRequestParams struct { + InterceptionID InterceptionID `json:"interceptionId"` + ErrorReason ErrorReason `json:"errorReason,omitempty"` // If set this causes the request to fail with the given reason. Passing Aborted for requests marked with isNavigationRequest also cancels the navigation. Must not be set in response to an authChallenge. + RawResponse string `json:"rawResponse,omitempty"` // If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge. + URL string `json:"url,omitempty"` // If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge. + Method string `json:"method,omitempty"` // If set this allows the request method to be overridden. Must not be set in response to an authChallenge. + PostData string `json:"postData,omitempty"` // If set this allows postData to be set. Must not be set in response to an authChallenge. + Headers Headers `json:"headers,omitempty"` // If set this allows the request headers to be changed. Must not be set in response to an authChallenge. + AuthChallengeResponse *AuthChallengeResponse `json:"authChallengeResponse,omitempty"` // Response to a requestIntercepted with an authChallenge. Must not be set otherwise. +} + +// ContinueInterceptedRequest response to Network.requestIntercepted which +// either modifies the request to continue with any modifications, or blocks it, +// or completes it with the provided response bytes. If a network fetch occurs +// as a result which encounters a redirect an additional +// Network.requestIntercepted event will be sent with the same InterceptionId. +// +// parameters: +// interceptionID +func ContinueInterceptedRequest(interceptionID InterceptionID) *ContinueInterceptedRequestParams { + return &ContinueInterceptedRequestParams{ + InterceptionID: interceptionID, + } +} + +// WithErrorReason if set this causes the request to fail with the given +// reason. Passing Aborted for requests marked with isNavigationRequest also +// cancels the navigation. Must not be set in response to an authChallenge. +func (p ContinueInterceptedRequestParams) WithErrorReason(errorReason ErrorReason) *ContinueInterceptedRequestParams { + p.ErrorReason = errorReason + return &p +} + +// WithRawResponse if set the requests completes using with the provided +// base64 encoded raw response, including HTTP status line and headers etc... +// Must not be set in response to an authChallenge. +func (p ContinueInterceptedRequestParams) WithRawResponse(rawResponse string) *ContinueInterceptedRequestParams { + p.RawResponse = rawResponse + return &p +} + +// WithURL if set the request url will be modified in a way that's not +// observable by page. Must not be set in response to an authChallenge. +func (p ContinueInterceptedRequestParams) WithURL(url string) *ContinueInterceptedRequestParams { + p.URL = url + return &p +} + +// WithMethod if set this allows the request method to be overridden. Must +// not be set in response to an authChallenge. +func (p ContinueInterceptedRequestParams) WithMethod(method string) *ContinueInterceptedRequestParams { + p.Method = method + return &p +} + +// WithPostData if set this allows postData to be set. Must not be set in +// response to an authChallenge. +func (p ContinueInterceptedRequestParams) WithPostData(postData string) *ContinueInterceptedRequestParams { + p.PostData = postData + return &p +} + +// WithHeaders if set this allows the request headers to be changed. Must not +// be set in response to an authChallenge. +func (p ContinueInterceptedRequestParams) WithHeaders(headers Headers) *ContinueInterceptedRequestParams { + p.Headers = headers + return &p +} + +// WithAuthChallengeResponse response to a requestIntercepted with an +// authChallenge. Must not be set otherwise. +func (p ContinueInterceptedRequestParams) WithAuthChallengeResponse(authChallengeResponse *AuthChallengeResponse) *ContinueInterceptedRequestParams { + p.AuthChallengeResponse = authChallengeResponse + return &p +} + +// Do executes Network.continueInterceptedRequest against the provided context and +// target handler. +func (p *ContinueInterceptedRequestParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkContinueInterceptedRequest, p, nil) +} + +// DeleteCookiesParams deletes browser cookies with matching name and url or +// domain/path pair. +type DeleteCookiesParams struct { + Name string `json:"name"` // Name of the cookies to remove. + URL string `json:"url,omitempty"` // If specified, deletes all the cookies with the given name where domain and path match provided URL. + Domain string `json:"domain,omitempty"` // If specified, deletes only cookies with the exact domain. + Path string `json:"path,omitempty"` // If specified, deletes only cookies with the exact path. +} + +// DeleteCookies deletes browser cookies with matching name and url or +// domain/path pair. +// +// parameters: +// name - Name of the cookies to remove. +func DeleteCookies(name string) *DeleteCookiesParams { + return &DeleteCookiesParams{ + Name: name, + } +} + +// WithURL if specified, deletes all the cookies with the given name where +// domain and path match provided URL. +func (p DeleteCookiesParams) WithURL(url string) *DeleteCookiesParams { + p.URL = url + return &p +} + +// WithDomain if specified, deletes only cookies with the exact domain. +func (p DeleteCookiesParams) WithDomain(domain string) *DeleteCookiesParams { + p.Domain = domain + return &p +} + +// WithPath if specified, deletes only cookies with the exact path. +func (p DeleteCookiesParams) WithPath(path string) *DeleteCookiesParams { + p.Path = path + return &p +} + +// Do executes Network.deleteCookies against the provided context and +// target handler. +func (p *DeleteCookiesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkDeleteCookies, p, nil) +} + +// DisableParams disables network tracking, prevents network events from +// being sent to the client. +type DisableParams struct{} + +// Disable disables network tracking, prevents network events from being sent +// to the client. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes Network.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkDisable, nil, nil) +} + +// EmulateNetworkConditionsParams activates emulation of network conditions. +type EmulateNetworkConditionsParams struct { + Offline bool `json:"offline"` // True to emulate internet disconnection. + Latency float64 `json:"latency"` // Minimum latency from request sent to response headers received (ms). + DownloadThroughput float64 `json:"downloadThroughput"` // Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. + UploadThroughput float64 `json:"uploadThroughput"` // Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. + ConnectionType ConnectionType `json:"connectionType,omitempty"` // Connection type if known. +} + +// EmulateNetworkConditions activates emulation of network conditions. +// +// parameters: +// offline - True to emulate internet disconnection. +// latency - Minimum latency from request sent to response headers received (ms). +// downloadThroughput - Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. +// uploadThroughput - Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. +func EmulateNetworkConditions(offline bool, latency float64, downloadThroughput float64, uploadThroughput float64) *EmulateNetworkConditionsParams { + return &EmulateNetworkConditionsParams{ + Offline: offline, + Latency: latency, + DownloadThroughput: downloadThroughput, + UploadThroughput: uploadThroughput, + } +} + +// WithConnectionType connection type if known. +func (p EmulateNetworkConditionsParams) WithConnectionType(connectionType ConnectionType) *EmulateNetworkConditionsParams { + p.ConnectionType = connectionType + return &p +} + +// Do executes Network.emulateNetworkConditions against the provided context and +// target handler. +func (p *EmulateNetworkConditionsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkEmulateNetworkConditions, p, nil) +} + // EnableParams enables network tracking, network events will now be // delivered to the client. type EnableParams struct { @@ -53,42 +266,237 @@ func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandNetworkEnable, p, nil) } -// DisableParams disables network tracking, prevents network events from -// being sent to the client. -type DisableParams struct{} +// GetAllCookiesParams returns all browser cookies. Depending on the backend +// support, will return detailed cookie information in the cookies field. +type GetAllCookiesParams struct{} -// Disable disables network tracking, prevents network events from being sent -// to the client. -func Disable() *DisableParams { - return &DisableParams{} +// GetAllCookies returns all browser cookies. Depending on the backend +// support, will return detailed cookie information in the cookies field. +func GetAllCookies() *GetAllCookiesParams { + return &GetAllCookiesParams{} } -// Do executes Network.disable against the provided context and +// GetAllCookiesReturns return values. +type GetAllCookiesReturns struct { + Cookies []*Cookie `json:"cookies,omitempty"` // Array of cookie objects. +} + +// Do executes Network.getAllCookies against the provided context and // target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkDisable, nil, nil) +// +// returns: +// cookies - Array of cookie objects. +func (p *GetAllCookiesParams) Do(ctxt context.Context, h cdp.Handler) (cookies []*Cookie, err error) { + // execute + var res GetAllCookiesReturns + err = h.Execute(ctxt, cdp.CommandNetworkGetAllCookies, nil, &res) + if err != nil { + return nil, err + } + + return res.Cookies, nil } -// SetUserAgentOverrideParams allows overriding user agent with the given -// string. -type SetUserAgentOverrideParams struct { - UserAgent string `json:"userAgent"` // User agent to use. +// GetCertificateParams returns the DER-encoded certificate. +type GetCertificateParams struct { + Origin string `json:"origin"` // Origin to get certificate for. } -// SetUserAgentOverride allows overriding user agent with the given string. +// GetCertificate returns the DER-encoded certificate. // // parameters: -// userAgent - User agent to use. -func SetUserAgentOverride(userAgent string) *SetUserAgentOverrideParams { - return &SetUserAgentOverrideParams{ - UserAgent: userAgent, +// origin - Origin to get certificate for. +func GetCertificate(origin string) *GetCertificateParams { + return &GetCertificateParams{ + Origin: origin, } } -// Do executes Network.setUserAgentOverride against the provided context and +// GetCertificateReturns return values. +type GetCertificateReturns struct { + TableNames []string `json:"tableNames,omitempty"` +} + +// Do executes Network.getCertificate against the provided context and // target handler. -func (p *SetUserAgentOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkSetUserAgentOverride, p, nil) +// +// returns: +// tableNames +func (p *GetCertificateParams) Do(ctxt context.Context, h cdp.Handler) (tableNames []string, err error) { + // execute + var res GetCertificateReturns + err = h.Execute(ctxt, cdp.CommandNetworkGetCertificate, p, &res) + if err != nil { + return nil, err + } + + return res.TableNames, nil +} + +// GetCookiesParams returns all browser cookies for the current URL. +// Depending on the backend support, will return detailed cookie information in +// the cookies field. +type GetCookiesParams struct { + Urls []string `json:"urls,omitempty"` // The list of URLs for which applicable cookies will be fetched +} + +// GetCookies returns all browser cookies for the current URL. Depending on +// the backend support, will return detailed cookie information in the cookies +// field. +// +// parameters: +func GetCookies() *GetCookiesParams { + return &GetCookiesParams{} +} + +// WithUrls the list of URLs for which applicable cookies will be fetched. +func (p GetCookiesParams) WithUrls(urls []string) *GetCookiesParams { + p.Urls = urls + return &p +} + +// GetCookiesReturns return values. +type GetCookiesReturns struct { + Cookies []*Cookie `json:"cookies,omitempty"` // Array of cookie objects. +} + +// Do executes Network.getCookies against the provided context and +// target handler. +// +// returns: +// cookies - Array of cookie objects. +func (p *GetCookiesParams) Do(ctxt context.Context, h cdp.Handler) (cookies []*Cookie, err error) { + // execute + var res GetCookiesReturns + err = h.Execute(ctxt, cdp.CommandNetworkGetCookies, p, &res) + if err != nil { + return nil, err + } + + return res.Cookies, nil +} + +// GetResponseBodyParams returns content served for the given request. +type GetResponseBodyParams struct { + RequestID RequestID `json:"requestId"` // Identifier of the network request to get content for. +} + +// GetResponseBody returns content served for the given request. +// +// parameters: +// requestID - Identifier of the network request to get content for. +func GetResponseBody(requestID RequestID) *GetResponseBodyParams { + return &GetResponseBodyParams{ + RequestID: requestID, + } +} + +// GetResponseBodyReturns return values. +type GetResponseBodyReturns struct { + Body string `json:"body,omitempty"` // Response body. + Base64encoded bool `json:"base64Encoded,omitempty"` // True, if content was sent as base64. +} + +// Do executes Network.getResponseBody against the provided context and +// target handler. +// +// returns: +// body - Response body. +func (p *GetResponseBodyParams) Do(ctxt context.Context, h cdp.Handler) (body []byte, err error) { + // execute + var res GetResponseBodyReturns + err = h.Execute(ctxt, cdp.CommandNetworkGetResponseBody, p, &res) + if err != nil { + return nil, err + } + + // decode + var dec []byte + if res.Base64encoded { + dec, err = base64.StdEncoding.DecodeString(res.Body) + if err != nil { + return nil, err + } + } else { + dec = []byte(res.Body) + } + return dec, nil +} + +// GetResponseBodyForInterceptionParams returns content served for the given +// currently intercepted request. +type GetResponseBodyForInterceptionParams struct { + InterceptionID InterceptionID `json:"interceptionId"` // Identifier for the intercepted request to get body for. +} + +// GetResponseBodyForInterception returns content served for the given +// currently intercepted request. +// +// parameters: +// interceptionID - Identifier for the intercepted request to get body for. +func GetResponseBodyForInterception(interceptionID InterceptionID) *GetResponseBodyForInterceptionParams { + return &GetResponseBodyForInterceptionParams{ + InterceptionID: interceptionID, + } +} + +// GetResponseBodyForInterceptionReturns return values. +type GetResponseBodyForInterceptionReturns struct { + Body string `json:"body,omitempty"` // Response body. + Base64encoded bool `json:"base64Encoded,omitempty"` // True, if content was sent as base64. +} + +// Do executes Network.getResponseBodyForInterception against the provided context and +// target handler. +// +// returns: +// body - Response body. +func (p *GetResponseBodyForInterceptionParams) Do(ctxt context.Context, h cdp.Handler) (body []byte, err error) { + // execute + var res GetResponseBodyForInterceptionReturns + err = h.Execute(ctxt, cdp.CommandNetworkGetResponseBodyForInterception, p, &res) + if err != nil { + return nil, err + } + + // decode + var dec []byte + if res.Base64encoded { + dec, err = base64.StdEncoding.DecodeString(res.Body) + if err != nil { + return nil, err + } + } else { + dec = []byte(res.Body) + } + return dec, nil +} + +// ReplayXHRParams this method sends a new XMLHttpRequest which is identical +// to the original one. The following parameters should be identical: method, +// url, async, request body, extra headers, withCredentials attribute, user, +// password. +type ReplayXHRParams struct { + RequestID RequestID `json:"requestId"` // Identifier of XHR to replay. +} + +// ReplayXHR this method sends a new XMLHttpRequest which is identical to the +// original one. The following parameters should be identical: method, url, +// async, request body, extra headers, withCredentials attribute, user, +// password. +// +// parameters: +// requestID - Identifier of XHR to replay. +func ReplayXHR(requestID RequestID) *ReplayXHRParams { + return &ReplayXHRParams{ + RequestID: requestID, + } +} + +// Do executes Network.replayXHR against the provided context and +// target handler. +func (p *ReplayXHRParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkReplayXHR, p, nil) } // SearchInResponseBodyParams searches for given string in response content. @@ -144,76 +552,6 @@ func (p *SearchInResponseBodyParams) Do(ctxt context.Context, h cdp.Handler) (re return res.Result, nil } -// SetExtraHTTPHeadersParams specifies whether to always send extra HTTP -// headers with the requests from this page. -type SetExtraHTTPHeadersParams struct { - Headers Headers `json:"headers"` // Map with extra HTTP headers. -} - -// SetExtraHTTPHeaders specifies whether to always send extra HTTP headers -// with the requests from this page. -// -// parameters: -// headers - Map with extra HTTP headers. -func SetExtraHTTPHeaders(headers Headers) *SetExtraHTTPHeadersParams { - return &SetExtraHTTPHeadersParams{ - Headers: headers, - } -} - -// Do executes Network.setExtraHTTPHeaders against the provided context and -// target handler. -func (p *SetExtraHTTPHeadersParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkSetExtraHTTPHeaders, p, nil) -} - -// GetResponseBodyParams returns content served for the given request. -type GetResponseBodyParams struct { - RequestID RequestID `json:"requestId"` // Identifier of the network request to get content for. -} - -// GetResponseBody returns content served for the given request. -// -// parameters: -// requestID - Identifier of the network request to get content for. -func GetResponseBody(requestID RequestID) *GetResponseBodyParams { - return &GetResponseBodyParams{ - RequestID: requestID, - } -} - -// GetResponseBodyReturns return values. -type GetResponseBodyReturns struct { - Body string `json:"body,omitempty"` // Response body. - Base64encoded bool `json:"base64Encoded,omitempty"` // True, if content was sent as base64. -} - -// Do executes Network.getResponseBody against the provided context and -// target handler. -// -// returns: -// body - Response body. -func (p *GetResponseBodyParams) Do(ctxt context.Context, h cdp.Handler) (body []byte, err error) { - // execute - var res GetResponseBodyReturns - err = h.Execute(ctxt, cdp.CommandNetworkGetResponseBody, p, &res) - if err != nil { - return nil, err - } - - // decode - var dec []byte - if res.Base64encoded { - dec, err = base64.StdEncoding.DecodeString(res.Body) - if err != nil { - return nil, err - } - } else { - dec = []byte(res.Body) - } - return dec, nil -} - // SetBlockedURLSParams blocks URLs from loading. type SetBlockedURLSParams struct { Urls []string `json:"urls"` // URL patterns to block. Wildcards ('*') are allowed. @@ -235,178 +573,50 @@ func (p *SetBlockedURLSParams) Do(ctxt context.Context, h cdp.Handler) (err erro return h.Execute(ctxt, cdp.CommandNetworkSetBlockedURLS, p, nil) } -// ReplayXHRParams this method sends a new XMLHttpRequest which is identical -// to the original one. The following parameters should be identical: method, -// url, async, request body, extra headers, withCredentials attribute, user, -// password. -type ReplayXHRParams struct { - RequestID RequestID `json:"requestId"` // Identifier of XHR to replay. +// SetBypassServiceWorkerParams toggles ignoring of service worker for each +// request. +type SetBypassServiceWorkerParams struct { + Bypass bool `json:"bypass"` // Bypass service worker and load from network. } -// ReplayXHR this method sends a new XMLHttpRequest which is identical to the -// original one. The following parameters should be identical: method, url, -// async, request body, extra headers, withCredentials attribute, user, -// password. +// SetBypassServiceWorker toggles ignoring of service worker for each +// request. // // parameters: -// requestID - Identifier of XHR to replay. -func ReplayXHR(requestID RequestID) *ReplayXHRParams { - return &ReplayXHRParams{ - RequestID: requestID, +// bypass - Bypass service worker and load from network. +func SetBypassServiceWorker(bypass bool) *SetBypassServiceWorkerParams { + return &SetBypassServiceWorkerParams{ + Bypass: bypass, } } -// Do executes Network.replayXHR against the provided context and +// Do executes Network.setBypassServiceWorker against the provided context and // target handler. -func (p *ReplayXHRParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkReplayXHR, p, nil) +func (p *SetBypassServiceWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkSetBypassServiceWorker, p, nil) } -// ClearBrowserCacheParams clears browser cache. -type ClearBrowserCacheParams struct{} - -// ClearBrowserCache clears browser cache. -func ClearBrowserCache() *ClearBrowserCacheParams { - return &ClearBrowserCacheParams{} +// SetCacheDisabledParams toggles ignoring cache for each request. If true, +// cache will not be used. +type SetCacheDisabledParams struct { + CacheDisabled bool `json:"cacheDisabled"` // Cache disabled state. } -// Do executes Network.clearBrowserCache against the provided context and -// target handler. -func (p *ClearBrowserCacheParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkClearBrowserCache, nil, nil) -} - -// ClearBrowserCookiesParams clears browser cookies. -type ClearBrowserCookiesParams struct{} - -// ClearBrowserCookies clears browser cookies. -func ClearBrowserCookies() *ClearBrowserCookiesParams { - return &ClearBrowserCookiesParams{} -} - -// Do executes Network.clearBrowserCookies against the provided context and -// target handler. -func (p *ClearBrowserCookiesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkClearBrowserCookies, nil, nil) -} - -// GetCookiesParams returns all browser cookies for the current URL. -// Depending on the backend support, will return detailed cookie information in -// the cookies field. -type GetCookiesParams struct { - Urls []string `json:"urls,omitempty"` // The list of URLs for which applicable cookies will be fetched -} - -// GetCookies returns all browser cookies for the current URL. Depending on -// the backend support, will return detailed cookie information in the cookies -// field. +// SetCacheDisabled toggles ignoring cache for each request. If true, cache +// will not be used. // // parameters: -func GetCookies() *GetCookiesParams { - return &GetCookiesParams{} -} - -// WithUrls the list of URLs for which applicable cookies will be fetched. -func (p GetCookiesParams) WithUrls(urls []string) *GetCookiesParams { - p.Urls = urls - return &p -} - -// GetCookiesReturns return values. -type GetCookiesReturns struct { - Cookies []*Cookie `json:"cookies,omitempty"` // Array of cookie objects. -} - -// Do executes Network.getCookies against the provided context and -// target handler. -// -// returns: -// cookies - Array of cookie objects. -func (p *GetCookiesParams) Do(ctxt context.Context, h cdp.Handler) (cookies []*Cookie, err error) { - // execute - var res GetCookiesReturns - err = h.Execute(ctxt, cdp.CommandNetworkGetCookies, p, &res) - if err != nil { - return nil, err - } - - return res.Cookies, nil -} - -// GetAllCookiesParams returns all browser cookies. Depending on the backend -// support, will return detailed cookie information in the cookies field. -type GetAllCookiesParams struct{} - -// GetAllCookies returns all browser cookies. Depending on the backend -// support, will return detailed cookie information in the cookies field. -func GetAllCookies() *GetAllCookiesParams { - return &GetAllCookiesParams{} -} - -// GetAllCookiesReturns return values. -type GetAllCookiesReturns struct { - Cookies []*Cookie `json:"cookies,omitempty"` // Array of cookie objects. -} - -// Do executes Network.getAllCookies against the provided context and -// target handler. -// -// returns: -// cookies - Array of cookie objects. -func (p *GetAllCookiesParams) Do(ctxt context.Context, h cdp.Handler) (cookies []*Cookie, err error) { - // execute - var res GetAllCookiesReturns - err = h.Execute(ctxt, cdp.CommandNetworkGetAllCookies, nil, &res) - if err != nil { - return nil, err - } - - return res.Cookies, nil -} - -// DeleteCookiesParams deletes browser cookies with matching name and url or -// domain/path pair. -type DeleteCookiesParams struct { - Name string `json:"name"` // Name of the cookies to remove. - URL string `json:"url,omitempty"` // If specified, deletes all the cookies with the given name where domain and path match provided URL. - Domain string `json:"domain,omitempty"` // If specified, deletes only cookies with the exact domain. - Path string `json:"path,omitempty"` // If specified, deletes only cookies with the exact path. -} - -// DeleteCookies deletes browser cookies with matching name and url or -// domain/path pair. -// -// parameters: -// name - Name of the cookies to remove. -func DeleteCookies(name string) *DeleteCookiesParams { - return &DeleteCookiesParams{ - Name: name, +// cacheDisabled - Cache disabled state. +func SetCacheDisabled(cacheDisabled bool) *SetCacheDisabledParams { + return &SetCacheDisabledParams{ + CacheDisabled: cacheDisabled, } } -// WithURL if specified, deletes all the cookies with the given name where -// domain and path match provided URL. -func (p DeleteCookiesParams) WithURL(url string) *DeleteCookiesParams { - p.URL = url - return &p -} - -// WithDomain if specified, deletes only cookies with the exact domain. -func (p DeleteCookiesParams) WithDomain(domain string) *DeleteCookiesParams { - p.Domain = domain - return &p -} - -// WithPath if specified, deletes only cookies with the exact path. -func (p DeleteCookiesParams) WithPath(path string) *DeleteCookiesParams { - p.Path = path - return &p -} - -// Do executes Network.deleteCookies against the provided context and +// Do executes Network.setCacheDisabled against the provided context and // target handler. -func (p *DeleteCookiesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkDeleteCookies, p, nil) +func (p *SetCacheDisabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkSetCacheDisabled, p, nil) } // SetCookieParams sets a cookie with the given cookie data; may overwrite @@ -521,89 +731,6 @@ func (p *SetCookiesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandNetworkSetCookies, p, nil) } -// EmulateNetworkConditionsParams activates emulation of network conditions. -type EmulateNetworkConditionsParams struct { - Offline bool `json:"offline"` // True to emulate internet disconnection. - Latency float64 `json:"latency"` // Minimum latency from request sent to response headers received (ms). - DownloadThroughput float64 `json:"downloadThroughput"` // Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. - UploadThroughput float64 `json:"uploadThroughput"` // Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. - ConnectionType ConnectionType `json:"connectionType,omitempty"` // Connection type if known. -} - -// EmulateNetworkConditions activates emulation of network conditions. -// -// parameters: -// offline - True to emulate internet disconnection. -// latency - Minimum latency from request sent to response headers received (ms). -// downloadThroughput - Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. -// uploadThroughput - Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. -func EmulateNetworkConditions(offline bool, latency float64, downloadThroughput float64, uploadThroughput float64) *EmulateNetworkConditionsParams { - return &EmulateNetworkConditionsParams{ - Offline: offline, - Latency: latency, - DownloadThroughput: downloadThroughput, - UploadThroughput: uploadThroughput, - } -} - -// WithConnectionType connection type if known. -func (p EmulateNetworkConditionsParams) WithConnectionType(connectionType ConnectionType) *EmulateNetworkConditionsParams { - p.ConnectionType = connectionType - return &p -} - -// Do executes Network.emulateNetworkConditions against the provided context and -// target handler. -func (p *EmulateNetworkConditionsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkEmulateNetworkConditions, p, nil) -} - -// SetCacheDisabledParams toggles ignoring cache for each request. If true, -// cache will not be used. -type SetCacheDisabledParams struct { - CacheDisabled bool `json:"cacheDisabled"` // Cache disabled state. -} - -// SetCacheDisabled toggles ignoring cache for each request. If true, cache -// will not be used. -// -// parameters: -// cacheDisabled - Cache disabled state. -func SetCacheDisabled(cacheDisabled bool) *SetCacheDisabledParams { - return &SetCacheDisabledParams{ - CacheDisabled: cacheDisabled, - } -} - -// Do executes Network.setCacheDisabled against the provided context and -// target handler. -func (p *SetCacheDisabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkSetCacheDisabled, p, nil) -} - -// SetBypassServiceWorkerParams toggles ignoring of service worker for each -// request. -type SetBypassServiceWorkerParams struct { - Bypass bool `json:"bypass"` // Bypass service worker and load from network. -} - -// SetBypassServiceWorker toggles ignoring of service worker for each -// request. -// -// parameters: -// bypass - Bypass service worker and load from network. -func SetBypassServiceWorker(bypass bool) *SetBypassServiceWorkerParams { - return &SetBypassServiceWorkerParams{ - Bypass: bypass, - } -} - -// Do executes Network.setBypassServiceWorker against the provided context and -// target handler. -func (p *SetBypassServiceWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkSetBypassServiceWorker, p, nil) -} - // SetDataSizeLimitsForTestParams for testing. type SetDataSizeLimitsForTestParams struct { MaxTotalSize int64 `json:"maxTotalSize"` // Maximum total buffer size. @@ -628,40 +755,27 @@ func (p *SetDataSizeLimitsForTestParams) Do(ctxt context.Context, h cdp.Handler) return h.Execute(ctxt, cdp.CommandNetworkSetDataSizeLimitsForTest, p, nil) } -// GetCertificateParams returns the DER-encoded certificate. -type GetCertificateParams struct { - Origin string `json:"origin"` // Origin to get certificate for. +// SetExtraHTTPHeadersParams specifies whether to always send extra HTTP +// headers with the requests from this page. +type SetExtraHTTPHeadersParams struct { + Headers Headers `json:"headers"` // Map with extra HTTP headers. } -// GetCertificate returns the DER-encoded certificate. +// SetExtraHTTPHeaders specifies whether to always send extra HTTP headers +// with the requests from this page. // // parameters: -// origin - Origin to get certificate for. -func GetCertificate(origin string) *GetCertificateParams { - return &GetCertificateParams{ - Origin: origin, +// headers - Map with extra HTTP headers. +func SetExtraHTTPHeaders(headers Headers) *SetExtraHTTPHeadersParams { + return &SetExtraHTTPHeadersParams{ + Headers: headers, } } -// GetCertificateReturns return values. -type GetCertificateReturns struct { - TableNames []string `json:"tableNames,omitempty"` -} - -// Do executes Network.getCertificate against the provided context and +// Do executes Network.setExtraHTTPHeaders against the provided context and // target handler. -// -// returns: -// tableNames -func (p *GetCertificateParams) Do(ctxt context.Context, h cdp.Handler) (tableNames []string, err error) { - // execute - var res GetCertificateReturns - err = h.Execute(ctxt, cdp.CommandNetworkGetCertificate, p, &res) - if err != nil { - return nil, err - } - - return res.TableNames, nil +func (p *SetExtraHTTPHeadersParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkSetExtraHTTPHeaders, p, nil) } // SetRequestInterceptionParams sets the requests to intercept that match a @@ -687,138 +801,24 @@ func (p *SetRequestInterceptionParams) Do(ctxt context.Context, h cdp.Handler) ( return h.Execute(ctxt, cdp.CommandNetworkSetRequestInterception, p, nil) } -// ContinueInterceptedRequestParams response to Network.requestIntercepted -// which either modifies the request to continue with any modifications, or -// blocks it, or completes it with the provided response bytes. If a network -// fetch occurs as a result which encounters a redirect an additional -// Network.requestIntercepted event will be sent with the same InterceptionId. -type ContinueInterceptedRequestParams struct { - InterceptionID InterceptionID `json:"interceptionId"` - ErrorReason ErrorReason `json:"errorReason,omitempty"` // If set this causes the request to fail with the given reason. Passing Aborted for requests marked with isNavigationRequest also cancels the navigation. Must not be set in response to an authChallenge. - RawResponse string `json:"rawResponse,omitempty"` // If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge. - URL string `json:"url,omitempty"` // If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge. - Method string `json:"method,omitempty"` // If set this allows the request method to be overridden. Must not be set in response to an authChallenge. - PostData string `json:"postData,omitempty"` // If set this allows postData to be set. Must not be set in response to an authChallenge. - Headers Headers `json:"headers,omitempty"` // If set this allows the request headers to be changed. Must not be set in response to an authChallenge. - AuthChallengeResponse *AuthChallengeResponse `json:"authChallengeResponse,omitempty"` // Response to a requestIntercepted with an authChallenge. Must not be set otherwise. +// SetUserAgentOverrideParams allows overriding user agent with the given +// string. +type SetUserAgentOverrideParams struct { + UserAgent string `json:"userAgent"` // User agent to use. } -// ContinueInterceptedRequest response to Network.requestIntercepted which -// either modifies the request to continue with any modifications, or blocks it, -// or completes it with the provided response bytes. If a network fetch occurs -// as a result which encounters a redirect an additional -// Network.requestIntercepted event will be sent with the same InterceptionId. +// SetUserAgentOverride allows overriding user agent with the given string. // // parameters: -// interceptionID -func ContinueInterceptedRequest(interceptionID InterceptionID) *ContinueInterceptedRequestParams { - return &ContinueInterceptedRequestParams{ - InterceptionID: interceptionID, +// userAgent - User agent to use. +func SetUserAgentOverride(userAgent string) *SetUserAgentOverrideParams { + return &SetUserAgentOverrideParams{ + UserAgent: userAgent, } } -// WithErrorReason if set this causes the request to fail with the given -// reason. Passing Aborted for requests marked with isNavigationRequest also -// cancels the navigation. Must not be set in response to an authChallenge. -func (p ContinueInterceptedRequestParams) WithErrorReason(errorReason ErrorReason) *ContinueInterceptedRequestParams { - p.ErrorReason = errorReason - return &p -} - -// WithRawResponse if set the requests completes using with the provided -// base64 encoded raw response, including HTTP status line and headers etc... -// Must not be set in response to an authChallenge. -func (p ContinueInterceptedRequestParams) WithRawResponse(rawResponse string) *ContinueInterceptedRequestParams { - p.RawResponse = rawResponse - return &p -} - -// WithURL if set the request url will be modified in a way that's not -// observable by page. Must not be set in response to an authChallenge. -func (p ContinueInterceptedRequestParams) WithURL(url string) *ContinueInterceptedRequestParams { - p.URL = url - return &p -} - -// WithMethod if set this allows the request method to be overridden. Must -// not be set in response to an authChallenge. -func (p ContinueInterceptedRequestParams) WithMethod(method string) *ContinueInterceptedRequestParams { - p.Method = method - return &p -} - -// WithPostData if set this allows postData to be set. Must not be set in -// response to an authChallenge. -func (p ContinueInterceptedRequestParams) WithPostData(postData string) *ContinueInterceptedRequestParams { - p.PostData = postData - return &p -} - -// WithHeaders if set this allows the request headers to be changed. Must not -// be set in response to an authChallenge. -func (p ContinueInterceptedRequestParams) WithHeaders(headers Headers) *ContinueInterceptedRequestParams { - p.Headers = headers - return &p -} - -// WithAuthChallengeResponse response to a requestIntercepted with an -// authChallenge. Must not be set otherwise. -func (p ContinueInterceptedRequestParams) WithAuthChallengeResponse(authChallengeResponse *AuthChallengeResponse) *ContinueInterceptedRequestParams { - p.AuthChallengeResponse = authChallengeResponse - return &p -} - -// Do executes Network.continueInterceptedRequest against the provided context and +// Do executes Network.setUserAgentOverride against the provided context and // target handler. -func (p *ContinueInterceptedRequestParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandNetworkContinueInterceptedRequest, p, nil) -} - -// GetResponseBodyForInterceptionParams returns content served for the given -// currently intercepted request. -type GetResponseBodyForInterceptionParams struct { - InterceptionID InterceptionID `json:"interceptionId"` // Identifier for the intercepted request to get body for. -} - -// GetResponseBodyForInterception returns content served for the given -// currently intercepted request. -// -// parameters: -// interceptionID - Identifier for the intercepted request to get body for. -func GetResponseBodyForInterception(interceptionID InterceptionID) *GetResponseBodyForInterceptionParams { - return &GetResponseBodyForInterceptionParams{ - InterceptionID: interceptionID, - } -} - -// GetResponseBodyForInterceptionReturns return values. -type GetResponseBodyForInterceptionReturns struct { - Body string `json:"body,omitempty"` // Response body. - Base64encoded bool `json:"base64Encoded,omitempty"` // True, if content was sent as base64. -} - -// Do executes Network.getResponseBodyForInterception against the provided context and -// target handler. -// -// returns: -// body - Response body. -func (p *GetResponseBodyForInterceptionParams) Do(ctxt context.Context, h cdp.Handler) (body []byte, err error) { - // execute - var res GetResponseBodyForInterceptionReturns - err = h.Execute(ctxt, cdp.CommandNetworkGetResponseBodyForInterception, p, &res) - if err != nil { - return nil, err - } - - // decode - var dec []byte - if res.Base64encoded { - dec, err = base64.StdEncoding.DecodeString(res.Body) - if err != nil { - return nil, err - } - } else { - dec = []byte(res.Body) - } - return dec, nil +func (p *SetUserAgentOverrideParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandNetworkSetUserAgentOverride, p, nil) } diff --git a/cdp/overlay/events.go b/cdp/overlay/events.go index df30c5b..9a41deb 100644 --- a/cdp/overlay/events.go +++ b/cdp/overlay/events.go @@ -7,12 +7,6 @@ import ( "github.com/knq/chromedp/cdp/page" ) -// EventNodeHighlightRequested fired when the node should be highlighted. -// This happens after call to setInspectMode. -type EventNodeHighlightRequested struct { - NodeID cdp.NodeID `json:"nodeId"` -} - // EventInspectNodeRequested fired when the node should be inspected. This // happens after call to setInspectMode or when user manually inspects an // element. @@ -20,6 +14,12 @@ type EventInspectNodeRequested struct { BackendNodeID cdp.BackendNodeID `json:"backendNodeId"` // Id of the node to inspect. } +// EventNodeHighlightRequested fired when the node should be highlighted. +// This happens after call to setInspectMode. +type EventNodeHighlightRequested struct { + NodeID cdp.NodeID `json:"nodeId"` +} + // EventScreenshotRequested fired when user asks to capture screenshot of // some area on the page. type EventScreenshotRequested struct { @@ -28,7 +28,7 @@ type EventScreenshotRequested struct { // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventOverlayNodeHighlightRequested, cdp.EventOverlayInspectNodeRequested, + cdp.EventOverlayNodeHighlightRequested, cdp.EventOverlayScreenshotRequested, } diff --git a/cdp/overlay/overlay.go b/cdp/overlay/overlay.go index d67fc60..16ffa5f 100644 --- a/cdp/overlay/overlay.go +++ b/cdp/overlay/overlay.go @@ -18,20 +18,6 @@ import ( "github.com/mailru/easyjson" ) -// EnableParams enables domain notifications. -type EnableParams struct{} - -// Enable enables domain notifications. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Overlay.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlayEnable, nil, nil) -} - // DisableParams disables domain notifications. type DisableParams struct{} @@ -46,192 +32,186 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandOverlayDisable, nil, nil) } -// SetShowPaintRectsParams requests that backend shows paint rectangles. -type SetShowPaintRectsParams struct { - Result bool `json:"result"` // True for showing paint rectangles +// EnableParams enables domain notifications. +type EnableParams struct{} + +// Enable enables domain notifications. +func Enable() *EnableParams { + return &EnableParams{} } -// SetShowPaintRects requests that backend shows paint rectangles. +// Do executes Overlay.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlayEnable, nil, nil) +} + +// GetHighlightObjectForTestParams for testing. +type GetHighlightObjectForTestParams struct { + NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get highlight object for. +} + +// GetHighlightObjectForTest for testing. // // parameters: -// result - True for showing paint rectangles -func SetShowPaintRects(result bool) *SetShowPaintRectsParams { - return &SetShowPaintRectsParams{ - Result: result, +// nodeID - Id of the node to get highlight object for. +func GetHighlightObjectForTest(nodeID cdp.NodeID) *GetHighlightObjectForTestParams { + return &GetHighlightObjectForTestParams{ + NodeID: nodeID, } } -// Do executes Overlay.setShowPaintRects against the provided context and +// GetHighlightObjectForTestReturns return values. +type GetHighlightObjectForTestReturns struct { + Highlight easyjson.RawMessage `json:"highlight,omitempty"` +} + +// Do executes Overlay.getHighlightObjectForTest against the provided context and // target handler. -func (p *SetShowPaintRectsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetShowPaintRects, p, nil) +// +// returns: +// highlight - Highlight data for the node. +func (p *GetHighlightObjectForTestParams) Do(ctxt context.Context, h cdp.Handler) (highlight easyjson.RawMessage, err error) { + // execute + var res GetHighlightObjectForTestReturns + err = h.Execute(ctxt, cdp.CommandOverlayGetHighlightObjectForTest, p, &res) + if err != nil { + return nil, err + } + + return res.Highlight, nil } -// SetShowDebugBordersParams requests that backend shows debug borders on -// layers. -type SetShowDebugBordersParams struct { - Show bool `json:"show"` // True for showing debug borders +// HideHighlightParams hides any highlight. +type HideHighlightParams struct{} + +// HideHighlight hides any highlight. +func HideHighlight() *HideHighlightParams { + return &HideHighlightParams{} } -// SetShowDebugBorders requests that backend shows debug borders on layers. +// Do executes Overlay.hideHighlight against the provided context and +// target handler. +func (p *HideHighlightParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlayHideHighlight, nil, nil) +} + +// HighlightFrameParams highlights owner element of the frame with given id. +type HighlightFrameParams struct { + FrameID cdp.FrameID `json:"frameId"` // Identifier of the frame to highlight. + ContentColor *cdp.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent). + ContentOutlineColor *cdp.RGBA `json:"contentOutlineColor,omitempty"` // The content box highlight outline color (default: transparent). +} + +// HighlightFrame highlights owner element of the frame with given id. // // parameters: -// show - True for showing debug borders -func SetShowDebugBorders(show bool) *SetShowDebugBordersParams { - return &SetShowDebugBordersParams{ - Show: show, +// frameID - Identifier of the frame to highlight. +func HighlightFrame(frameID cdp.FrameID) *HighlightFrameParams { + return &HighlightFrameParams{ + FrameID: frameID, } } -// Do executes Overlay.setShowDebugBorders against the provided context and -// target handler. -func (p *SetShowDebugBordersParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetShowDebugBorders, p, nil) -} - -// SetShowFPSCounterParams requests that backend shows the FPS counter. -type SetShowFPSCounterParams struct { - Show bool `json:"show"` // True for showing the FPS counter -} - -// SetShowFPSCounter requests that backend shows the FPS counter. -// -// parameters: -// show - True for showing the FPS counter -func SetShowFPSCounter(show bool) *SetShowFPSCounterParams { - return &SetShowFPSCounterParams{ - Show: show, - } -} - -// Do executes Overlay.setShowFPSCounter against the provided context and -// target handler. -func (p *SetShowFPSCounterParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetShowFPSCounter, p, nil) -} - -// SetShowScrollBottleneckRectsParams requests that backend shows scroll -// bottleneck rects. -type SetShowScrollBottleneckRectsParams struct { - Show bool `json:"show"` // True for showing scroll bottleneck rects -} - -// SetShowScrollBottleneckRects requests that backend shows scroll bottleneck -// rects. -// -// parameters: -// show - True for showing scroll bottleneck rects -func SetShowScrollBottleneckRects(show bool) *SetShowScrollBottleneckRectsParams { - return &SetShowScrollBottleneckRectsParams{ - Show: show, - } -} - -// Do executes Overlay.setShowScrollBottleneckRects against the provided context and -// target handler. -func (p *SetShowScrollBottleneckRectsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetShowScrollBottleneckRects, p, nil) -} - -// SetShowViewportSizeOnResizeParams paints viewport size upon main frame -// resize. -type SetShowViewportSizeOnResizeParams struct { - Show bool `json:"show"` // Whether to paint size or not. -} - -// SetShowViewportSizeOnResize paints viewport size upon main frame resize. -// -// parameters: -// show - Whether to paint size or not. -func SetShowViewportSizeOnResize(show bool) *SetShowViewportSizeOnResizeParams { - return &SetShowViewportSizeOnResizeParams{ - Show: show, - } -} - -// Do executes Overlay.setShowViewportSizeOnResize against the provided context and -// target handler. -func (p *SetShowViewportSizeOnResizeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetShowViewportSizeOnResize, p, nil) -} - -// SetPausedInDebuggerMessageParams [no description]. -type SetPausedInDebuggerMessageParams struct { - Message string `json:"message,omitempty"` // The message to display, also triggers resume and step over controls. -} - -// SetPausedInDebuggerMessage [no description]. -// -// parameters: -func SetPausedInDebuggerMessage() *SetPausedInDebuggerMessageParams { - return &SetPausedInDebuggerMessageParams{} -} - -// WithMessage the message to display, also triggers resume and step over -// controls. -func (p SetPausedInDebuggerMessageParams) WithMessage(message string) *SetPausedInDebuggerMessageParams { - p.Message = message +// WithContentColor the content box highlight fill color (default: +// transparent). +func (p HighlightFrameParams) WithContentColor(contentColor *cdp.RGBA) *HighlightFrameParams { + p.ContentColor = contentColor return &p } -// Do executes Overlay.setPausedInDebuggerMessage against the provided context and -// target handler. -func (p *SetPausedInDebuggerMessageParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetPausedInDebuggerMessage, p, nil) -} - -// SetSuspendedParams [no description]. -type SetSuspendedParams struct { - Suspended bool `json:"suspended"` // Whether overlay should be suspended and not consume any resources until resumed. -} - -// SetSuspended [no description]. -// -// parameters: -// suspended - Whether overlay should be suspended and not consume any resources until resumed. -func SetSuspended(suspended bool) *SetSuspendedParams { - return &SetSuspendedParams{ - Suspended: suspended, - } -} - -// Do executes Overlay.setSuspended against the provided context and -// target handler. -func (p *SetSuspendedParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetSuspended, p, nil) -} - -// SetInspectModeParams enters the 'inspect' mode. In this mode, elements -// that user is hovering over are highlighted. Backend then generates -// 'inspectNodeRequested' event upon element selection. -type SetInspectModeParams struct { - Mode InspectMode `json:"mode"` // Set an inspection mode. - HighlightConfig *HighlightConfig `json:"highlightConfig,omitempty"` // A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false. -} - -// SetInspectMode enters the 'inspect' mode. In this mode, elements that user -// is hovering over are highlighted. Backend then generates -// 'inspectNodeRequested' event upon element selection. -// -// parameters: -// mode - Set an inspection mode. -func SetInspectMode(mode InspectMode) *SetInspectModeParams { - return &SetInspectModeParams{ - Mode: mode, - } -} - -// WithHighlightConfig a descriptor for the highlight appearance of -// hovered-over nodes. May be omitted if enabled == false. -func (p SetInspectModeParams) WithHighlightConfig(highlightConfig *HighlightConfig) *SetInspectModeParams { - p.HighlightConfig = highlightConfig +// WithContentOutlineColor the content box highlight outline color (default: +// transparent). +func (p HighlightFrameParams) WithContentOutlineColor(contentOutlineColor *cdp.RGBA) *HighlightFrameParams { + p.ContentOutlineColor = contentOutlineColor return &p } -// Do executes Overlay.setInspectMode against the provided context and +// Do executes Overlay.highlightFrame against the provided context and // target handler. -func (p *SetInspectModeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlaySetInspectMode, p, nil) +func (p *HighlightFrameParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlayHighlightFrame, p, nil) +} + +// HighlightNodeParams highlights DOM node with given id or with the given +// JavaScript object wrapper. Either nodeId or objectId must be specified. +type HighlightNodeParams struct { + HighlightConfig *HighlightConfig `json:"highlightConfig"` // A descriptor for the highlight appearance. + NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node to highlight. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node to highlight. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node to be highlighted. +} + +// HighlightNode highlights DOM node with given id or with the given +// JavaScript object wrapper. Either nodeId or objectId must be specified. +// +// parameters: +// highlightConfig - A descriptor for the highlight appearance. +func HighlightNode(highlightConfig *HighlightConfig) *HighlightNodeParams { + return &HighlightNodeParams{ + HighlightConfig: highlightConfig, + } +} + +// WithNodeID identifier of the node to highlight. +func (p HighlightNodeParams) WithNodeID(nodeID cdp.NodeID) *HighlightNodeParams { + p.NodeID = nodeID + return &p +} + +// WithBackendNodeID identifier of the backend node to highlight. +func (p HighlightNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *HighlightNodeParams { + p.BackendNodeID = backendNodeID + return &p +} + +// WithObjectID JavaScript object id of the node to be highlighted. +func (p HighlightNodeParams) WithObjectID(objectID runtime.RemoteObjectID) *HighlightNodeParams { + p.ObjectID = objectID + return &p +} + +// Do executes Overlay.highlightNode against the provided context and +// target handler. +func (p *HighlightNodeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlayHighlightNode, p, nil) +} + +// HighlightQuadParams highlights given quad. Coordinates are absolute with +// respect to the main frame viewport. +type HighlightQuadParams struct { + Quad dom.Quad `json:"quad"` // Quad to highlight + Color *cdp.RGBA `json:"color,omitempty"` // The highlight fill color (default: transparent). + OutlineColor *cdp.RGBA `json:"outlineColor,omitempty"` // The highlight outline color (default: transparent). +} + +// HighlightQuad highlights given quad. Coordinates are absolute with respect +// to the main frame viewport. +// +// parameters: +// quad - Quad to highlight +func HighlightQuad(quad dom.Quad) *HighlightQuadParams { + return &HighlightQuadParams{ + Quad: quad, + } +} + +// WithColor the highlight fill color (default: transparent). +func (p HighlightQuadParams) WithColor(color *cdp.RGBA) *HighlightQuadParams { + p.Color = color + return &p +} + +// WithOutlineColor the highlight outline color (default: transparent). +func (p HighlightQuadParams) WithOutlineColor(outlineColor *cdp.RGBA) *HighlightQuadParams { + p.OutlineColor = outlineColor + return &p +} + +// Do executes Overlay.highlightQuad against the provided context and +// target handler. +func (p *HighlightQuadParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlayHighlightQuad, p, nil) } // HighlightRectParams highlights given rectangle. Coordinates are absolute @@ -280,170 +260,190 @@ func (p *HighlightRectParams) Do(ctxt context.Context, h cdp.Handler) (err error return h.Execute(ctxt, cdp.CommandOverlayHighlightRect, p, nil) } -// HighlightQuadParams highlights given quad. Coordinates are absolute with -// respect to the main frame viewport. -type HighlightQuadParams struct { - Quad dom.Quad `json:"quad"` // Quad to highlight - Color *cdp.RGBA `json:"color,omitempty"` // The highlight fill color (default: transparent). - OutlineColor *cdp.RGBA `json:"outlineColor,omitempty"` // The highlight outline color (default: transparent). +// SetInspectModeParams enters the 'inspect' mode. In this mode, elements +// that user is hovering over are highlighted. Backend then generates +// 'inspectNodeRequested' event upon element selection. +type SetInspectModeParams struct { + Mode InspectMode `json:"mode"` // Set an inspection mode. + HighlightConfig *HighlightConfig `json:"highlightConfig,omitempty"` // A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false. } -// HighlightQuad highlights given quad. Coordinates are absolute with respect -// to the main frame viewport. +// SetInspectMode enters the 'inspect' mode. In this mode, elements that user +// is hovering over are highlighted. Backend then generates +// 'inspectNodeRequested' event upon element selection. // // parameters: -// quad - Quad to highlight -func HighlightQuad(quad dom.Quad) *HighlightQuadParams { - return &HighlightQuadParams{ - Quad: quad, +// mode - Set an inspection mode. +func SetInspectMode(mode InspectMode) *SetInspectModeParams { + return &SetInspectModeParams{ + Mode: mode, } } -// WithColor the highlight fill color (default: transparent). -func (p HighlightQuadParams) WithColor(color *cdp.RGBA) *HighlightQuadParams { - p.Color = color +// WithHighlightConfig a descriptor for the highlight appearance of +// hovered-over nodes. May be omitted if enabled == false. +func (p SetInspectModeParams) WithHighlightConfig(highlightConfig *HighlightConfig) *SetInspectModeParams { + p.HighlightConfig = highlightConfig return &p } -// WithOutlineColor the highlight outline color (default: transparent). -func (p HighlightQuadParams) WithOutlineColor(outlineColor *cdp.RGBA) *HighlightQuadParams { - p.OutlineColor = outlineColor - return &p -} - -// Do executes Overlay.highlightQuad against the provided context and +// Do executes Overlay.setInspectMode against the provided context and // target handler. -func (p *HighlightQuadParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlayHighlightQuad, p, nil) +func (p *SetInspectModeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetInspectMode, p, nil) } -// HighlightNodeParams highlights DOM node with given id or with the given -// JavaScript object wrapper. Either nodeId or objectId must be specified. -type HighlightNodeParams struct { - HighlightConfig *HighlightConfig `json:"highlightConfig"` // A descriptor for the highlight appearance. - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node to highlight. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node to highlight. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node to be highlighted. +// SetPausedInDebuggerMessageParams [no description]. +type SetPausedInDebuggerMessageParams struct { + Message string `json:"message,omitempty"` // The message to display, also triggers resume and step over controls. } -// HighlightNode highlights DOM node with given id or with the given -// JavaScript object wrapper. Either nodeId or objectId must be specified. +// SetPausedInDebuggerMessage [no description]. // // parameters: -// highlightConfig - A descriptor for the highlight appearance. -func HighlightNode(highlightConfig *HighlightConfig) *HighlightNodeParams { - return &HighlightNodeParams{ - HighlightConfig: highlightConfig, - } +func SetPausedInDebuggerMessage() *SetPausedInDebuggerMessageParams { + return &SetPausedInDebuggerMessageParams{} } -// WithNodeID identifier of the node to highlight. -func (p HighlightNodeParams) WithNodeID(nodeID cdp.NodeID) *HighlightNodeParams { - p.NodeID = nodeID +// WithMessage the message to display, also triggers resume and step over +// controls. +func (p SetPausedInDebuggerMessageParams) WithMessage(message string) *SetPausedInDebuggerMessageParams { + p.Message = message return &p } -// WithBackendNodeID identifier of the backend node to highlight. -func (p HighlightNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *HighlightNodeParams { - p.BackendNodeID = backendNodeID - return &p -} - -// WithObjectID JavaScript object id of the node to be highlighted. -func (p HighlightNodeParams) WithObjectID(objectID runtime.RemoteObjectID) *HighlightNodeParams { - p.ObjectID = objectID - return &p -} - -// Do executes Overlay.highlightNode against the provided context and +// Do executes Overlay.setPausedInDebuggerMessage against the provided context and // target handler. -func (p *HighlightNodeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlayHighlightNode, p, nil) +func (p *SetPausedInDebuggerMessageParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetPausedInDebuggerMessage, p, nil) } -// HighlightFrameParams highlights owner element of the frame with given id. -type HighlightFrameParams struct { - FrameID cdp.FrameID `json:"frameId"` // Identifier of the frame to highlight. - ContentColor *cdp.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent). - ContentOutlineColor *cdp.RGBA `json:"contentOutlineColor,omitempty"` // The content box highlight outline color (default: transparent). +// SetShowDebugBordersParams requests that backend shows debug borders on +// layers. +type SetShowDebugBordersParams struct { + Show bool `json:"show"` // True for showing debug borders } -// HighlightFrame highlights owner element of the frame with given id. +// SetShowDebugBorders requests that backend shows debug borders on layers. // // parameters: -// frameID - Identifier of the frame to highlight. -func HighlightFrame(frameID cdp.FrameID) *HighlightFrameParams { - return &HighlightFrameParams{ - FrameID: frameID, +// show - True for showing debug borders +func SetShowDebugBorders(show bool) *SetShowDebugBordersParams { + return &SetShowDebugBordersParams{ + Show: show, } } -// WithContentColor the content box highlight fill color (default: -// transparent). -func (p HighlightFrameParams) WithContentColor(contentColor *cdp.RGBA) *HighlightFrameParams { - p.ContentColor = contentColor - return &p -} - -// WithContentOutlineColor the content box highlight outline color (default: -// transparent). -func (p HighlightFrameParams) WithContentOutlineColor(contentOutlineColor *cdp.RGBA) *HighlightFrameParams { - p.ContentOutlineColor = contentOutlineColor - return &p -} - -// Do executes Overlay.highlightFrame against the provided context and +// Do executes Overlay.setShowDebugBorders against the provided context and // target handler. -func (p *HighlightFrameParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlayHighlightFrame, p, nil) +func (p *SetShowDebugBordersParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetShowDebugBorders, p, nil) } -// HideHighlightParams hides any highlight. -type HideHighlightParams struct{} - -// HideHighlight hides any highlight. -func HideHighlight() *HideHighlightParams { - return &HideHighlightParams{} +// SetShowFPSCounterParams requests that backend shows the FPS counter. +type SetShowFPSCounterParams struct { + Show bool `json:"show"` // True for showing the FPS counter } -// Do executes Overlay.hideHighlight against the provided context and -// target handler. -func (p *HideHighlightParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandOverlayHideHighlight, nil, nil) -} - -// GetHighlightObjectForTestParams for testing. -type GetHighlightObjectForTestParams struct { - NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get highlight object for. -} - -// GetHighlightObjectForTest for testing. +// SetShowFPSCounter requests that backend shows the FPS counter. // // parameters: -// nodeID - Id of the node to get highlight object for. -func GetHighlightObjectForTest(nodeID cdp.NodeID) *GetHighlightObjectForTestParams { - return &GetHighlightObjectForTestParams{ - NodeID: nodeID, +// show - True for showing the FPS counter +func SetShowFPSCounter(show bool) *SetShowFPSCounterParams { + return &SetShowFPSCounterParams{ + Show: show, } } -// GetHighlightObjectForTestReturns return values. -type GetHighlightObjectForTestReturns struct { - Highlight easyjson.RawMessage `json:"highlight,omitempty"` -} - -// Do executes Overlay.getHighlightObjectForTest against the provided context and +// Do executes Overlay.setShowFPSCounter against the provided context and // target handler. -// -// returns: -// highlight - Highlight data for the node. -func (p *GetHighlightObjectForTestParams) Do(ctxt context.Context, h cdp.Handler) (highlight easyjson.RawMessage, err error) { - // execute - var res GetHighlightObjectForTestReturns - err = h.Execute(ctxt, cdp.CommandOverlayGetHighlightObjectForTest, p, &res) - if err != nil { - return nil, err - } - - return res.Highlight, nil +func (p *SetShowFPSCounterParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetShowFPSCounter, p, nil) +} + +// SetShowPaintRectsParams requests that backend shows paint rectangles. +type SetShowPaintRectsParams struct { + Result bool `json:"result"` // True for showing paint rectangles +} + +// SetShowPaintRects requests that backend shows paint rectangles. +// +// parameters: +// result - True for showing paint rectangles +func SetShowPaintRects(result bool) *SetShowPaintRectsParams { + return &SetShowPaintRectsParams{ + Result: result, + } +} + +// Do executes Overlay.setShowPaintRects against the provided context and +// target handler. +func (p *SetShowPaintRectsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetShowPaintRects, p, nil) +} + +// SetShowScrollBottleneckRectsParams requests that backend shows scroll +// bottleneck rects. +type SetShowScrollBottleneckRectsParams struct { + Show bool `json:"show"` // True for showing scroll bottleneck rects +} + +// SetShowScrollBottleneckRects requests that backend shows scroll bottleneck +// rects. +// +// parameters: +// show - True for showing scroll bottleneck rects +func SetShowScrollBottleneckRects(show bool) *SetShowScrollBottleneckRectsParams { + return &SetShowScrollBottleneckRectsParams{ + Show: show, + } +} + +// Do executes Overlay.setShowScrollBottleneckRects against the provided context and +// target handler. +func (p *SetShowScrollBottleneckRectsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetShowScrollBottleneckRects, p, nil) +} + +// SetShowViewportSizeOnResizeParams paints viewport size upon main frame +// resize. +type SetShowViewportSizeOnResizeParams struct { + Show bool `json:"show"` // Whether to paint size or not. +} + +// SetShowViewportSizeOnResize paints viewport size upon main frame resize. +// +// parameters: +// show - Whether to paint size or not. +func SetShowViewportSizeOnResize(show bool) *SetShowViewportSizeOnResizeParams { + return &SetShowViewportSizeOnResizeParams{ + Show: show, + } +} + +// Do executes Overlay.setShowViewportSizeOnResize against the provided context and +// target handler. +func (p *SetShowViewportSizeOnResizeParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetShowViewportSizeOnResize, p, nil) +} + +// SetSuspendedParams [no description]. +type SetSuspendedParams struct { + Suspended bool `json:"suspended"` // Whether overlay should be suspended and not consume any resources until resumed. +} + +// SetSuspended [no description]. +// +// parameters: +// suspended - Whether overlay should be suspended and not consume any resources until resumed. +func SetSuspended(suspended bool) *SetSuspendedParams { + return &SetSuspendedParams{ + Suspended: suspended, + } +} + +// Do executes Overlay.setSuspended against the provided context and +// target handler. +func (p *SetSuspendedParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandOverlaySetSuspended, p, nil) } diff --git a/cdp/page/easyjson.go b/cdp/page/easyjson.go index 3201d68..b21fd0b 100644 --- a/cdp/page/easyjson.go +++ b/cdp/page/easyjson.go @@ -1680,6 +1680,10 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPage18(in *jlexer.Lexer, out * out.PageRanges = string(in.String()) case "ignoreInvalidPageRanges": out.IgnoreInvalidPageRanges = bool(in.Bool()) + case "headerTemplate": + out.HeaderTemplate = string(in.String()) + case "footerTemplate": + out.FooterTemplate = string(in.String()) default: in.SkipRecursive() } @@ -1814,6 +1818,26 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPage18(out *jwriter.Writer, in } out.Bool(bool(in.IgnoreInvalidPageRanges)) } + if in.HeaderTemplate != "" { + const prefix string = ",\"headerTemplate\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.HeaderTemplate)) + } + if in.FooterTemplate != "" { + const prefix string = ",\"footerTemplate\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.FooterTemplate)) + } out.RawByte('}') } diff --git a/cdp/page/events.go b/cdp/page/events.go index 12429b5..8b28c9e 100644 --- a/cdp/page/events.go +++ b/cdp/page/events.go @@ -12,20 +12,6 @@ type EventDomContentEventFired struct { Timestamp *cdp.MonotonicTime `json:"timestamp"` } -// EventLoadEventFired [no description]. -type EventLoadEventFired struct { - Timestamp *cdp.MonotonicTime `json:"timestamp"` -} - -// EventLifecycleEvent fired for top level page lifecycle events such as -// navigation, load, paint, etc. -type EventLifecycleEvent struct { - FrameID cdp.FrameID `json:"frameId"` // Id of the frame. - LoaderID cdp.LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. - Name string `json:"name"` - Timestamp *cdp.MonotonicTime `json:"timestamp"` -} - // EventFrameAttached fired when frame has been attached to its parent. type EventFrameAttached struct { FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been attached. @@ -33,15 +19,33 @@ type EventFrameAttached struct { Stack *runtime.StackTrace `json:"stack,omitempty"` // JavaScript stack trace of when frame was attached, only set if frame initiated from script. } +// EventFrameClearedScheduledNavigation fired when frame no longer has a +// scheduled navigation. +type EventFrameClearedScheduledNavigation struct { + FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has cleared its scheduled navigation. +} + +// EventFrameDetached fired when frame has been detached from its parent. +type EventFrameDetached struct { + FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been detached. +} + // EventFrameNavigated fired once navigation of the frame has completed. // Frame is now associated with the new loader. type EventFrameNavigated struct { Frame *cdp.Frame `json:"frame"` // Frame object. } -// EventFrameDetached fired when frame has been detached from its parent. -type EventFrameDetached struct { - FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been detached. +// EventFrameResized [no description]. +type EventFrameResized struct{} + +// EventFrameScheduledNavigation fired when frame schedules a potential +// navigation. +type EventFrameScheduledNavigation struct { + FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has scheduled a navigation. + Delay float64 `json:"delay"` // Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start. + Reason FrameScheduledNavigationReason `json:"reason"` // The reason for the navigation. + URL string `json:"url"` // The destination URL for the scheduled navigation. } // EventFrameStartedLoading fired when frame has started loading. @@ -54,23 +58,18 @@ type EventFrameStoppedLoading struct { FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has stopped loading. } -// EventFrameScheduledNavigation fired when frame schedules a potential -// navigation. -type EventFrameScheduledNavigation struct { - FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has scheduled a navigation. - Delay float64 `json:"delay"` // Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start. - Reason FrameScheduledNavigationReason `json:"reason"` // The reason for the navigation. - URL string `json:"url"` // The destination URL for the scheduled navigation. -} +// EventInterstitialHidden fired when interstitial page was hidden. +type EventInterstitialHidden struct{} -// EventFrameClearedScheduledNavigation fired when frame no longer has a -// scheduled navigation. -type EventFrameClearedScheduledNavigation struct { - FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has cleared its scheduled navigation. -} +// EventInterstitialShown fired when interstitial page was shown. +type EventInterstitialShown struct{} -// EventFrameResized [no description]. -type EventFrameResized struct{} +// EventJavascriptDialogClosed fired when a JavaScript initiated dialog +// (alert, confirm, prompt, or onbeforeunload) has been closed. +type EventJavascriptDialogClosed struct { + Result bool `json:"result"` // Whether dialog was confirmed. + UserInput string `json:"userInput"` // User input in case of prompt. +} // EventJavascriptDialogOpening fired when a JavaScript initiated dialog // (alert, confirm, prompt, or onbeforeunload) is about to open. @@ -81,11 +80,18 @@ type EventJavascriptDialogOpening struct { DefaultPrompt string `json:"defaultPrompt,omitempty"` // Default dialog prompt. } -// EventJavascriptDialogClosed fired when a JavaScript initiated dialog -// (alert, confirm, prompt, or onbeforeunload) has been closed. -type EventJavascriptDialogClosed struct { - Result bool `json:"result"` // Whether dialog was confirmed. - UserInput string `json:"userInput"` // User input in case of prompt. +// EventLifecycleEvent fired for top level page lifecycle events such as +// navigation, load, paint, etc. +type EventLifecycleEvent struct { + FrameID cdp.FrameID `json:"frameId"` // Id of the frame. + LoaderID cdp.LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker. + Name string `json:"name"` + Timestamp *cdp.MonotonicTime `json:"timestamp"` +} + +// EventLoadEventFired [no description]. +type EventLoadEventFired struct { + Timestamp *cdp.MonotonicTime `json:"timestamp"` } // EventScreencastFrame compressed image data requested by the @@ -102,12 +108,6 @@ type EventScreencastVisibilityChanged struct { Visible bool `json:"visible"` // True if the page is visible. } -// EventInterstitialShown fired when interstitial page was shown. -type EventInterstitialShown struct{} - -// EventInterstitialHidden fired when interstitial page was hidden. -type EventInterstitialHidden struct{} - // EventWindowOpen fired when a new window is going to be opened, via // window.open(), link click, form submission, etc. type EventWindowOpen struct { @@ -120,21 +120,21 @@ type EventWindowOpen struct { // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ cdp.EventPageDomContentEventFired, - cdp.EventPageLoadEventFired, - cdp.EventPageLifecycleEvent, cdp.EventPageFrameAttached, - cdp.EventPageFrameNavigated, + cdp.EventPageFrameClearedScheduledNavigation, cdp.EventPageFrameDetached, + cdp.EventPageFrameNavigated, + cdp.EventPageFrameResized, + cdp.EventPageFrameScheduledNavigation, cdp.EventPageFrameStartedLoading, cdp.EventPageFrameStoppedLoading, - cdp.EventPageFrameScheduledNavigation, - cdp.EventPageFrameClearedScheduledNavigation, - cdp.EventPageFrameResized, - cdp.EventPageJavascriptDialogOpening, + cdp.EventPageInterstitialHidden, + cdp.EventPageInterstitialShown, cdp.EventPageJavascriptDialogClosed, + cdp.EventPageJavascriptDialogOpening, + cdp.EventPageLifecycleEvent, + cdp.EventPageLoadEventFired, cdp.EventPageScreencastFrame, cdp.EventPageScreencastVisibilityChanged, - cdp.EventPageInterstitialShown, - cdp.EventPageInterstitialHidden, cdp.EventPageWindowOpen, } diff --git a/cdp/page/page.go b/cdp/page/page.go index 96ddb2a..eb5e6b1 100644 --- a/cdp/page/page.go +++ b/cdp/page/page.go @@ -19,34 +19,6 @@ import ( "github.com/knq/chromedp/cdp/runtime" ) -// EnableParams enables page domain notifications. -type EnableParams struct{} - -// Enable enables page domain notifications. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Page.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageEnable, nil, nil) -} - -// DisableParams disables page domain notifications. -type DisableParams struct{} - -// Disable disables page domain notifications. -func Disable() *DisableParams { - return &DisableParams{} -} - -// Do executes Page.disable against the provided context and -// target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageDisable, nil, nil) -} - // AddScriptToEvaluateOnNewDocumentParams evaluates given script in every // frame upon creation (before loading frame's scripts). type AddScriptToEvaluateOnNewDocumentParams struct { @@ -85,439 +57,18 @@ func (p *AddScriptToEvaluateOnNewDocumentParams) Do(ctxt context.Context, h cdp. return res.Identifier, nil } -// RemoveScriptToEvaluateOnNewDocumentParams removes given script from the -// list. -type RemoveScriptToEvaluateOnNewDocumentParams struct { - Identifier ScriptIdentifier `json:"identifier"` +// BringToFrontParams brings page to front (activates tab). +type BringToFrontParams struct{} + +// BringToFront brings page to front (activates tab). +func BringToFront() *BringToFrontParams { + return &BringToFrontParams{} } -// RemoveScriptToEvaluateOnNewDocument removes given script from the list. -// -// parameters: -// identifier -func RemoveScriptToEvaluateOnNewDocument(identifier ScriptIdentifier) *RemoveScriptToEvaluateOnNewDocumentParams { - return &RemoveScriptToEvaluateOnNewDocumentParams{ - Identifier: identifier, - } -} - -// Do executes Page.removeScriptToEvaluateOnNewDocument against the provided context and +// Do executes Page.bringToFront against the provided context and // target handler. -func (p *RemoveScriptToEvaluateOnNewDocumentParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageRemoveScriptToEvaluateOnNewDocument, p, nil) -} - -// SetAutoAttachToCreatedPagesParams controls whether browser will open a new -// inspector window for connected pages. -type SetAutoAttachToCreatedPagesParams struct { - AutoAttach bool `json:"autoAttach"` // If true, browser will open a new inspector window for every page created from this one. -} - -// SetAutoAttachToCreatedPages controls whether browser will open a new -// inspector window for connected pages. -// -// parameters: -// autoAttach - If true, browser will open a new inspector window for every page created from this one. -func SetAutoAttachToCreatedPages(autoAttach bool) *SetAutoAttachToCreatedPagesParams { - return &SetAutoAttachToCreatedPagesParams{ - AutoAttach: autoAttach, - } -} - -// Do executes Page.setAutoAttachToCreatedPages against the provided context and -// target handler. -func (p *SetAutoAttachToCreatedPagesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageSetAutoAttachToCreatedPages, p, 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. -// -// parameters: -// enabled - If true, starts emitting lifecycle events. -func SetLifecycleEventsEnabled(enabled bool) *SetLifecycleEventsEnabledParams { - return &SetLifecycleEventsEnabledParams{ - Enabled: enabled, - } -} - -// Do executes Page.setLifecycleEventsEnabled against the provided context and -// target handler. -func (p *SetLifecycleEventsEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageSetLifecycleEventsEnabled, p, 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. -} - -// Reload reloads given page optionally ignoring the cache. -// -// parameters: -func Reload() *ReloadParams { - return &ReloadParams{} -} - -// WithIgnoreCache if true, browser cache is ignored (as if the user pressed -// Shift+refresh). -func (p ReloadParams) WithIgnoreCache(ignoreCache bool) *ReloadParams { - p.IgnoreCache = ignoreCache - return &p -} - -// WithScriptToEvaluateOnLoad if set, the script will be injected into all -// frames of the inspected page after reload. -func (p ReloadParams) WithScriptToEvaluateOnLoad(scriptToEvaluateOnLoad string) *ReloadParams { - p.ScriptToEvaluateOnLoad = scriptToEvaluateOnLoad - return &p -} - -// Do executes Page.reload against the provided context and -// target handler. -func (p *ReloadParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageReload, p, 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. -// -// parameters: -// enabled - Whether to block ads. -func SetAdBlockingEnabled(enabled bool) *SetAdBlockingEnabledParams { - return &SetAdBlockingEnabledParams{ - Enabled: enabled, - } -} - -// Do executes Page.setAdBlockingEnabled against the provided context and -// target handler. -func (p *SetAdBlockingEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageSetAdBlockingEnabled, p, 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. -} - -// Navigate navigates current page to the given URL. -// -// parameters: -// url - URL to navigate the page to. -func Navigate(url string) *NavigateParams { - return &NavigateParams{ - URL: url, - } -} - -// WithReferrer referrer URL. -func (p NavigateParams) WithReferrer(referrer string) *NavigateParams { - p.Referrer = referrer - return &p -} - -// WithTransitionType intended transition type. -func (p NavigateParams) WithTransitionType(transitionType TransitionType) *NavigateParams { - p.TransitionType = transitionType - return &p -} - -// 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. - 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 and -// target handler. -// -// returns: -// frameID - Frame id that has navigated (or failed to navigate) -// loaderID - Loader identifier. -// errorText - User friendly error message, present if and only if navigation has failed. -func (p *NavigateParams) Do(ctxt context.Context, h cdp.Handler) (frameID cdp.FrameID, loaderID cdp.LoaderID, errorText string, err error) { - // execute - var res NavigateReturns - err = h.Execute(ctxt, cdp.CommandPageNavigate, p, &res) - if err != nil { - return "", "", "", err - } - - return res.FrameID, res.LoaderID, res.ErrorText, 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. -func StopLoading() *StopLoadingParams { - return &StopLoadingParams{} -} - -// Do executes Page.stopLoading against the provided context and -// target handler. -func (p *StopLoadingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageStopLoading, nil, nil) -} - -// GetNavigationHistoryParams returns navigation history for the current -// page. -type GetNavigationHistoryParams struct{} - -// GetNavigationHistory returns navigation history for the current page. -func GetNavigationHistory() *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 and -// target handler. -// -// returns: -// currentIndex - Index of the current navigation history entry. -// entries - Array of navigation history entries. -func (p *GetNavigationHistoryParams) Do(ctxt context.Context, h cdp.Handler) (currentIndex int64, entries []*NavigationEntry, err error) { - // execute - var res GetNavigationHistoryReturns - err = h.Execute(ctxt, cdp.CommandPageGetNavigationHistory, nil, &res) - if err != nil { - return 0, nil, err - } - - return res.CurrentIndex, res.Entries, 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. -// -// parameters: -// entryID - Unique id of the entry to navigate to. -func NavigateToHistoryEntry(entryID int64) *NavigateToHistoryEntryParams { - return &NavigateToHistoryEntryParams{ - EntryID: entryID, - } -} - -// Do executes Page.navigateToHistoryEntry against the provided context and -// target handler. -func (p *NavigateToHistoryEntryParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageNavigateToHistoryEntry, p, nil) -} - -// GetResourceTreeParams returns present frame / resource tree structure. -type GetResourceTreeParams struct{} - -// GetResourceTree returns present frame / resource tree structure. -func GetResourceTree() *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 and -// target handler. -// -// returns: -// frameTree - Present frame / resource tree structure. -func (p *GetResourceTreeParams) Do(ctxt context.Context, h cdp.Handler) (frameTree *FrameResourceTree, err error) { - // execute - var res GetResourceTreeReturns - err = h.Execute(ctxt, cdp.CommandPageGetResourceTree, nil, &res) - if err != nil { - return nil, err - } - - return res.FrameTree, nil -} - -// GetFrameTreeParams returns present frame tree structure. -type GetFrameTreeParams struct{} - -// GetFrameTree returns present frame tree structure. -func GetFrameTree() *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 and -// target handler. -// -// returns: -// frameTree - Present frame tree structure. -func (p *GetFrameTreeParams) Do(ctxt context.Context, h cdp.Handler) (frameTree *FrameTree, err error) { - // execute - var res GetFrameTreeReturns - err = h.Execute(ctxt, cdp.CommandPageGetFrameTree, nil, &res) - if err != nil { - return nil, err - } - - return res.FrameTree, 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. -// -// parameters: -// frameID - Frame id to get resource for. -// url - URL of the resource to get content for. -func GetResourceContent(frameID cdp.FrameID, url string) *GetResourceContentParams { - return &GetResourceContentParams{ - FrameID: frameID, - URL: 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 and -// target handler. -// -// returns: -// content - Resource content. -func (p *GetResourceContentParams) Do(ctxt context.Context, h cdp.Handler) (content []byte, err error) { - // execute - var res GetResourceContentReturns - err = h.Execute(ctxt, cdp.CommandPageGetResourceContent, p, &res) - if err != nil { - return nil, err - } - - // decode - var dec []byte - if res.Base64encoded { - dec, err = base64.StdEncoding.DecodeString(res.Content) - if err != nil { - return nil, err - } - } else { - dec = []byte(res.Content) - } - return dec, 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. -// -// parameters: -// frameID - Frame id for resource to search in. -// url - URL of the resource to search in. -// query - String to search for. -func SearchInResource(frameID cdp.FrameID, url string, query string) *SearchInResourceParams { - return &SearchInResourceParams{ - FrameID: frameID, - URL: url, - Query: query, - } -} - -// WithCaseSensitive if true, search is case sensitive. -func (p SearchInResourceParams) WithCaseSensitive(caseSensitive bool) *SearchInResourceParams { - p.CaseSensitive = caseSensitive - return &p -} - -// WithIsRegex if true, treats string parameter as regex. -func (p SearchInResourceParams) WithIsRegex(isRegex bool) *SearchInResourceParams { - p.IsRegex = isRegex - return &p -} - -// SearchInResourceReturns return values. -type SearchInResourceReturns struct { - Result []*debugger.SearchMatch `json:"result,omitempty"` // List of search matches. -} - -// Do executes Page.searchInResource against the provided context and -// target handler. -// -// returns: -// result - List of search matches. -func (p *SearchInResourceParams) Do(ctxt context.Context, h cdp.Handler) (result []*debugger.SearchMatch, err error) { - // execute - var res SearchInResourceReturns - err = h.Execute(ctxt, cdp.CommandPageSearchInResource, p, &res) - if err != nil { - return nil, err - } - - return res.Result, 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. -// -// parameters: -// frameID - Frame id to set HTML for. -// html - HTML content to set. -func SetDocumentContent(frameID cdp.FrameID, html string) *SetDocumentContentParams { - return &SetDocumentContentParams{ - FrameID: frameID, - HTML: html, - } -} - -// Do executes Page.setDocumentContent against the provided context and -// target handler. -func (p *SetDocumentContentParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageSetDocumentContent, p, nil) +func (p *BringToFrontParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageBringToFront, nil, nil) } // CaptureScreenshotParams capture page screenshot. @@ -587,6 +138,400 @@ func (p *CaptureScreenshotParams) Do(ctxt context.Context, h cdp.Handler) (data return dec, 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. +// +// parameters: +// frameID - Id of the frame in which the isolated world should be created. +func CreateIsolatedWorld(frameID cdp.FrameID) *CreateIsolatedWorldParams { + return &CreateIsolatedWorldParams{ + FrameID: frameID, + } +} + +// WithWorldName an optional name which is reported in the Execution Context. +func (p CreateIsolatedWorldParams) WithWorldName(worldName string) *CreateIsolatedWorldParams { + p.WorldName = worldName + return &p +} + +// WithGrantUniveralAccess whether or not universal access should be granted +// to the isolated world. This is a powerful option, use with caution. +func (p CreateIsolatedWorldParams) WithGrantUniveralAccess(grantUniveralAccess bool) *CreateIsolatedWorldParams { + p.GrantUniveralAccess = grantUniveralAccess + return &p +} + +// 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 and +// target handler. +// +// returns: +// executionContextID - Execution context of the isolated world. +func (p *CreateIsolatedWorldParams) Do(ctxt context.Context, h cdp.Handler) (executionContextID runtime.ExecutionContextID, err error) { + // execute + var res CreateIsolatedWorldReturns + err = h.Execute(ctxt, cdp.CommandPageCreateIsolatedWorld, p, &res) + if err != nil { + return 0, err + } + + return res.ExecutionContextID, nil +} + +// DisableParams disables page domain notifications. +type DisableParams struct{} + +// Disable disables page domain notifications. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes Page.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageDisable, nil, nil) +} + +// EnableParams enables page domain notifications. +type EnableParams struct{} + +// Enable enables page domain notifications. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes Page.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageEnable, nil, nil) +} + +// GetAppManifestParams [no description]. +type GetAppManifestParams struct{} + +// GetAppManifest [no description]. +func GetAppManifest() *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. +} + +// Do executes Page.getAppManifest against the provided context and +// target handler. +// +// returns: +// url - Manifest location. +// errors +// data - Manifest content. +func (p *GetAppManifestParams) Do(ctxt context.Context, h cdp.Handler) (url string, errors []*AppManifestError, data string, err error) { + // execute + var res GetAppManifestReturns + err = h.Execute(ctxt, cdp.CommandPageGetAppManifest, nil, &res) + if err != nil { + return "", nil, "", err + } + + return res.URL, res.Errors, res.Data, nil +} + +// GetFrameTreeParams returns present frame tree structure. +type GetFrameTreeParams struct{} + +// GetFrameTree returns present frame tree structure. +func GetFrameTree() *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 and +// target handler. +// +// returns: +// frameTree - Present frame tree structure. +func (p *GetFrameTreeParams) Do(ctxt context.Context, h cdp.Handler) (frameTree *FrameTree, err error) { + // execute + var res GetFrameTreeReturns + err = h.Execute(ctxt, cdp.CommandPageGetFrameTree, nil, &res) + if err != nil { + return nil, err + } + + return res.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. +func GetLayoutMetrics() *GetLayoutMetricsParams { + return &GetLayoutMetricsParams{} +} + +// GetLayoutMetricsReturns return values. +type GetLayoutMetricsReturns struct { + LayoutViewport *LayoutViewport `json:"layoutViewport,omitempty"` // Metrics relating to the layout viewport. + VisualViewport *VisualViewport `json:"visualViewport,omitempty"` // Metrics relating to the visual viewport. + ContentSize *dom.Rect `json:"contentSize,omitempty"` // Size of scrollable area. +} + +// Do executes Page.getLayoutMetrics against the provided context and +// target handler. +// +// returns: +// layoutViewport - Metrics relating to the layout viewport. +// visualViewport - Metrics relating to the visual viewport. +// contentSize - Size of scrollable area. +func (p *GetLayoutMetricsParams) Do(ctxt context.Context, h cdp.Handler) (layoutViewport *LayoutViewport, visualViewport *VisualViewport, contentSize *dom.Rect, err error) { + // execute + var res GetLayoutMetricsReturns + err = h.Execute(ctxt, cdp.CommandPageGetLayoutMetrics, nil, &res) + if err != nil { + return nil, nil, nil, err + } + + return res.LayoutViewport, res.VisualViewport, res.ContentSize, nil +} + +// GetNavigationHistoryParams returns navigation history for the current +// page. +type GetNavigationHistoryParams struct{} + +// GetNavigationHistory returns navigation history for the current page. +func GetNavigationHistory() *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 and +// target handler. +// +// returns: +// currentIndex - Index of the current navigation history entry. +// entries - Array of navigation history entries. +func (p *GetNavigationHistoryParams) Do(ctxt context.Context, h cdp.Handler) (currentIndex int64, entries []*NavigationEntry, err error) { + // execute + var res GetNavigationHistoryReturns + err = h.Execute(ctxt, cdp.CommandPageGetNavigationHistory, nil, &res) + if err != nil { + return 0, nil, err + } + + return res.CurrentIndex, res.Entries, 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. +// +// parameters: +// frameID - Frame id to get resource for. +// url - URL of the resource to get content for. +func GetResourceContent(frameID cdp.FrameID, url string) *GetResourceContentParams { + return &GetResourceContentParams{ + FrameID: frameID, + URL: 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 and +// target handler. +// +// returns: +// content - Resource content. +func (p *GetResourceContentParams) Do(ctxt context.Context, h cdp.Handler) (content []byte, err error) { + // execute + var res GetResourceContentReturns + err = h.Execute(ctxt, cdp.CommandPageGetResourceContent, p, &res) + if err != nil { + return nil, err + } + + // decode + var dec []byte + if res.Base64encoded { + dec, err = base64.StdEncoding.DecodeString(res.Content) + if err != nil { + return nil, err + } + } else { + dec = []byte(res.Content) + } + return dec, nil +} + +// GetResourceTreeParams returns present frame / resource tree structure. +type GetResourceTreeParams struct{} + +// GetResourceTree returns present frame / resource tree structure. +func GetResourceTree() *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 and +// target handler. +// +// returns: +// frameTree - Present frame / resource tree structure. +func (p *GetResourceTreeParams) Do(ctxt context.Context, h cdp.Handler) (frameTree *FrameResourceTree, err error) { + // execute + var res GetResourceTreeReturns + err = h.Execute(ctxt, cdp.CommandPageGetResourceTree, nil, &res) + if err != nil { + return nil, err + } + + return res.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). +// +// parameters: +// accept - Whether to accept or dismiss the dialog. +func HandleJavaScriptDialog(accept bool) *HandleJavaScriptDialogParams { + return &HandleJavaScriptDialogParams{ + Accept: accept, + } +} + +// WithPromptText the text to enter into the dialog prompt before accepting. +// Used only if this is a prompt dialog. +func (p HandleJavaScriptDialogParams) WithPromptText(promptText string) *HandleJavaScriptDialogParams { + p.PromptText = promptText + return &p +} + +// Do executes Page.handleJavaScriptDialog against the provided context and +// target handler. +func (p *HandleJavaScriptDialogParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageHandleJavaScriptDialog, p, 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. +} + +// Navigate navigates current page to the given URL. +// +// parameters: +// url - URL to navigate the page to. +func Navigate(url string) *NavigateParams { + return &NavigateParams{ + URL: url, + } +} + +// WithReferrer referrer URL. +func (p NavigateParams) WithReferrer(referrer string) *NavigateParams { + p.Referrer = referrer + return &p +} + +// WithTransitionType intended transition type. +func (p NavigateParams) WithTransitionType(transitionType TransitionType) *NavigateParams { + p.TransitionType = transitionType + return &p +} + +// 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. + 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 and +// target handler. +// +// returns: +// frameID - Frame id that has navigated (or failed to navigate) +// loaderID - Loader identifier. +// errorText - User friendly error message, present if and only if navigation has failed. +func (p *NavigateParams) Do(ctxt context.Context, h cdp.Handler) (frameID cdp.FrameID, loaderID cdp.LoaderID, errorText string, err error) { + // execute + var res NavigateReturns + err = h.Execute(ctxt, cdp.CommandPageNavigate, p, &res) + if err != nil { + return "", "", "", err + } + + return res.FrameID, res.LoaderID, res.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. +// +// parameters: +// entryID - Unique id of the entry to navigate to. +func NavigateToHistoryEntry(entryID int64) *NavigateToHistoryEntryParams { + return &NavigateToHistoryEntryParams{ + EntryID: entryID, + } +} + +// Do executes Page.navigateToHistoryEntry against the provided context and +// target handler. +func (p *NavigateToHistoryEntryParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageNavigateToHistoryEntry, p, nil) +} + // PrintToPDFParams print page as PDF. type PrintToPDFParams struct { Landscape bool `json:"landscape,omitempty"` // Paper orientation. Defaults to false. @@ -601,6 +546,8 @@ type PrintToPDFParams struct { 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. } // PrintToPDF print page as PDF. @@ -684,6 +631,24 @@ func (p PrintToPDFParams) WithIgnoreInvalidPageRanges(ignoreInvalidPageRanges bo return &p } +// 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, would generate span +// containing the title. +func (p PrintToPDFParams) WithHeaderTemplate(headerTemplate string) *PrintToPDFParams { + p.HeaderTemplate = headerTemplate + return &p +} + +// WithFooterTemplate HTML template for the print footer. Should use the same +// format as the headerTemplate. +func (p PrintToPDFParams) WithFooterTemplate(footerTemplate string) *PrintToPDFParams { + p.FooterTemplate = footerTemplate + return &p +} + // PrintToPDFReturns return values. type PrintToPDFReturns struct { Data string `json:"data,omitempty"` // Base64-encoded pdf data. @@ -711,6 +676,276 @@ func (p *PrintToPDFParams) Do(ctxt context.Context, h cdp.Handler) (data []byte, return dec, 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. +// +// parameters: +func Reload() *ReloadParams { + return &ReloadParams{} +} + +// WithIgnoreCache if true, browser cache is ignored (as if the user pressed +// Shift+refresh). +func (p ReloadParams) WithIgnoreCache(ignoreCache bool) *ReloadParams { + p.IgnoreCache = ignoreCache + return &p +} + +// 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 (p ReloadParams) WithScriptToEvaluateOnLoad(scriptToEvaluateOnLoad string) *ReloadParams { + p.ScriptToEvaluateOnLoad = scriptToEvaluateOnLoad + return &p +} + +// Do executes Page.reload against the provided context and +// target handler. +func (p *ReloadParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageReload, p, nil) +} + +// RemoveScriptToEvaluateOnNewDocumentParams removes given script from the +// list. +type RemoveScriptToEvaluateOnNewDocumentParams struct { + Identifier ScriptIdentifier `json:"identifier"` +} + +// RemoveScriptToEvaluateOnNewDocument removes given script from the list. +// +// parameters: +// identifier +func RemoveScriptToEvaluateOnNewDocument(identifier ScriptIdentifier) *RemoveScriptToEvaluateOnNewDocumentParams { + return &RemoveScriptToEvaluateOnNewDocumentParams{ + Identifier: identifier, + } +} + +// Do executes Page.removeScriptToEvaluateOnNewDocument against the provided context and +// target handler. +func (p *RemoveScriptToEvaluateOnNewDocumentParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageRemoveScriptToEvaluateOnNewDocument, p, nil) +} + +// RequestAppBannerParams [no description]. +type RequestAppBannerParams struct{} + +// RequestAppBanner [no description]. +func RequestAppBanner() *RequestAppBannerParams { + return &RequestAppBannerParams{} +} + +// Do executes Page.requestAppBanner against the provided context and +// target handler. +func (p *RequestAppBannerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageRequestAppBanner, nil, 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. +// +// parameters: +// sessionID - Frame number. +func ScreencastFrameAck(sessionID int64) *ScreencastFrameAckParams { + return &ScreencastFrameAckParams{ + SessionID: sessionID, + } +} + +// Do executes Page.screencastFrameAck against the provided context and +// target handler. +func (p *ScreencastFrameAckParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageScreencastFrameAck, p, 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. +// +// parameters: +// frameID - Frame id for resource to search in. +// url - URL of the resource to search in. +// query - String to search for. +func SearchInResource(frameID cdp.FrameID, url string, query string) *SearchInResourceParams { + return &SearchInResourceParams{ + FrameID: frameID, + URL: url, + Query: query, + } +} + +// WithCaseSensitive if true, search is case sensitive. +func (p SearchInResourceParams) WithCaseSensitive(caseSensitive bool) *SearchInResourceParams { + p.CaseSensitive = caseSensitive + return &p +} + +// WithIsRegex if true, treats string parameter as regex. +func (p SearchInResourceParams) WithIsRegex(isRegex bool) *SearchInResourceParams { + p.IsRegex = isRegex + return &p +} + +// SearchInResourceReturns return values. +type SearchInResourceReturns struct { + Result []*debugger.SearchMatch `json:"result,omitempty"` // List of search matches. +} + +// Do executes Page.searchInResource against the provided context and +// target handler. +// +// returns: +// result - List of search matches. +func (p *SearchInResourceParams) Do(ctxt context.Context, h cdp.Handler) (result []*debugger.SearchMatch, err error) { + // execute + var res SearchInResourceReturns + err = h.Execute(ctxt, cdp.CommandPageSearchInResource, p, &res) + if err != nil { + return nil, err + } + + return res.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. +// +// parameters: +// enabled - Whether to block ads. +func SetAdBlockingEnabled(enabled bool) *SetAdBlockingEnabledParams { + return &SetAdBlockingEnabledParams{ + Enabled: enabled, + } +} + +// Do executes Page.setAdBlockingEnabled against the provided context and +// target handler. +func (p *SetAdBlockingEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageSetAdBlockingEnabled, p, nil) +} + +// SetAutoAttachToCreatedPagesParams controls whether browser will open a new +// inspector window for connected pages. +type SetAutoAttachToCreatedPagesParams struct { + AutoAttach bool `json:"autoAttach"` // If true, browser will open a new inspector window for every page created from this one. +} + +// SetAutoAttachToCreatedPages controls whether browser will open a new +// inspector window for connected pages. +// +// parameters: +// autoAttach - If true, browser will open a new inspector window for every page created from this one. +func SetAutoAttachToCreatedPages(autoAttach bool) *SetAutoAttachToCreatedPagesParams { + return &SetAutoAttachToCreatedPagesParams{ + AutoAttach: autoAttach, + } +} + +// Do executes Page.setAutoAttachToCreatedPages against the provided context and +// target handler. +func (p *SetAutoAttachToCreatedPagesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageSetAutoAttachToCreatedPages, p, 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. +// +// parameters: +// frameID - Frame id to set HTML for. +// html - HTML content to set. +func SetDocumentContent(frameID cdp.FrameID, html string) *SetDocumentContentParams { + return &SetDocumentContentParams{ + FrameID: frameID, + HTML: html, + } +} + +// Do executes Page.setDocumentContent against the provided context and +// target handler. +func (p *SetDocumentContentParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageSetDocumentContent, p, nil) +} + +// SetDownloadBehaviorParams set the behavior when downloading a file. +type SetDownloadBehaviorParams struct { + Behavior SetDownloadBehaviorBehavior `json:"behavior"` // Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). + DownloadPath string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow' +} + +// SetDownloadBehavior set the behavior when downloading a file. +// +// parameters: +// behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). +func SetDownloadBehavior(behavior SetDownloadBehaviorBehavior) *SetDownloadBehaviorParams { + return &SetDownloadBehaviorParams{ + Behavior: behavior, + } +} + +// WithDownloadPath the default path to save downloaded files to. This is +// required if behavior is set to 'allow'. +func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDownloadBehaviorParams { + p.DownloadPath = downloadPath + return &p +} + +// Do executes Page.setDownloadBehavior against the provided context and +// target handler. +func (p *SetDownloadBehaviorParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageSetDownloadBehavior, p, 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. +// +// parameters: +// enabled - If true, starts emitting lifecycle events. +func SetLifecycleEventsEnabled(enabled bool) *SetLifecycleEventsEnabledParams { + return &SetLifecycleEventsEnabledParams{ + Enabled: enabled, + } +} + +// Do executes Page.setLifecycleEventsEnabled against the provided context and +// target handler. +func (p *SetLifecycleEventsEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageSetLifecycleEventsEnabled, p, nil) +} + // StartScreencastParams starts sending each frame using the screencastFrame // event. type StartScreencastParams struct { @@ -764,6 +999,22 @@ func (p *StartScreencastParams) Do(ctxt context.Context, h cdp.Handler) (err err return h.Execute(ctxt, cdp.CommandPageStartScreencast, p, 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. +func StopLoading() *StopLoadingParams { + return &StopLoadingParams{} +} + +// Do executes Page.stopLoading against the provided context and +// target handler. +func (p *StopLoadingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPageStopLoading, nil, nil) +} + // StopScreencastParams stops sending each frame in the screencastFrame. type StopScreencastParams struct{} @@ -777,233 +1028,3 @@ func StopScreencast() *StopScreencastParams { func (p *StopScreencastParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandPageStopScreencast, nil, 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. -// -// parameters: -// sessionID - Frame number. -func ScreencastFrameAck(sessionID int64) *ScreencastFrameAckParams { - return &ScreencastFrameAckParams{ - SessionID: sessionID, - } -} - -// Do executes Page.screencastFrameAck against the provided context and -// target handler. -func (p *ScreencastFrameAckParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageScreencastFrameAck, p, 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). -// -// parameters: -// accept - Whether to accept or dismiss the dialog. -func HandleJavaScriptDialog(accept bool) *HandleJavaScriptDialogParams { - return &HandleJavaScriptDialogParams{ - Accept: accept, - } -} - -// WithPromptText the text to enter into the dialog prompt before accepting. -// Used only if this is a prompt dialog. -func (p HandleJavaScriptDialogParams) WithPromptText(promptText string) *HandleJavaScriptDialogParams { - p.PromptText = promptText - return &p -} - -// Do executes Page.handleJavaScriptDialog against the provided context and -// target handler. -func (p *HandleJavaScriptDialogParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageHandleJavaScriptDialog, p, nil) -} - -// GetAppManifestParams [no description]. -type GetAppManifestParams struct{} - -// GetAppManifest [no description]. -func GetAppManifest() *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. -} - -// Do executes Page.getAppManifest against the provided context and -// target handler. -// -// returns: -// url - Manifest location. -// errors -// data - Manifest content. -func (p *GetAppManifestParams) Do(ctxt context.Context, h cdp.Handler) (url string, errors []*AppManifestError, data string, err error) { - // execute - var res GetAppManifestReturns - err = h.Execute(ctxt, cdp.CommandPageGetAppManifest, nil, &res) - if err != nil { - return "", nil, "", err - } - - return res.URL, res.Errors, res.Data, nil -} - -// RequestAppBannerParams [no description]. -type RequestAppBannerParams struct{} - -// RequestAppBanner [no description]. -func RequestAppBanner() *RequestAppBannerParams { - return &RequestAppBannerParams{} -} - -// Do executes Page.requestAppBanner against the provided context and -// target handler. -func (p *RequestAppBannerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageRequestAppBanner, nil, 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. -func GetLayoutMetrics() *GetLayoutMetricsParams { - return &GetLayoutMetricsParams{} -} - -// GetLayoutMetricsReturns return values. -type GetLayoutMetricsReturns struct { - LayoutViewport *LayoutViewport `json:"layoutViewport,omitempty"` // Metrics relating to the layout viewport. - VisualViewport *VisualViewport `json:"visualViewport,omitempty"` // Metrics relating to the visual viewport. - ContentSize *dom.Rect `json:"contentSize,omitempty"` // Size of scrollable area. -} - -// Do executes Page.getLayoutMetrics against the provided context and -// target handler. -// -// returns: -// layoutViewport - Metrics relating to the layout viewport. -// visualViewport - Metrics relating to the visual viewport. -// contentSize - Size of scrollable area. -func (p *GetLayoutMetricsParams) Do(ctxt context.Context, h cdp.Handler) (layoutViewport *LayoutViewport, visualViewport *VisualViewport, contentSize *dom.Rect, err error) { - // execute - var res GetLayoutMetricsReturns - err = h.Execute(ctxt, cdp.CommandPageGetLayoutMetrics, nil, &res) - if err != nil { - return nil, nil, nil, err - } - - return res.LayoutViewport, res.VisualViewport, res.ContentSize, 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. -// -// parameters: -// frameID - Id of the frame in which the isolated world should be created. -func CreateIsolatedWorld(frameID cdp.FrameID) *CreateIsolatedWorldParams { - return &CreateIsolatedWorldParams{ - FrameID: frameID, - } -} - -// WithWorldName an optional name which is reported in the Execution Context. -func (p CreateIsolatedWorldParams) WithWorldName(worldName string) *CreateIsolatedWorldParams { - p.WorldName = worldName - return &p -} - -// WithGrantUniveralAccess whether or not universal access should be granted -// to the isolated world. This is a powerful option, use with caution. -func (p CreateIsolatedWorldParams) WithGrantUniveralAccess(grantUniveralAccess bool) *CreateIsolatedWorldParams { - p.GrantUniveralAccess = grantUniveralAccess - return &p -} - -// 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 and -// target handler. -// -// returns: -// executionContextID - Execution context of the isolated world. -func (p *CreateIsolatedWorldParams) Do(ctxt context.Context, h cdp.Handler) (executionContextID runtime.ExecutionContextID, err error) { - // execute - var res CreateIsolatedWorldReturns - err = h.Execute(ctxt, cdp.CommandPageCreateIsolatedWorld, p, &res) - if err != nil { - return 0, err - } - - return res.ExecutionContextID, nil -} - -// BringToFrontParams brings page to front (activates tab). -type BringToFrontParams struct{} - -// BringToFront brings page to front (activates tab). -func BringToFront() *BringToFrontParams { - return &BringToFrontParams{} -} - -// Do executes Page.bringToFront against the provided context and -// target handler. -func (p *BringToFrontParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageBringToFront, nil, nil) -} - -// SetDownloadBehaviorParams set the behavior when downloading a file. -type SetDownloadBehaviorParams struct { - Behavior SetDownloadBehaviorBehavior `json:"behavior"` // Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). - DownloadPath string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow' -} - -// SetDownloadBehavior set the behavior when downloading a file. -// -// parameters: -// behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). -func SetDownloadBehavior(behavior SetDownloadBehaviorBehavior) *SetDownloadBehaviorParams { - return &SetDownloadBehaviorParams{ - Behavior: behavior, - } -} - -// WithDownloadPath the default path to save downloaded files to. This is -// required if behavior is set to 'allow'. -func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDownloadBehaviorParams { - p.DownloadPath = downloadPath - return &p -} - -// Do executes Page.setDownloadBehavior against the provided context and -// target handler. -func (p *SetDownloadBehaviorParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPageSetDownloadBehavior, p, nil) -} diff --git a/cdp/page/types.go b/cdp/page/types.go index 255f109..89a7a7a 100644 --- a/cdp/page/types.go +++ b/cdp/page/types.go @@ -394,48 +394,6 @@ func (t *CaptureScreenshotFormat) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } -// ScreencastFormat image compression format. -type ScreencastFormat string - -// String returns the ScreencastFormat as string value. -func (t ScreencastFormat) String() string { - return string(t) -} - -// ScreencastFormat values. -const ( - ScreencastFormatJpeg ScreencastFormat = "jpeg" - ScreencastFormatPng ScreencastFormat = "png" -) - -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t ScreencastFormat) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t ScreencastFormat) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *ScreencastFormat) UnmarshalEasyJSON(in *jlexer.Lexer) { - switch ScreencastFormat(in.String()) { - case ScreencastFormatJpeg: - *t = ScreencastFormatJpeg - case ScreencastFormatPng: - *t = ScreencastFormatPng - - default: - in.AddError(errors.New("unknown ScreencastFormat value")) - } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *ScreencastFormat) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} - // SetDownloadBehaviorBehavior whether to allow all or deny all download // requests, or use default Chrome behavior if available (otherwise deny). type SetDownloadBehaviorBehavior string @@ -481,3 +439,45 @@ func (t *SetDownloadBehaviorBehavior) UnmarshalEasyJSON(in *jlexer.Lexer) { func (t *SetDownloadBehaviorBehavior) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } + +// ScreencastFormat image compression format. +type ScreencastFormat string + +// String returns the ScreencastFormat as string value. +func (t ScreencastFormat) String() string { + return string(t) +} + +// ScreencastFormat values. +const ( + ScreencastFormatJpeg ScreencastFormat = "jpeg" + ScreencastFormatPng ScreencastFormat = "png" +) + +// MarshalEasyJSON satisfies easyjson.Marshaler. +func (t ScreencastFormat) MarshalEasyJSON(out *jwriter.Writer) { + out.String(string(t)) +} + +// MarshalJSON satisfies json.Marshaler. +func (t ScreencastFormat) MarshalJSON() ([]byte, error) { + return easyjson.Marshal(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *ScreencastFormat) UnmarshalEasyJSON(in *jlexer.Lexer) { + switch ScreencastFormat(in.String()) { + case ScreencastFormatJpeg: + *t = ScreencastFormatJpeg + case ScreencastFormatPng: + *t = ScreencastFormatPng + + default: + in.AddError(errors.New("unknown ScreencastFormat value")) + } +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *ScreencastFormat) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} diff --git a/cdp/performance/performance.go b/cdp/performance/performance.go index 4370597..63d33bd 100644 --- a/cdp/performance/performance.go +++ b/cdp/performance/performance.go @@ -12,20 +12,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EnableParams enable collecting and reporting metrics. -type EnableParams struct{} - -// Enable enable collecting and reporting metrics. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Performance.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandPerformanceEnable, nil, nil) -} - // DisableParams disable collecting and reporting metrics. type DisableParams struct{} @@ -40,6 +26,20 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandPerformanceDisable, nil, nil) } +// EnableParams enable collecting and reporting metrics. +type EnableParams struct{} + +// Enable enable collecting and reporting metrics. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes Performance.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandPerformanceEnable, nil, nil) +} + // GetMetricsParams retrieve current values of run-time metrics. type GetMetricsParams struct{} diff --git a/cdp/profiler/events.go b/cdp/profiler/events.go index b4a37c9..c299216 100644 --- a/cdp/profiler/events.go +++ b/cdp/profiler/events.go @@ -7,14 +7,6 @@ import ( "github.com/knq/chromedp/cdp/debugger" ) -// EventConsoleProfileStarted sent when new profile recording is started -// using console.profile() call. -type EventConsoleProfileStarted struct { - ID string `json:"id"` - Location *debugger.Location `json:"location"` // Location of console.profile(). - Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile(). -} - // EventConsoleProfileFinished [no description]. type EventConsoleProfileFinished struct { ID string `json:"id"` @@ -23,8 +15,16 @@ type EventConsoleProfileFinished struct { Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile(). } +// EventConsoleProfileStarted sent when new profile recording is started +// using console.profile() call. +type EventConsoleProfileStarted struct { + ID string `json:"id"` + Location *debugger.Location `json:"location"` // Location of console.profile(). + Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile(). +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventProfilerConsoleProfileStarted, cdp.EventProfilerConsoleProfileFinished, + cdp.EventProfilerConsoleProfileStarted, } diff --git a/cdp/profiler/profiler.go b/cdp/profiler/profiler.go index 26a59c0..24a1c3d 100644 --- a/cdp/profiler/profiler.go +++ b/cdp/profiler/profiler.go @@ -12,6 +12,20 @@ import ( cdp "github.com/knq/chromedp/cdp" ) +// DisableParams [no description]. +type DisableParams struct{} + +// Disable [no description]. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes Profiler.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandProfilerDisable, nil, nil) +} + // EnableParams [no description]. type EnableParams struct{} @@ -26,18 +40,35 @@ func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandProfilerEnable, nil, nil) } -// DisableParams [no description]. -type DisableParams struct{} +// GetBestEffortCoverageParams collect coverage data for the current isolate. +// The coverage data may be incomplete due to garbage collection. +type GetBestEffortCoverageParams struct{} -// Disable [no description]. -func Disable() *DisableParams { - return &DisableParams{} +// GetBestEffortCoverage collect coverage data for the current isolate. The +// coverage data may be incomplete due to garbage collection. +func GetBestEffortCoverage() *GetBestEffortCoverageParams { + return &GetBestEffortCoverageParams{} } -// Do executes Profiler.disable against the provided context and +// GetBestEffortCoverageReturns return values. +type GetBestEffortCoverageReturns struct { + Result []*ScriptCoverage `json:"result,omitempty"` // Coverage data for the current isolate. +} + +// Do executes Profiler.getBestEffortCoverage against the provided context and // target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandProfilerDisable, nil, nil) +// +// returns: +// result - Coverage data for the current isolate. +func (p *GetBestEffortCoverageParams) Do(ctxt context.Context, h cdp.Handler) (result []*ScriptCoverage, err error) { + // execute + var res GetBestEffortCoverageReturns + err = h.Execute(ctxt, cdp.CommandProfilerGetBestEffortCoverage, nil, &res) + if err != nil { + return nil, err + } + + return res.Result, nil } // SetSamplingIntervalParams changes CPU profiler sampling interval. Must be @@ -77,35 +108,6 @@ func (p *StartParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandProfilerStart, nil, nil) } -// StopParams [no description]. -type StopParams struct{} - -// Stop [no description]. -func Stop() *StopParams { - return &StopParams{} -} - -// StopReturns return values. -type StopReturns struct { - Profile *Profile `json:"profile,omitempty"` // Recorded profile. -} - -// Do executes Profiler.stop against the provided context and -// target handler. -// -// returns: -// profile - Recorded profile. -func (p *StopParams) Do(ctxt context.Context, h cdp.Handler) (profile *Profile, err error) { - // execute - var res StopReturns - err = h.Execute(ctxt, cdp.CommandProfilerStop, nil, &res) - if err != nil { - return nil, err - } - - return res.Profile, nil -} - // StartPreciseCoverageParams enable precise code coverage. Coverage data for // JavaScript executed before enabling precise code coverage may be incomplete. // Enabling prevents running optimized code and resets execution counters. @@ -142,6 +144,49 @@ func (p *StartPreciseCoverageParams) Do(ctxt context.Context, h cdp.Handler) (er return h.Execute(ctxt, cdp.CommandProfilerStartPreciseCoverage, p, nil) } +// StartTypeProfileParams enable type profile. +type StartTypeProfileParams struct{} + +// StartTypeProfile enable type profile. +func StartTypeProfile() *StartTypeProfileParams { + return &StartTypeProfileParams{} +} + +// Do executes Profiler.startTypeProfile against the provided context and +// target handler. +func (p *StartTypeProfileParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandProfilerStartTypeProfile, nil, nil) +} + +// StopParams [no description]. +type StopParams struct{} + +// Stop [no description]. +func Stop() *StopParams { + return &StopParams{} +} + +// StopReturns return values. +type StopReturns struct { + Profile *Profile `json:"profile,omitempty"` // Recorded profile. +} + +// Do executes Profiler.stop against the provided context and +// target handler. +// +// returns: +// profile - Recorded profile. +func (p *StopParams) Do(ctxt context.Context, h cdp.Handler) (profile *Profile, err error) { + // execute + var res StopReturns + err = h.Execute(ctxt, cdp.CommandProfilerStop, nil, &res) + if err != nil { + return nil, err + } + + return res.Profile, nil +} + // StopPreciseCoverageParams disable precise code coverage. Disabling // releases unnecessary execution count records and allows executing optimized // code. @@ -159,6 +204,22 @@ func (p *StopPreciseCoverageParams) Do(ctxt context.Context, h cdp.Handler) (err return h.Execute(ctxt, cdp.CommandProfilerStopPreciseCoverage, nil, nil) } +// StopTypeProfileParams disable type profile. Disabling releases type +// profile data collected so far. +type StopTypeProfileParams struct{} + +// StopTypeProfile disable type profile. Disabling releases type profile data +// collected so far. +func StopTypeProfile() *StopTypeProfileParams { + return &StopTypeProfileParams{} +} + +// Do executes Profiler.stopTypeProfile against the provided context and +// target handler. +func (p *StopTypeProfileParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandProfilerStopTypeProfile, nil, nil) +} + // TakePreciseCoverageParams collect coverage data for the current isolate, // and resets execution counters. Precise code coverage needs to have started. type TakePreciseCoverageParams struct{} @@ -190,67 +251,6 @@ func (p *TakePreciseCoverageParams) Do(ctxt context.Context, h cdp.Handler) (res return res.Result, nil } -// GetBestEffortCoverageParams collect coverage data for the current isolate. -// The coverage data may be incomplete due to garbage collection. -type GetBestEffortCoverageParams struct{} - -// GetBestEffortCoverage collect coverage data for the current isolate. The -// coverage data may be incomplete due to garbage collection. -func GetBestEffortCoverage() *GetBestEffortCoverageParams { - return &GetBestEffortCoverageParams{} -} - -// GetBestEffortCoverageReturns return values. -type GetBestEffortCoverageReturns struct { - Result []*ScriptCoverage `json:"result,omitempty"` // Coverage data for the current isolate. -} - -// Do executes Profiler.getBestEffortCoverage against the provided context and -// target handler. -// -// returns: -// result - Coverage data for the current isolate. -func (p *GetBestEffortCoverageParams) Do(ctxt context.Context, h cdp.Handler) (result []*ScriptCoverage, err error) { - // execute - var res GetBestEffortCoverageReturns - err = h.Execute(ctxt, cdp.CommandProfilerGetBestEffortCoverage, nil, &res) - if err != nil { - return nil, err - } - - return res.Result, nil -} - -// StartTypeProfileParams enable type profile. -type StartTypeProfileParams struct{} - -// StartTypeProfile enable type profile. -func StartTypeProfile() *StartTypeProfileParams { - return &StartTypeProfileParams{} -} - -// Do executes Profiler.startTypeProfile against the provided context and -// target handler. -func (p *StartTypeProfileParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandProfilerStartTypeProfile, nil, nil) -} - -// StopTypeProfileParams disable type profile. Disabling releases type -// profile data collected so far. -type StopTypeProfileParams struct{} - -// StopTypeProfile disable type profile. Disabling releases type profile data -// collected so far. -func StopTypeProfile() *StopTypeProfileParams { - return &StopTypeProfileParams{} -} - -// Do executes Profiler.stopTypeProfile against the provided context and -// target handler. -func (p *StopTypeProfileParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandProfilerStopTypeProfile, nil, nil) -} - // TakeTypeProfileParams collect type profile. type TakeTypeProfileParams struct{} diff --git a/cdp/runtime/events.go b/cdp/runtime/events.go index a7fc627..c0c54c2 100644 --- a/cdp/runtime/events.go +++ b/cdp/runtime/events.go @@ -7,6 +7,28 @@ import ( "github.com/mailru/easyjson" ) +// EventConsoleAPICalled issued when console API was called. +type EventConsoleAPICalled struct { + Type APIType `json:"type"` // Type of the call. + Args []*RemoteObject `json:"args"` // Call arguments. + ExecutionContextID ExecutionContextID `json:"executionContextId"` // Identifier of the context where the call was made. + Timestamp *Timestamp `json:"timestamp"` // Call timestamp. + StackTrace *StackTrace `json:"stackTrace,omitempty"` // Stack trace captured when the call was made. + Context string `json:"context,omitempty"` // Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. +} + +// EventExceptionRevoked issued when unhandled exception was revoked. +type EventExceptionRevoked struct { + Reason string `json:"reason"` // Reason describing why exception was revoked. + ExceptionID int64 `json:"exceptionId"` // The id of revoked exception, as reported in exceptionThrown. +} + +// EventExceptionThrown issued when exception was thrown and unhandled. +type EventExceptionThrown struct { + Timestamp *Timestamp `json:"timestamp"` // Timestamp of the exception. + ExceptionDetails *ExceptionDetails `json:"exceptionDetails"` +} + // EventExecutionContextCreated issued when new execution context is created. type EventExecutionContextCreated struct { Context *ExecutionContextDescription `json:"context"` // A newly created execution context. @@ -21,28 +43,6 @@ type EventExecutionContextDestroyed struct { // cleared in browser. type EventExecutionContextsCleared struct{} -// EventExceptionThrown issued when exception was thrown and unhandled. -type EventExceptionThrown struct { - Timestamp *Timestamp `json:"timestamp"` // Timestamp of the exception. - ExceptionDetails *ExceptionDetails `json:"exceptionDetails"` -} - -// EventExceptionRevoked issued when unhandled exception was revoked. -type EventExceptionRevoked struct { - Reason string `json:"reason"` // Reason describing why exception was revoked. - ExceptionID int64 `json:"exceptionId"` // The id of revoked exception, as reported in exceptionThrown. -} - -// EventConsoleAPICalled issued when console API was called. -type EventConsoleAPICalled struct { - Type APIType `json:"type"` // Type of the call. - Args []*RemoteObject `json:"args"` // Call arguments. - ExecutionContextID ExecutionContextID `json:"executionContextId"` // Identifier of the context where the call was made. - Timestamp *Timestamp `json:"timestamp"` // Call timestamp. - StackTrace *StackTrace `json:"stackTrace,omitempty"` // Stack trace captured when the call was made. - Context string `json:"context,omitempty"` // Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. -} - // EventInspectRequested issued when object should be inspected (for example, // as a result of inspect() command line API call). type EventInspectRequested struct { @@ -52,11 +52,11 @@ type EventInspectRequested struct { // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ + cdp.EventRuntimeConsoleAPICalled, + cdp.EventRuntimeExceptionRevoked, + cdp.EventRuntimeExceptionThrown, cdp.EventRuntimeExecutionContextCreated, cdp.EventRuntimeExecutionContextDestroyed, cdp.EventRuntimeExecutionContextsCleared, - cdp.EventRuntimeExceptionThrown, - cdp.EventRuntimeExceptionRevoked, - cdp.EventRuntimeConsoleAPICalled, cdp.EventRuntimeInspectRequested, } diff --git a/cdp/runtime/runtime.go b/cdp/runtime/runtime.go index a0d3bb2..d60e6ac 100644 --- a/cdp/runtime/runtime.go +++ b/cdp/runtime/runtime.go @@ -19,108 +19,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EvaluateParams evaluates expression on global object. -type EvaluateParams struct { - Expression string `json:"expression"` // Expression to evaluate. - ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. - IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"` // Determines whether Command Line API should be available during the evaluation. - Silent bool `json:"silent,omitempty"` // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - ContextID ExecutionContextID `json:"contextId,omitempty"` // Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - ReturnByValue bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object that should be sent by value. - GeneratePreview bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result. - UserGesture bool `json:"userGesture,omitempty"` // Whether execution should be treated as initiated by user in the UI. - AwaitPromise bool `json:"awaitPromise,omitempty"` // Whether execution should await for resulting value and return once awaited promise is resolved. -} - -// Evaluate evaluates expression on global object. -// -// parameters: -// expression - Expression to evaluate. -func Evaluate(expression string) *EvaluateParams { - return &EvaluateParams{ - Expression: expression, - } -} - -// WithObjectGroup symbolic group name that can be used to release multiple -// objects. -func (p EvaluateParams) WithObjectGroup(objectGroup string) *EvaluateParams { - p.ObjectGroup = objectGroup - return &p -} - -// WithIncludeCommandLineAPI determines whether Command Line API should be -// available during the evaluation. -func (p EvaluateParams) WithIncludeCommandLineAPI(includeCommandLineAPI bool) *EvaluateParams { - p.IncludeCommandLineAPI = includeCommandLineAPI - return &p -} - -// WithSilent in silent mode exceptions thrown during evaluation are not -// reported and do not pause execution. Overrides setPauseOnException state. -func (p EvaluateParams) WithSilent(silent bool) *EvaluateParams { - p.Silent = silent - return &p -} - -// WithContextID specifies in which execution context to perform evaluation. -// If the parameter is omitted the evaluation will be performed in the context -// of the inspected page. -func (p EvaluateParams) WithContextID(contextID ExecutionContextID) *EvaluateParams { - p.ContextID = contextID - return &p -} - -// WithReturnByValue whether the result is expected to be a JSON object that -// should be sent by value. -func (p EvaluateParams) WithReturnByValue(returnByValue bool) *EvaluateParams { - p.ReturnByValue = returnByValue - return &p -} - -// WithGeneratePreview whether preview should be generated for the result. -func (p EvaluateParams) WithGeneratePreview(generatePreview bool) *EvaluateParams { - p.GeneratePreview = generatePreview - return &p -} - -// WithUserGesture whether execution should be treated as initiated by user -// in the UI. -func (p EvaluateParams) WithUserGesture(userGesture bool) *EvaluateParams { - p.UserGesture = userGesture - return &p -} - -// WithAwaitPromise whether execution should await for resulting value and -// return once awaited promise is resolved. -func (p EvaluateParams) WithAwaitPromise(awaitPromise bool) *EvaluateParams { - p.AwaitPromise = awaitPromise - return &p -} - -// EvaluateReturns return values. -type EvaluateReturns struct { - Result *RemoteObject `json:"result,omitempty"` // Evaluation result. - ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. -} - -// Do executes Runtime.evaluate against the provided context and -// target handler. -// -// returns: -// result - Evaluation result. -// exceptionDetails - Exception details. -func (p *EvaluateParams) Do(ctxt context.Context, h cdp.Handler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) { - // execute - var res EvaluateReturns - err = h.Execute(ctxt, cdp.CommandRuntimeEvaluate, p, &res) - if err != nil { - return nil, nil, err - } - - return res.Result, res.ExceptionDetails, nil -} - // AwaitPromiseParams add handler to promise with given promise object id. type AwaitPromiseParams struct { PromiseObjectID RemoteObjectID `json:"promiseObjectId"` // Identifier of the promise. @@ -287,6 +185,208 @@ func (p *CallFunctionOnParams) Do(ctxt context.Context, h cdp.Handler) (result * return res.Result, res.ExceptionDetails, nil } +// CompileScriptParams compiles expression. +type CompileScriptParams struct { + Expression string `json:"expression"` // Expression to compile. + SourceURL string `json:"sourceURL"` // Source url to be set for the script. + PersistScript bool `json:"persistScript"` // Specifies whether the compiled script should be persisted. + ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. +} + +// CompileScript compiles expression. +// +// parameters: +// expression - Expression to compile. +// sourceURL - Source url to be set for the script. +// persistScript - Specifies whether the compiled script should be persisted. +func CompileScript(expression string, sourceURL string, persistScript bool) *CompileScriptParams { + return &CompileScriptParams{ + Expression: expression, + SourceURL: sourceURL, + PersistScript: persistScript, + } +} + +// WithExecutionContextID specifies in which execution context to perform +// script run. If the parameter is omitted the evaluation will be performed in +// the context of the inspected page. +func (p CompileScriptParams) WithExecutionContextID(executionContextID ExecutionContextID) *CompileScriptParams { + p.ExecutionContextID = executionContextID + return &p +} + +// CompileScriptReturns return values. +type CompileScriptReturns struct { + ScriptID ScriptID `json:"scriptId,omitempty"` // Id of the script. + ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. +} + +// Do executes Runtime.compileScript against the provided context and +// target handler. +// +// returns: +// scriptID - Id of the script. +// exceptionDetails - Exception details. +func (p *CompileScriptParams) Do(ctxt context.Context, h cdp.Handler) (scriptID ScriptID, exceptionDetails *ExceptionDetails, err error) { + // execute + var res CompileScriptReturns + err = h.Execute(ctxt, cdp.CommandRuntimeCompileScript, p, &res) + if err != nil { + return "", nil, err + } + + return res.ScriptID, res.ExceptionDetails, nil +} + +// DisableParams disables reporting of execution contexts creation. +type DisableParams struct{} + +// Disable disables reporting of execution contexts creation. +func Disable() *DisableParams { + return &DisableParams{} +} + +// Do executes Runtime.disable against the provided context and +// target handler. +func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandRuntimeDisable, nil, nil) +} + +// DiscardConsoleEntriesParams discards collected exceptions and console API +// calls. +type DiscardConsoleEntriesParams struct{} + +// DiscardConsoleEntries discards collected exceptions and console API calls. +func DiscardConsoleEntries() *DiscardConsoleEntriesParams { + return &DiscardConsoleEntriesParams{} +} + +// Do executes Runtime.discardConsoleEntries against the provided context and +// target handler. +func (p *DiscardConsoleEntriesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandRuntimeDiscardConsoleEntries, nil, nil) +} + +// EnableParams enables reporting of execution contexts creation by means of +// executionContextCreated event. When the reporting gets enabled the event will +// be sent immediately for each existing execution context. +type EnableParams struct{} + +// Enable enables reporting of execution contexts creation by means of +// executionContextCreated event. When the reporting gets enabled the event will +// be sent immediately for each existing execution context. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes Runtime.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandRuntimeEnable, nil, nil) +} + +// EvaluateParams evaluates expression on global object. +type EvaluateParams struct { + Expression string `json:"expression"` // Expression to evaluate. + ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects. + IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"` // Determines whether Command Line API should be available during the evaluation. + Silent bool `json:"silent,omitempty"` // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + ContextID ExecutionContextID `json:"contextId,omitempty"` // Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + ReturnByValue bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object that should be sent by value. + GeneratePreview bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result. + UserGesture bool `json:"userGesture,omitempty"` // Whether execution should be treated as initiated by user in the UI. + AwaitPromise bool `json:"awaitPromise,omitempty"` // Whether execution should await for resulting value and return once awaited promise is resolved. +} + +// Evaluate evaluates expression on global object. +// +// parameters: +// expression - Expression to evaluate. +func Evaluate(expression string) *EvaluateParams { + return &EvaluateParams{ + Expression: expression, + } +} + +// WithObjectGroup symbolic group name that can be used to release multiple +// objects. +func (p EvaluateParams) WithObjectGroup(objectGroup string) *EvaluateParams { + p.ObjectGroup = objectGroup + return &p +} + +// WithIncludeCommandLineAPI determines whether Command Line API should be +// available during the evaluation. +func (p EvaluateParams) WithIncludeCommandLineAPI(includeCommandLineAPI bool) *EvaluateParams { + p.IncludeCommandLineAPI = includeCommandLineAPI + return &p +} + +// WithSilent in silent mode exceptions thrown during evaluation are not +// reported and do not pause execution. Overrides setPauseOnException state. +func (p EvaluateParams) WithSilent(silent bool) *EvaluateParams { + p.Silent = silent + return &p +} + +// WithContextID specifies in which execution context to perform evaluation. +// If the parameter is omitted the evaluation will be performed in the context +// of the inspected page. +func (p EvaluateParams) WithContextID(contextID ExecutionContextID) *EvaluateParams { + p.ContextID = contextID + return &p +} + +// WithReturnByValue whether the result is expected to be a JSON object that +// should be sent by value. +func (p EvaluateParams) WithReturnByValue(returnByValue bool) *EvaluateParams { + p.ReturnByValue = returnByValue + return &p +} + +// WithGeneratePreview whether preview should be generated for the result. +func (p EvaluateParams) WithGeneratePreview(generatePreview bool) *EvaluateParams { + p.GeneratePreview = generatePreview + return &p +} + +// WithUserGesture whether execution should be treated as initiated by user +// in the UI. +func (p EvaluateParams) WithUserGesture(userGesture bool) *EvaluateParams { + p.UserGesture = userGesture + return &p +} + +// WithAwaitPromise whether execution should await for resulting value and +// return once awaited promise is resolved. +func (p EvaluateParams) WithAwaitPromise(awaitPromise bool) *EvaluateParams { + p.AwaitPromise = awaitPromise + return &p +} + +// EvaluateReturns return values. +type EvaluateReturns struct { + Result *RemoteObject `json:"result,omitempty"` // Evaluation result. + ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. +} + +// Do executes Runtime.evaluate against the provided context and +// target handler. +// +// returns: +// result - Evaluation result. +// exceptionDetails - Exception details. +func (p *EvaluateParams) Do(ctxt context.Context, h cdp.Handler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) { + // execute + var res EvaluateReturns + err = h.Execute(ctxt, cdp.CommandRuntimeEvaluate, p, &res) + if err != nil { + return nil, nil, err + } + + return res.Result, res.ExceptionDetails, nil +} + // GetPropertiesParams returns properties of a given object. Object group of // the result is inherited from the target object. type GetPropertiesParams struct { @@ -352,6 +452,84 @@ func (p *GetPropertiesParams) Do(ctxt context.Context, h cdp.Handler) (result [] return res.Result, res.InternalProperties, res.ExceptionDetails, nil } +// GlobalLexicalScopeNamesParams returns all let, const and class variables +// from global scope. +type GlobalLexicalScopeNamesParams struct { + ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Specifies in which execution context to lookup global scope variables. +} + +// GlobalLexicalScopeNames returns all let, const and class variables from +// global scope. +// +// parameters: +func GlobalLexicalScopeNames() *GlobalLexicalScopeNamesParams { + return &GlobalLexicalScopeNamesParams{} +} + +// WithExecutionContextID specifies in which execution context to lookup +// global scope variables. +func (p GlobalLexicalScopeNamesParams) WithExecutionContextID(executionContextID ExecutionContextID) *GlobalLexicalScopeNamesParams { + p.ExecutionContextID = executionContextID + return &p +} + +// GlobalLexicalScopeNamesReturns return values. +type GlobalLexicalScopeNamesReturns struct { + Names []string `json:"names,omitempty"` +} + +// Do executes Runtime.globalLexicalScopeNames against the provided context and +// target handler. +// +// returns: +// names +func (p *GlobalLexicalScopeNamesParams) Do(ctxt context.Context, h cdp.Handler) (names []string, err error) { + // execute + var res GlobalLexicalScopeNamesReturns + err = h.Execute(ctxt, cdp.CommandRuntimeGlobalLexicalScopeNames, p, &res) + if err != nil { + return nil, err + } + + return res.Names, nil +} + +// QueryObjectsParams [no description]. +type QueryObjectsParams struct { + PrototypeObjectID RemoteObjectID `json:"prototypeObjectId"` // Identifier of the prototype to return objects for. +} + +// QueryObjects [no description]. +// +// parameters: +// prototypeObjectID - Identifier of the prototype to return objects for. +func QueryObjects(prototypeObjectID RemoteObjectID) *QueryObjectsParams { + return &QueryObjectsParams{ + PrototypeObjectID: prototypeObjectID, + } +} + +// QueryObjectsReturns return values. +type QueryObjectsReturns struct { + Objects *RemoteObject `json:"objects,omitempty"` // Array with objects. +} + +// Do executes Runtime.queryObjects against the provided context and +// target handler. +// +// returns: +// objects - Array with objects. +func (p *QueryObjectsParams) Do(ctxt context.Context, h cdp.Handler) (objects *RemoteObject, err error) { + // execute + var res QueryObjectsReturns + err = h.Execute(ctxt, cdp.CommandRuntimeQueryObjects, p, &res) + if err != nil { + return nil, err + } + + return res.Objects, nil +} + // ReleaseObjectParams releases remote object with given id. type ReleaseObjectParams struct { ObjectID RemoteObjectID `json:"objectId"` // Identifier of the object to release. @@ -412,127 +590,6 @@ func (p *RunIfWaitingForDebuggerParams) Do(ctxt context.Context, h cdp.Handler) return h.Execute(ctxt, cdp.CommandRuntimeRunIfWaitingForDebugger, nil, nil) } -// EnableParams enables reporting of execution contexts creation by means of -// executionContextCreated event. When the reporting gets enabled the event will -// be sent immediately for each existing execution context. -type EnableParams struct{} - -// Enable enables reporting of execution contexts creation by means of -// executionContextCreated event. When the reporting gets enabled the event will -// be sent immediately for each existing execution context. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Runtime.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandRuntimeEnable, nil, nil) -} - -// DisableParams disables reporting of execution contexts creation. -type DisableParams struct{} - -// Disable disables reporting of execution contexts creation. -func Disable() *DisableParams { - return &DisableParams{} -} - -// Do executes Runtime.disable against the provided context and -// target handler. -func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandRuntimeDisable, nil, nil) -} - -// DiscardConsoleEntriesParams discards collected exceptions and console API -// calls. -type DiscardConsoleEntriesParams struct{} - -// DiscardConsoleEntries discards collected exceptions and console API calls. -func DiscardConsoleEntries() *DiscardConsoleEntriesParams { - return &DiscardConsoleEntriesParams{} -} - -// Do executes Runtime.discardConsoleEntries against the provided context and -// target handler. -func (p *DiscardConsoleEntriesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandRuntimeDiscardConsoleEntries, nil, nil) -} - -// SetCustomObjectFormatterEnabledParams [no description]. -type SetCustomObjectFormatterEnabledParams struct { - Enabled bool `json:"enabled"` -} - -// SetCustomObjectFormatterEnabled [no description]. -// -// parameters: -// enabled -func SetCustomObjectFormatterEnabled(enabled bool) *SetCustomObjectFormatterEnabledParams { - return &SetCustomObjectFormatterEnabledParams{ - Enabled: enabled, - } -} - -// Do executes Runtime.setCustomObjectFormatterEnabled against the provided context and -// target handler. -func (p *SetCustomObjectFormatterEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandRuntimeSetCustomObjectFormatterEnabled, p, nil) -} - -// CompileScriptParams compiles expression. -type CompileScriptParams struct { - Expression string `json:"expression"` // Expression to compile. - SourceURL string `json:"sourceURL"` // Source url to be set for the script. - PersistScript bool `json:"persistScript"` // Specifies whether the compiled script should be persisted. - ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. -} - -// CompileScript compiles expression. -// -// parameters: -// expression - Expression to compile. -// sourceURL - Source url to be set for the script. -// persistScript - Specifies whether the compiled script should be persisted. -func CompileScript(expression string, sourceURL string, persistScript bool) *CompileScriptParams { - return &CompileScriptParams{ - Expression: expression, - SourceURL: sourceURL, - PersistScript: persistScript, - } -} - -// WithExecutionContextID specifies in which execution context to perform -// script run. If the parameter is omitted the evaluation will be performed in -// the context of the inspected page. -func (p CompileScriptParams) WithExecutionContextID(executionContextID ExecutionContextID) *CompileScriptParams { - p.ExecutionContextID = executionContextID - return &p -} - -// CompileScriptReturns return values. -type CompileScriptReturns struct { - ScriptID ScriptID `json:"scriptId,omitempty"` // Id of the script. - ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details. -} - -// Do executes Runtime.compileScript against the provided context and -// target handler. -// -// returns: -// scriptID - Id of the script. -// exceptionDetails - Exception details. -func (p *CompileScriptParams) Do(ctxt context.Context, h cdp.Handler) (scriptID ScriptID, exceptionDetails *ExceptionDetails, err error) { - // execute - var res CompileScriptReturns - err = h.Execute(ctxt, cdp.CommandRuntimeCompileScript, p, &res) - if err != nil { - return "", nil, err - } - - return res.ScriptID, res.ExceptionDetails, nil -} - // RunScriptParams runs script with given id in a given context. type RunScriptParams struct { ScriptID ScriptID `json:"scriptId"` // Id of the script to run. @@ -627,80 +684,23 @@ func (p *RunScriptParams) Do(ctxt context.Context, h cdp.Handler) (result *Remot return res.Result, res.ExceptionDetails, nil } -// QueryObjectsParams [no description]. -type QueryObjectsParams struct { - PrototypeObjectID RemoteObjectID `json:"prototypeObjectId"` // Identifier of the prototype to return objects for. +// SetCustomObjectFormatterEnabledParams [no description]. +type SetCustomObjectFormatterEnabledParams struct { + Enabled bool `json:"enabled"` } -// QueryObjects [no description]. +// SetCustomObjectFormatterEnabled [no description]. // // parameters: -// prototypeObjectID - Identifier of the prototype to return objects for. -func QueryObjects(prototypeObjectID RemoteObjectID) *QueryObjectsParams { - return &QueryObjectsParams{ - PrototypeObjectID: prototypeObjectID, +// enabled +func SetCustomObjectFormatterEnabled(enabled bool) *SetCustomObjectFormatterEnabledParams { + return &SetCustomObjectFormatterEnabledParams{ + Enabled: enabled, } } -// QueryObjectsReturns return values. -type QueryObjectsReturns struct { - Objects *RemoteObject `json:"objects,omitempty"` // Array with objects. -} - -// Do executes Runtime.queryObjects against the provided context and +// Do executes Runtime.setCustomObjectFormatterEnabled against the provided context and // target handler. -// -// returns: -// objects - Array with objects. -func (p *QueryObjectsParams) Do(ctxt context.Context, h cdp.Handler) (objects *RemoteObject, err error) { - // execute - var res QueryObjectsReturns - err = h.Execute(ctxt, cdp.CommandRuntimeQueryObjects, p, &res) - if err != nil { - return nil, err - } - - return res.Objects, nil -} - -// GlobalLexicalScopeNamesParams returns all let, const and class variables -// from global scope. -type GlobalLexicalScopeNamesParams struct { - ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Specifies in which execution context to lookup global scope variables. -} - -// GlobalLexicalScopeNames returns all let, const and class variables from -// global scope. -// -// parameters: -func GlobalLexicalScopeNames() *GlobalLexicalScopeNamesParams { - return &GlobalLexicalScopeNamesParams{} -} - -// WithExecutionContextID specifies in which execution context to lookup -// global scope variables. -func (p GlobalLexicalScopeNamesParams) WithExecutionContextID(executionContextID ExecutionContextID) *GlobalLexicalScopeNamesParams { - p.ExecutionContextID = executionContextID - return &p -} - -// GlobalLexicalScopeNamesReturns return values. -type GlobalLexicalScopeNamesReturns struct { - Names []string `json:"names,omitempty"` -} - -// Do executes Runtime.globalLexicalScopeNames against the provided context and -// target handler. -// -// returns: -// names -func (p *GlobalLexicalScopeNamesParams) Do(ctxt context.Context, h cdp.Handler) (names []string, err error) { - // execute - var res GlobalLexicalScopeNamesReturns - err = h.Execute(ctxt, cdp.CommandRuntimeGlobalLexicalScopeNames, p, &res) - if err != nil { - return nil, err - } - - return res.Names, nil +func (p *SetCustomObjectFormatterEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandRuntimeSetCustomObjectFormatterEnabled, p, nil) } diff --git a/cdp/security/easyjson.go b/cdp/security/easyjson.go index 87da723..1bc2d8a 100644 --- a/cdp/security/easyjson.go +++ b/cdp/security/easyjson.go @@ -38,6 +38,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(in *jlexer.Lexer, out switch key { case "securityState": (out.SecurityState).UnmarshalEasyJSON(in) + case "title": + out.Title = string(in.String()) case "summary": out.Summary = string(in.String()) case "description": @@ -91,6 +93,16 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity(out *jwriter.Writer, } (in.SecurityState).MarshalEasyJSON(out) } + { + const prefix string = ",\"title\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Title)) + } { const prefix string = ",\"summary\":" if first { diff --git a/cdp/security/events.go b/cdp/security/events.go index 14c6c31..5f0230d 100644 --- a/cdp/security/events.go +++ b/cdp/security/events.go @@ -6,15 +6,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EventSecurityStateChanged the security state of the page changed. -type EventSecurityStateChanged struct { - SecurityState State `json:"securityState"` // Security state. - SchemeIsCryptographic bool `json:"schemeIsCryptographic"` // True if the page was loaded over cryptographic transport such as HTTPS. - 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. - InsecureContentStatus *InsecureContentStatus `json:"insecureContentStatus"` // Information about insecure content on the page. - Summary string `json:"summary,omitempty"` // Overrides user-visible description of the state. -} - // EventCertificateError there is a certificate error. If overriding // certificate errors is enabled, then it should be handled with the // handleCertificateError command. Note: this event does not fire if the @@ -25,8 +16,17 @@ type EventCertificateError struct { RequestURL string `json:"requestURL"` // The url that was requested. } +// EventSecurityStateChanged the security state of the page changed. +type EventSecurityStateChanged struct { + SecurityState State `json:"securityState"` // Security state. + SchemeIsCryptographic bool `json:"schemeIsCryptographic"` // True if the page was loaded over cryptographic transport such as HTTPS. + 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. + InsecureContentStatus *InsecureContentStatus `json:"insecureContentStatus"` // Information about insecure content on the page. + Summary string `json:"summary,omitempty"` // Overrides user-visible description of the state. +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventSecuritySecurityStateChanged, cdp.EventSecurityCertificateError, + cdp.EventSecuritySecurityStateChanged, } diff --git a/cdp/security/security.go b/cdp/security/security.go index bcdf43a..2fcd149 100644 --- a/cdp/security/security.go +++ b/cdp/security/security.go @@ -14,20 +14,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EnableParams enables tracking security state changes. -type EnableParams struct{} - -// Enable enables tracking security state changes. -func Enable() *EnableParams { - return &EnableParams{} -} - -// Do executes Security.enable against the provided context and -// target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandSecurityEnable, nil, nil) -} - // DisableParams disables tracking security state changes. type DisableParams struct{} @@ -42,6 +28,20 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandSecurityDisable, nil, nil) } +// EnableParams enables tracking security state changes. +type EnableParams struct{} + +// Enable enables tracking security state changes. +func Enable() *EnableParams { + return &EnableParams{} +} + +// Do executes Security.enable against the provided context and +// target handler. +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandSecurityEnable, nil, nil) +} + // HandleCertificateErrorParams handles a certificate error that fired a // certificateError event. type HandleCertificateErrorParams struct { diff --git a/cdp/security/types.go b/cdp/security/types.go index 182e3ba..4c56eb3 100644 --- a/cdp/security/types.go +++ b/cdp/security/types.go @@ -119,6 +119,7 @@ func (t *State) UnmarshalJSON(buf []byte) error { // state. type StateExplanation struct { SecurityState State `json:"securityState"` // Security state representing the severity of the factor being explained. + Title string `json:"title"` // Title describing the type of factor. Summary string `json:"summary"` // Short phrase describing the type of factor. Description string `json:"description"` // Full text explanation of the factor. MixedContentType MixedContentType `json:"mixedContentType"` // The type of mixed content described by the explanation. diff --git a/cdp/serviceworker/events.go b/cdp/serviceworker/events.go index 662a01a..164879c 100644 --- a/cdp/serviceworker/events.go +++ b/cdp/serviceworker/events.go @@ -6,6 +6,11 @@ import ( cdp "github.com/knq/chromedp/cdp" ) +// EventWorkerErrorReported [no description]. +type EventWorkerErrorReported struct { + ErrorMessage *ErrorMessage `json:"errorMessage"` +} + // EventWorkerRegistrationUpdated [no description]. type EventWorkerRegistrationUpdated struct { Registrations []*Registration `json:"registrations"` @@ -16,14 +21,9 @@ type EventWorkerVersionUpdated struct { Versions []*Version `json:"versions"` } -// EventWorkerErrorReported [no description]. -type EventWorkerErrorReported struct { - ErrorMessage *ErrorMessage `json:"errorMessage"` -} - // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ + cdp.EventServiceWorkerWorkerErrorReported, cdp.EventServiceWorkerWorkerRegistrationUpdated, cdp.EventServiceWorkerWorkerVersionUpdated, - cdp.EventServiceWorkerWorkerErrorReported, } diff --git a/cdp/serviceworker/serviceworker.go b/cdp/serviceworker/serviceworker.go index a9ccb28..a0fe0c7 100644 --- a/cdp/serviceworker/serviceworker.go +++ b/cdp/serviceworker/serviceworker.go @@ -12,18 +12,31 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EnableParams [no description]. -type EnableParams struct{} - -// Enable [no description]. -func Enable() *EnableParams { - return &EnableParams{} +// DeliverPushMessageParams [no description]. +type DeliverPushMessageParams struct { + Origin string `json:"origin"` + RegistrationID string `json:"registrationId"` + Data string `json:"data"` } -// Do executes ServiceWorker.enable against the provided context and +// DeliverPushMessage [no description]. +// +// parameters: +// origin +// registrationID +// data +func DeliverPushMessage(origin string, registrationID string, data string) *DeliverPushMessageParams { + return &DeliverPushMessageParams{ + Origin: origin, + RegistrationID: registrationID, + Data: data, + } +} + +// Do executes ServiceWorker.deliverPushMessage against the provided context and // target handler. -func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerEnable, nil, nil) +func (p *DeliverPushMessageParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerDeliverPushMessage, p, nil) } // DisableParams [no description]. @@ -40,123 +53,48 @@ func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { return h.Execute(ctxt, cdp.CommandServiceWorkerDisable, nil, nil) } -// UnregisterParams [no description]. -type UnregisterParams struct { - ScopeURL string `json:"scopeURL"` +// DispatchSyncEventParams [no description]. +type DispatchSyncEventParams struct { + Origin string `json:"origin"` + RegistrationID string `json:"registrationId"` + Tag string `json:"tag"` + LastChance bool `json:"lastChance"` } -// Unregister [no description]. +// DispatchSyncEvent [no description]. // // parameters: -// scopeURL -func Unregister(scopeURL string) *UnregisterParams { - return &UnregisterParams{ - ScopeURL: scopeURL, +// origin +// registrationID +// tag +// lastChance +func DispatchSyncEvent(origin string, registrationID string, tag string, lastChance bool) *DispatchSyncEventParams { + return &DispatchSyncEventParams{ + Origin: origin, + RegistrationID: registrationID, + Tag: tag, + LastChance: lastChance, } } -// Do executes ServiceWorker.unregister against the provided context and +// Do executes ServiceWorker.dispatchSyncEvent against the provided context and // target handler. -func (p *UnregisterParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerUnregister, p, nil) +func (p *DispatchSyncEventParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerDispatchSyncEvent, p, nil) } -// UpdateRegistrationParams [no description]. -type UpdateRegistrationParams struct { - ScopeURL string `json:"scopeURL"` +// EnableParams [no description]. +type EnableParams struct{} + +// Enable [no description]. +func Enable() *EnableParams { + return &EnableParams{} } -// UpdateRegistration [no description]. -// -// parameters: -// scopeURL -func UpdateRegistration(scopeURL string) *UpdateRegistrationParams { - return &UpdateRegistrationParams{ - ScopeURL: scopeURL, - } -} - -// Do executes ServiceWorker.updateRegistration against the provided context and +// Do executes ServiceWorker.enable against the provided context and // target handler. -func (p *UpdateRegistrationParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerUpdateRegistration, p, nil) -} - -// StartWorkerParams [no description]. -type StartWorkerParams struct { - ScopeURL string `json:"scopeURL"` -} - -// StartWorker [no description]. -// -// parameters: -// scopeURL -func StartWorker(scopeURL string) *StartWorkerParams { - return &StartWorkerParams{ - ScopeURL: scopeURL, - } -} - -// Do executes ServiceWorker.startWorker against the provided context and -// target handler. -func (p *StartWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerStartWorker, p, nil) -} - -// SkipWaitingParams [no description]. -type SkipWaitingParams struct { - ScopeURL string `json:"scopeURL"` -} - -// SkipWaiting [no description]. -// -// parameters: -// scopeURL -func SkipWaiting(scopeURL string) *SkipWaitingParams { - return &SkipWaitingParams{ - ScopeURL: scopeURL, - } -} - -// Do executes ServiceWorker.skipWaiting against the provided context and -// target handler. -func (p *SkipWaitingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerSkipWaiting, p, nil) -} - -// StopWorkerParams [no description]. -type StopWorkerParams struct { - VersionID string `json:"versionId"` -} - -// StopWorker [no description]. -// -// parameters: -// versionID -func StopWorker(versionID string) *StopWorkerParams { - return &StopWorkerParams{ - VersionID: versionID, - } -} - -// Do executes ServiceWorker.stopWorker against the provided context and -// target handler. -func (p *StopWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerStopWorker, p, nil) -} - -// StopAllWorkersParams [no description]. -type StopAllWorkersParams struct{} - -// StopAllWorkers [no description]. -func StopAllWorkers() *StopAllWorkersParams { - return &StopAllWorkersParams{} -} - -// Do executes ServiceWorker.stopAllWorkers against the provided context and -// target handler. -func (p *StopAllWorkersParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerStopAllWorkers, nil, nil) +func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerEnable, nil, nil) } // InspectWorkerParams [no description]. @@ -201,59 +139,121 @@ func (p *SetForceUpdateOnPageLoadParams) Do(ctxt context.Context, h cdp.Handler) return h.Execute(ctxt, cdp.CommandServiceWorkerSetForceUpdateOnPageLoad, p, nil) } -// DeliverPushMessageParams [no description]. -type DeliverPushMessageParams struct { - Origin string `json:"origin"` - RegistrationID string `json:"registrationId"` - Data string `json:"data"` +// SkipWaitingParams [no description]. +type SkipWaitingParams struct { + ScopeURL string `json:"scopeURL"` } -// DeliverPushMessage [no description]. +// SkipWaiting [no description]. // // parameters: -// origin -// registrationID -// data -func DeliverPushMessage(origin string, registrationID string, data string) *DeliverPushMessageParams { - return &DeliverPushMessageParams{ - Origin: origin, - RegistrationID: registrationID, - Data: data, +// scopeURL +func SkipWaiting(scopeURL string) *SkipWaitingParams { + return &SkipWaitingParams{ + ScopeURL: scopeURL, } } -// Do executes ServiceWorker.deliverPushMessage against the provided context and +// Do executes ServiceWorker.skipWaiting against the provided context and // target handler. -func (p *DeliverPushMessageParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerDeliverPushMessage, p, nil) +func (p *SkipWaitingParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerSkipWaiting, p, nil) } -// DispatchSyncEventParams [no description]. -type DispatchSyncEventParams struct { - Origin string `json:"origin"` - RegistrationID string `json:"registrationId"` - Tag string `json:"tag"` - LastChance bool `json:"lastChance"` +// StartWorkerParams [no description]. +type StartWorkerParams struct { + ScopeURL string `json:"scopeURL"` } -// DispatchSyncEvent [no description]. +// StartWorker [no description]. // // parameters: -// origin -// registrationID -// tag -// lastChance -func DispatchSyncEvent(origin string, registrationID string, tag string, lastChance bool) *DispatchSyncEventParams { - return &DispatchSyncEventParams{ - Origin: origin, - RegistrationID: registrationID, - Tag: tag, - LastChance: lastChance, +// scopeURL +func StartWorker(scopeURL string) *StartWorkerParams { + return &StartWorkerParams{ + ScopeURL: scopeURL, } } -// Do executes ServiceWorker.dispatchSyncEvent against the provided context and +// Do executes ServiceWorker.startWorker against the provided context and // target handler. -func (p *DispatchSyncEventParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandServiceWorkerDispatchSyncEvent, p, nil) +func (p *StartWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerStartWorker, p, nil) +} + +// StopAllWorkersParams [no description]. +type StopAllWorkersParams struct{} + +// StopAllWorkers [no description]. +func StopAllWorkers() *StopAllWorkersParams { + return &StopAllWorkersParams{} +} + +// Do executes ServiceWorker.stopAllWorkers against the provided context and +// target handler. +func (p *StopAllWorkersParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerStopAllWorkers, nil, nil) +} + +// StopWorkerParams [no description]. +type StopWorkerParams struct { + VersionID string `json:"versionId"` +} + +// StopWorker [no description]. +// +// parameters: +// versionID +func StopWorker(versionID string) *StopWorkerParams { + return &StopWorkerParams{ + VersionID: versionID, + } +} + +// Do executes ServiceWorker.stopWorker against the provided context and +// target handler. +func (p *StopWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerStopWorker, p, nil) +} + +// UnregisterParams [no description]. +type UnregisterParams struct { + ScopeURL string `json:"scopeURL"` +} + +// Unregister [no description]. +// +// parameters: +// scopeURL +func Unregister(scopeURL string) *UnregisterParams { + return &UnregisterParams{ + ScopeURL: scopeURL, + } +} + +// Do executes ServiceWorker.unregister against the provided context and +// target handler. +func (p *UnregisterParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerUnregister, p, nil) +} + +// UpdateRegistrationParams [no description]. +type UpdateRegistrationParams struct { + ScopeURL string `json:"scopeURL"` +} + +// UpdateRegistration [no description]. +// +// parameters: +// scopeURL +func UpdateRegistration(scopeURL string) *UpdateRegistrationParams { + return &UpdateRegistrationParams{ + ScopeURL: scopeURL, + } +} + +// Do executes ServiceWorker.updateRegistration against the provided context and +// target handler. +func (p *UpdateRegistrationParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandServiceWorkerUpdateRegistration, p, nil) } diff --git a/cdp/serviceworker/types.go b/cdp/serviceworker/types.go index 53767b3..450e474 100644 --- a/cdp/serviceworker/types.go +++ b/cdp/serviceworker/types.go @@ -128,7 +128,7 @@ type Version struct { RunningStatus VersionRunningStatus `json:"runningStatus"` Status VersionStatus `json:"status"` ScriptLastModified float64 `json:"scriptLastModified,omitempty"` // The Last-Modified header value of the main script. - ScriptResponseTime float64 `json:"scriptResponseTime,omitempty"` // The time at which the response headers of the main script were received from the server. For cached script it is the last time the cache entry was validated. + ScriptResponseTime float64 `json:"scriptResponseTime,omitempty"` // The time at which the response headers of the main script were received from the server. For cached script it is the last time the cache entry was validated. ControlledClients []target.ID `json:"controlledClients,omitempty"` TargetID target.ID `json:"targetId,omitempty"` } diff --git a/cdp/storage/events.go b/cdp/storage/events.go index d0c1c8c..62b0bbc 100644 --- a/cdp/storage/events.go +++ b/cdp/storage/events.go @@ -6,20 +6,14 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EventCacheStorageListUpdated a cache has been added/deleted. -type EventCacheStorageListUpdated struct { - Origin string `json:"origin"` // Origin to update. -} - // EventCacheStorageContentUpdated a cache's contents have been modified. type EventCacheStorageContentUpdated struct { Origin string `json:"origin"` // Origin to update. CacheName string `json:"cacheName"` // Name of cache in origin. } -// EventIndexedDBListUpdated the origin's IndexedDB database list has been -// modified. -type EventIndexedDBListUpdated struct { +// EventCacheStorageListUpdated a cache has been added/deleted. +type EventCacheStorageListUpdated struct { Origin string `json:"origin"` // Origin to update. } @@ -31,10 +25,16 @@ type EventIndexedDBContentUpdated struct { ObjectStoreName string `json:"objectStoreName"` // ObjectStore to update. } +// EventIndexedDBListUpdated the origin's IndexedDB database list has been +// modified. +type EventIndexedDBListUpdated struct { + Origin string `json:"origin"` // Origin to update. +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventStorageCacheStorageListUpdated, cdp.EventStorageCacheStorageContentUpdated, - cdp.EventStorageIndexedDBListUpdated, + cdp.EventStorageCacheStorageListUpdated, cdp.EventStorageIndexedDBContentUpdated, + cdp.EventStorageIndexedDBListUpdated, } diff --git a/cdp/storage/storage.go b/cdp/storage/storage.go index e3994a3..61f2736 100644 --- a/cdp/storage/storage.go +++ b/cdp/storage/storage.go @@ -99,29 +99,6 @@ func (p *TrackCacheStorageForOriginParams) Do(ctxt context.Context, h cdp.Handle return h.Execute(ctxt, cdp.CommandStorageTrackCacheStorageForOrigin, p, nil) } -// UntrackCacheStorageForOriginParams unregisters origin from receiving -// notifications for cache storage. -type UntrackCacheStorageForOriginParams struct { - Origin string `json:"origin"` // Security origin. -} - -// UntrackCacheStorageForOrigin unregisters origin from receiving -// notifications for cache storage. -// -// parameters: -// origin - Security origin. -func UntrackCacheStorageForOrigin(origin string) *UntrackCacheStorageForOriginParams { - return &UntrackCacheStorageForOriginParams{ - Origin: origin, - } -} - -// Do executes Storage.untrackCacheStorageForOrigin against the provided context and -// target handler. -func (p *UntrackCacheStorageForOriginParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandStorageUntrackCacheStorageForOrigin, p, nil) -} - // TrackIndexedDBForOriginParams registers origin to be notified when an // update occurs to its IndexedDB. type TrackIndexedDBForOriginParams struct { @@ -145,6 +122,29 @@ func (p *TrackIndexedDBForOriginParams) Do(ctxt context.Context, h cdp.Handler) return h.Execute(ctxt, cdp.CommandStorageTrackIndexedDBForOrigin, p, nil) } +// UntrackCacheStorageForOriginParams unregisters origin from receiving +// notifications for cache storage. +type UntrackCacheStorageForOriginParams struct { + Origin string `json:"origin"` // Security origin. +} + +// UntrackCacheStorageForOrigin unregisters origin from receiving +// notifications for cache storage. +// +// parameters: +// origin - Security origin. +func UntrackCacheStorageForOrigin(origin string) *UntrackCacheStorageForOriginParams { + return &UntrackCacheStorageForOriginParams{ + Origin: origin, + } +} + +// Do executes Storage.untrackCacheStorageForOrigin against the provided context and +// target handler. +func (p *UntrackCacheStorageForOriginParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandStorageUntrackCacheStorageForOrigin, p, nil) +} + // UntrackIndexedDBForOriginParams unregisters origin from receiving // notifications for IndexedDB. type UntrackIndexedDBForOriginParams struct { diff --git a/cdp/target/events.go b/cdp/target/events.go index 434ed31..fa684ca 100644 --- a/cdp/target/events.go +++ b/cdp/target/events.go @@ -6,22 +6,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// EventTargetCreated issued when a possible inspection target is created. -type EventTargetCreated struct { - TargetInfo *Info `json:"targetInfo"` -} - -// EventTargetInfoChanged issued when some information about a target has -// changed. This only happens between targetCreated and targetDestroyed. -type EventTargetInfoChanged struct { - TargetInfo *Info `json:"targetInfo"` -} - -// EventTargetDestroyed issued when a target is destroyed. -type EventTargetDestroyed struct { - TargetID ID `json:"targetId"` -} - // EventAttachedToTarget issued when attached to target because of // auto-attach or attachToTarget command. type EventAttachedToTarget struct { @@ -44,12 +28,28 @@ type EventReceivedMessageFromTarget struct { Message string `json:"message"` } +// EventTargetCreated issued when a possible inspection target is created. +type EventTargetCreated struct { + TargetInfo *Info `json:"targetInfo"` +} + +// EventTargetDestroyed issued when a target is destroyed. +type EventTargetDestroyed struct { + TargetID ID `json:"targetId"` +} + +// EventTargetInfoChanged issued when some information about a target has +// changed. This only happens between targetCreated and targetDestroyed. +type EventTargetInfoChanged struct { + TargetInfo *Info `json:"targetInfo"` +} + // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ - cdp.EventTargetTargetCreated, - cdp.EventTargetTargetInfoChanged, - cdp.EventTargetTargetDestroyed, cdp.EventTargetAttachedToTarget, cdp.EventTargetDetachedFromTarget, cdp.EventTargetReceivedMessageFromTarget, + cdp.EventTargetTargetCreated, + cdp.EventTargetTargetDestroyed, + cdp.EventTargetTargetInfoChanged, } diff --git a/cdp/target/target.go b/cdp/target/target.go index a43d91d..fadaeb0 100644 --- a/cdp/target/target.go +++ b/cdp/target/target.go @@ -14,168 +14,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// SetDiscoverTargetsParams controls whether to discover available targets -// and notify via targetCreated/targetInfoChanged/targetDestroyed events. -type SetDiscoverTargetsParams struct { - Discover bool `json:"discover"` // Whether to discover available targets. -} - -// SetDiscoverTargets controls whether to discover available targets and -// notify via targetCreated/targetInfoChanged/targetDestroyed events. -// -// parameters: -// discover - Whether to discover available targets. -func SetDiscoverTargets(discover bool) *SetDiscoverTargetsParams { - return &SetDiscoverTargetsParams{ - Discover: discover, - } -} - -// Do executes Target.setDiscoverTargets against the provided context and -// target handler. -func (p *SetDiscoverTargetsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTargetSetDiscoverTargets, p, nil) -} - -// SetAutoAttachParams 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. -type SetAutoAttachParams struct { - AutoAttach bool `json:"autoAttach"` // Whether to auto-attach to related targets. - WaitForDebuggerOnStart bool `json:"waitForDebuggerOnStart"` // Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. -} - -// SetAutoAttach 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. -// -// parameters: -// autoAttach - Whether to auto-attach to related targets. -// waitForDebuggerOnStart - Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. -func SetAutoAttach(autoAttach bool, waitForDebuggerOnStart bool) *SetAutoAttachParams { - return &SetAutoAttachParams{ - AutoAttach: autoAttach, - WaitForDebuggerOnStart: waitForDebuggerOnStart, - } -} - -// Do executes Target.setAutoAttach against the provided context and -// target handler. -func (p *SetAutoAttachParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTargetSetAutoAttach, p, nil) -} - -// SetAttachToFramesParams [no description]. -type SetAttachToFramesParams struct { - Value bool `json:"value"` // Whether to attach to frames. -} - -// SetAttachToFrames [no description]. -// -// parameters: -// value - Whether to attach to frames. -func SetAttachToFrames(value bool) *SetAttachToFramesParams { - return &SetAttachToFramesParams{ - Value: value, - } -} - -// Do executes Target.setAttachToFrames against the provided context and -// target handler. -func (p *SetAttachToFramesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTargetSetAttachToFrames, p, nil) -} - -// SetRemoteLocationsParams enables target discovery for the specified -// locations, when setDiscoverTargets was set to true. -type SetRemoteLocationsParams struct { - Locations []*RemoteLocation `json:"locations"` // List of remote locations. -} - -// SetRemoteLocations enables target discovery for the specified locations, -// when setDiscoverTargets was set to true. -// -// parameters: -// locations - List of remote locations. -func SetRemoteLocations(locations []*RemoteLocation) *SetRemoteLocationsParams { - return &SetRemoteLocationsParams{ - Locations: locations, - } -} - -// Do executes Target.setRemoteLocations against the provided context and -// target handler. -func (p *SetRemoteLocationsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTargetSetRemoteLocations, p, nil) -} - -// SendMessageToTargetParams sends protocol message over session with given -// id. -type SendMessageToTargetParams struct { - Message string `json:"message"` - SessionID SessionID `json:"sessionId,omitempty"` // Identifier of the session. -} - -// SendMessageToTarget sends protocol message over session with given id. -// -// parameters: -// message -func SendMessageToTarget(message string) *SendMessageToTargetParams { - return &SendMessageToTargetParams{ - Message: message, - } -} - -// WithSessionID identifier of the session. -func (p SendMessageToTargetParams) WithSessionID(sessionID SessionID) *SendMessageToTargetParams { - p.SessionID = sessionID - return &p -} - -// Do executes Target.sendMessageToTarget against the provided context and -// target handler. -func (p *SendMessageToTargetParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTargetSendMessageToTarget, p, nil) -} - -// GetTargetInfoParams returns information about a target. -type GetTargetInfoParams struct { - TargetID ID `json:"targetId"` -} - -// GetTargetInfo returns information about a target. -// -// parameters: -// targetID -func GetTargetInfo(targetID ID) *GetTargetInfoParams { - return &GetTargetInfoParams{ - TargetID: targetID, - } -} - -// GetTargetInfoReturns return values. -type GetTargetInfoReturns struct { - TargetInfo *Info `json:"targetInfo,omitempty"` -} - -// Do executes Target.getTargetInfo against the provided context and -// target handler. -// -// returns: -// targetInfo -func (p *GetTargetInfoParams) Do(ctxt context.Context, h cdp.Handler) (targetInfo *Info, err error) { - // execute - var res GetTargetInfoReturns - err = h.Execute(ctxt, cdp.CommandTargetGetTargetInfo, p, &res) - if err != nil { - return nil, err - } - - return res.TargetInfo, nil -} - // ActivateTargetParams activates (focuses) the target. type ActivateTargetParams struct { TargetID ID `json:"targetId"` @@ -197,6 +35,42 @@ func (p *ActivateTargetParams) Do(ctxt context.Context, h cdp.Handler) (err erro return h.Execute(ctxt, cdp.CommandTargetActivateTarget, p, nil) } +// AttachToTargetParams attaches to the target with given id. +type AttachToTargetParams struct { + TargetID ID `json:"targetId"` +} + +// AttachToTarget attaches to the target with given id. +// +// parameters: +// targetID +func AttachToTarget(targetID ID) *AttachToTargetParams { + return &AttachToTargetParams{ + TargetID: targetID, + } +} + +// AttachToTargetReturns return values. +type AttachToTargetReturns struct { + SessionID SessionID `json:"sessionId,omitempty"` // Id assigned to the session. +} + +// Do executes Target.attachToTarget against the provided context and +// target handler. +// +// returns: +// sessionID - Id assigned to the session. +func (p *AttachToTargetParams) Do(ctxt context.Context, h cdp.Handler) (sessionID SessionID, err error) { + // execute + var res AttachToTargetReturns + err = h.Execute(ctxt, cdp.CommandTargetAttachToTarget, p, &res) + if err != nil { + return "", err + } + + return res.SessionID, nil +} + // CloseTargetParams closes the target. If the target is a page that gets // closed too. type CloseTargetParams struct { @@ -235,66 +109,6 @@ func (p *CloseTargetParams) Do(ctxt context.Context, h cdp.Handler) (success boo return res.Success, nil } -// AttachToTargetParams attaches to the target with given id. -type AttachToTargetParams struct { - TargetID ID `json:"targetId"` -} - -// AttachToTarget attaches to the target with given id. -// -// parameters: -// targetID -func AttachToTarget(targetID ID) *AttachToTargetParams { - return &AttachToTargetParams{ - TargetID: targetID, - } -} - -// AttachToTargetReturns return values. -type AttachToTargetReturns struct { - SessionID SessionID `json:"sessionId,omitempty"` // Id assigned to the session. -} - -// Do executes Target.attachToTarget against the provided context and -// target handler. -// -// returns: -// sessionID - Id assigned to the session. -func (p *AttachToTargetParams) Do(ctxt context.Context, h cdp.Handler) (sessionID SessionID, err error) { - // execute - var res AttachToTargetReturns - err = h.Execute(ctxt, cdp.CommandTargetAttachToTarget, p, &res) - if err != nil { - return "", err - } - - return res.SessionID, nil -} - -// DetachFromTargetParams detaches session with given id. -type DetachFromTargetParams struct { - SessionID SessionID `json:"sessionId,omitempty"` // Session to detach. -} - -// DetachFromTarget detaches session with given id. -// -// parameters: -func DetachFromTarget() *DetachFromTargetParams { - return &DetachFromTargetParams{} -} - -// WithSessionID session to detach. -func (p DetachFromTargetParams) WithSessionID(sessionID SessionID) *DetachFromTargetParams { - p.SessionID = sessionID - return &p -} - -// Do executes Target.detachFromTarget against the provided context and -// target handler. -func (p *DetachFromTargetParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTargetDetachFromTarget, p, nil) -} - // CreateBrowserContextParams creates a new empty BrowserContext. Similar to // an incognito profile but you can have more than one. type CreateBrowserContextParams struct{} @@ -326,44 +140,6 @@ func (p *CreateBrowserContextParams) Do(ctxt context.Context, h cdp.Handler) (br return res.BrowserContextID, nil } -// DisposeBrowserContextParams deletes a BrowserContext, will fail of any -// open page uses it. -type DisposeBrowserContextParams struct { - BrowserContextID BrowserContextID `json:"browserContextId"` -} - -// DisposeBrowserContext deletes a BrowserContext, will fail of any open page -// uses it. -// -// parameters: -// browserContextID -func DisposeBrowserContext(browserContextID BrowserContextID) *DisposeBrowserContextParams { - return &DisposeBrowserContextParams{ - BrowserContextID: browserContextID, - } -} - -// DisposeBrowserContextReturns return values. -type DisposeBrowserContextReturns struct { - Success bool `json:"success,omitempty"` -} - -// Do executes Target.disposeBrowserContext against the provided context and -// target handler. -// -// returns: -// success -func (p *DisposeBrowserContextParams) Do(ctxt context.Context, h cdp.Handler) (success bool, err error) { - // execute - var res DisposeBrowserContextReturns - err = h.Execute(ctxt, cdp.CommandTargetDisposeBrowserContext, p, &res) - if err != nil { - return false, err - } - - return res.Success, nil -} - // CreateTargetParams creates a new page. type CreateTargetParams struct { URL string `json:"url"` // The initial URL the page will be navigated to. @@ -431,6 +207,104 @@ func (p *CreateTargetParams) Do(ctxt context.Context, h cdp.Handler) (targetID I return res.TargetID, nil } +// DetachFromTargetParams detaches session with given id. +type DetachFromTargetParams struct { + SessionID SessionID `json:"sessionId,omitempty"` // Session to detach. +} + +// DetachFromTarget detaches session with given id. +// +// parameters: +func DetachFromTarget() *DetachFromTargetParams { + return &DetachFromTargetParams{} +} + +// WithSessionID session to detach. +func (p DetachFromTargetParams) WithSessionID(sessionID SessionID) *DetachFromTargetParams { + p.SessionID = sessionID + return &p +} + +// Do executes Target.detachFromTarget against the provided context and +// target handler. +func (p *DetachFromTargetParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTargetDetachFromTarget, p, nil) +} + +// DisposeBrowserContextParams deletes a BrowserContext, will fail of any +// open page uses it. +type DisposeBrowserContextParams struct { + BrowserContextID BrowserContextID `json:"browserContextId"` +} + +// DisposeBrowserContext deletes a BrowserContext, will fail of any open page +// uses it. +// +// parameters: +// browserContextID +func DisposeBrowserContext(browserContextID BrowserContextID) *DisposeBrowserContextParams { + return &DisposeBrowserContextParams{ + BrowserContextID: browserContextID, + } +} + +// DisposeBrowserContextReturns return values. +type DisposeBrowserContextReturns struct { + Success bool `json:"success,omitempty"` +} + +// Do executes Target.disposeBrowserContext against the provided context and +// target handler. +// +// returns: +// success +func (p *DisposeBrowserContextParams) Do(ctxt context.Context, h cdp.Handler) (success bool, err error) { + // execute + var res DisposeBrowserContextReturns + err = h.Execute(ctxt, cdp.CommandTargetDisposeBrowserContext, p, &res) + if err != nil { + return false, err + } + + return res.Success, nil +} + +// GetTargetInfoParams returns information about a target. +type GetTargetInfoParams struct { + TargetID ID `json:"targetId"` +} + +// GetTargetInfo returns information about a target. +// +// parameters: +// targetID +func GetTargetInfo(targetID ID) *GetTargetInfoParams { + return &GetTargetInfoParams{ + TargetID: targetID, + } +} + +// GetTargetInfoReturns return values. +type GetTargetInfoReturns struct { + TargetInfo *Info `json:"targetInfo,omitempty"` +} + +// Do executes Target.getTargetInfo against the provided context and +// target handler. +// +// returns: +// targetInfo +func (p *GetTargetInfoParams) Do(ctxt context.Context, h cdp.Handler) (targetInfo *Info, err error) { + // execute + var res GetTargetInfoReturns + err = h.Execute(ctxt, cdp.CommandTargetGetTargetInfo, p, &res) + if err != nil { + return nil, err + } + + return res.TargetInfo, nil +} + // GetTargetsParams retrieves a list of available targets. type GetTargetsParams struct{} @@ -459,3 +333,129 @@ func (p *GetTargetsParams) Do(ctxt context.Context, h cdp.Handler) (targetInfos return res.TargetInfos, nil } + +// SendMessageToTargetParams sends protocol message over session with given +// id. +type SendMessageToTargetParams struct { + Message string `json:"message"` + SessionID SessionID `json:"sessionId,omitempty"` // Identifier of the session. +} + +// SendMessageToTarget sends protocol message over session with given id. +// +// parameters: +// message +func SendMessageToTarget(message string) *SendMessageToTargetParams { + return &SendMessageToTargetParams{ + Message: message, + } +} + +// WithSessionID identifier of the session. +func (p SendMessageToTargetParams) WithSessionID(sessionID SessionID) *SendMessageToTargetParams { + p.SessionID = sessionID + return &p +} + +// Do executes Target.sendMessageToTarget against the provided context and +// target handler. +func (p *SendMessageToTargetParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTargetSendMessageToTarget, p, nil) +} + +// SetAttachToFramesParams [no description]. +type SetAttachToFramesParams struct { + Value bool `json:"value"` // Whether to attach to frames. +} + +// SetAttachToFrames [no description]. +// +// parameters: +// value - Whether to attach to frames. +func SetAttachToFrames(value bool) *SetAttachToFramesParams { + return &SetAttachToFramesParams{ + Value: value, + } +} + +// Do executes Target.setAttachToFrames against the provided context and +// target handler. +func (p *SetAttachToFramesParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTargetSetAttachToFrames, p, nil) +} + +// SetAutoAttachParams 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. +type SetAutoAttachParams struct { + AutoAttach bool `json:"autoAttach"` // Whether to auto-attach to related targets. + WaitForDebuggerOnStart bool `json:"waitForDebuggerOnStart"` // Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. +} + +// SetAutoAttach 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. +// +// parameters: +// autoAttach - Whether to auto-attach to related targets. +// waitForDebuggerOnStart - Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. +func SetAutoAttach(autoAttach bool, waitForDebuggerOnStart bool) *SetAutoAttachParams { + return &SetAutoAttachParams{ + AutoAttach: autoAttach, + WaitForDebuggerOnStart: waitForDebuggerOnStart, + } +} + +// Do executes Target.setAutoAttach against the provided context and +// target handler. +func (p *SetAutoAttachParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTargetSetAutoAttach, p, nil) +} + +// SetDiscoverTargetsParams controls whether to discover available targets +// and notify via targetCreated/targetInfoChanged/targetDestroyed events. +type SetDiscoverTargetsParams struct { + Discover bool `json:"discover"` // Whether to discover available targets. +} + +// SetDiscoverTargets controls whether to discover available targets and +// notify via targetCreated/targetInfoChanged/targetDestroyed events. +// +// parameters: +// discover - Whether to discover available targets. +func SetDiscoverTargets(discover bool) *SetDiscoverTargetsParams { + return &SetDiscoverTargetsParams{ + Discover: discover, + } +} + +// Do executes Target.setDiscoverTargets against the provided context and +// target handler. +func (p *SetDiscoverTargetsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTargetSetDiscoverTargets, p, nil) +} + +// SetRemoteLocationsParams enables target discovery for the specified +// locations, when setDiscoverTargets was set to true. +type SetRemoteLocationsParams struct { + Locations []*RemoteLocation `json:"locations"` // List of remote locations. +} + +// SetRemoteLocations enables target discovery for the specified locations, +// when setDiscoverTargets was set to true. +// +// parameters: +// locations - List of remote locations. +func SetRemoteLocations(locations []*RemoteLocation) *SetRemoteLocationsParams { + return &SetRemoteLocationsParams{ + Locations: locations, + } +} + +// Do executes Target.setRemoteLocations against the provided context and +// target handler. +func (p *SetRemoteLocationsParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTargetSetRemoteLocations, p, nil) +} diff --git a/cdp/tracing/easyjson.go b/cdp/tracing/easyjson.go index 392287c..36cc1b3 100644 --- a/cdp/tracing/easyjson.go +++ b/cdp/tracing/easyjson.go @@ -294,6 +294,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTracing1(in *jlexer.Lexer, out out.BufferUsageReportingInterval = float64(in.Float64()) case "transferMode": (out.TransferMode).UnmarshalEasyJSON(in) + case "streamCompression": + (out.StreamCompression).UnmarshalEasyJSON(in) case "traceConfig": if in.IsNull() { in.Skip() @@ -338,6 +340,16 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTracing1(out *jwriter.Writer, } (in.TransferMode).MarshalEasyJSON(out) } + if in.StreamCompression != "" { + const prefix string = ",\"streamCompression\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (in.StreamCompression).MarshalEasyJSON(out) + } if in.TraceConfig != nil { const prefix string = ",\"traceConfig\":" if first { @@ -827,6 +839,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTracing8(in *jlexer.Lexer, out switch key { case "stream": out.Stream = io.StreamHandle(in.String()) + case "streamCompression": + (out.StreamCompression).UnmarshalEasyJSON(in) default: in.SkipRecursive() } @@ -851,6 +865,16 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTracing8(out *jwriter.Writer, } out.String(string(in.Stream)) } + if in.StreamCompression != "" { + const prefix string = ",\"streamCompression\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (in.StreamCompression).MarshalEasyJSON(out) + } out.RawByte('}') } diff --git a/cdp/tracing/events.go b/cdp/tracing/events.go index 168c984..d1b998c 100644 --- a/cdp/tracing/events.go +++ b/cdp/tracing/events.go @@ -8,6 +8,13 @@ import ( "github.com/mailru/easyjson" ) +// EventBufferUsage [no description]. +type EventBufferUsage struct { + PercentFull float64 `json:"percentFull,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. + EventCount float64 `json:"eventCount,omitempty"` // An approximate number of events in the trace log. + Value float64 `json:"value,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. +} + // EventDataCollected contains an bucket of collected trace events. When // tracing is stopped collected events will be send as a sequence of // dataCollected events followed by tracingComplete event. @@ -18,19 +25,13 @@ type EventDataCollected struct { // EventTracingComplete signals that tracing is stopped and there is no trace // buffers pending flush, all data were delivered via dataCollected events. type EventTracingComplete struct { - Stream io.StreamHandle `json:"stream,omitempty"` // A handle of the stream that holds resulting trace data. -} - -// EventBufferUsage [no description]. -type EventBufferUsage struct { - PercentFull float64 `json:"percentFull,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. - EventCount float64 `json:"eventCount,omitempty"` // An approximate number of events in the trace log. - Value float64 `json:"value,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. + Stream io.StreamHandle `json:"stream,omitempty"` // A handle of the stream that holds resulting trace data. + StreamCompression StreamCompression `json:"streamCompression,omitempty"` // Compression format of returned stream. } // EventTypes all event types in the domain. var EventTypes = []cdp.MethodType{ + cdp.EventTracingBufferUsage, cdp.EventTracingDataCollected, cdp.EventTracingTracingComplete, - cdp.EventTracingBufferUsage, } diff --git a/cdp/tracing/tracing.go b/cdp/tracing/tracing.go index a6779bc..b4bb696 100644 --- a/cdp/tracing/tracing.go +++ b/cdp/tracing/tracing.go @@ -12,46 +12,6 @@ import ( cdp "github.com/knq/chromedp/cdp" ) -// StartParams start trace events collection. -type StartParams struct { - BufferUsageReportingInterval float64 `json:"bufferUsageReportingInterval,omitempty"` // If set, the agent will issue bufferUsage events at this interval, specified in milliseconds - TransferMode TransferMode `json:"transferMode,omitempty"` // Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents). - TraceConfig *TraceConfig `json:"traceConfig,omitempty"` -} - -// Start start trace events collection. -// -// parameters: -func Start() *StartParams { - return &StartParams{} -} - -// WithBufferUsageReportingInterval if set, the agent will issue bufferUsage -// events at this interval, specified in milliseconds. -func (p StartParams) WithBufferUsageReportingInterval(bufferUsageReportingInterval float64) *StartParams { - p.BufferUsageReportingInterval = bufferUsageReportingInterval - return &p -} - -// WithTransferMode whether to report trace events as series of dataCollected -// events or to save trace to a stream (defaults to ReportEvents). -func (p StartParams) WithTransferMode(transferMode TransferMode) *StartParams { - p.TransferMode = transferMode - return &p -} - -// WithTraceConfig [no description]. -func (p StartParams) WithTraceConfig(traceConfig *TraceConfig) *StartParams { - p.TraceConfig = traceConfig - return &p -} - -// Do executes Tracing.start against the provided context and -// target handler. -func (p *StartParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTracingStart, p, nil) -} - // EndParams stop trace events collection. type EndParams struct{} @@ -95,6 +55,27 @@ func (p *GetCategoriesParams) Do(ctxt context.Context, h cdp.Handler) (categorie return res.Categories, nil } +// RecordClockSyncMarkerParams record a clock sync marker in the trace. +type RecordClockSyncMarkerParams struct { + SyncID string `json:"syncId"` // The ID of this clock sync marker +} + +// RecordClockSyncMarker record a clock sync marker in the trace. +// +// parameters: +// syncID - The ID of this clock sync marker +func RecordClockSyncMarker(syncID string) *RecordClockSyncMarkerParams { + return &RecordClockSyncMarkerParams{ + SyncID: syncID, + } +} + +// Do executes Tracing.recordClockSyncMarker against the provided context and +// target handler. +func (p *RecordClockSyncMarkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTracingRecordClockSyncMarker, p, nil) +} + // RequestMemoryDumpParams request a global memory dump. type RequestMemoryDumpParams struct{} @@ -126,23 +107,50 @@ func (p *RequestMemoryDumpParams) Do(ctxt context.Context, h cdp.Handler) (dumpG return res.DumpGUID, res.Success, nil } -// RecordClockSyncMarkerParams record a clock sync marker in the trace. -type RecordClockSyncMarkerParams struct { - SyncID string `json:"syncId"` // The ID of this clock sync marker +// StartParams start trace events collection. +type StartParams struct { + BufferUsageReportingInterval float64 `json:"bufferUsageReportingInterval,omitempty"` // If set, the agent will issue bufferUsage events at this interval, specified in milliseconds + TransferMode TransferMode `json:"transferMode,omitempty"` // Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents). + StreamCompression StreamCompression `json:"streamCompression,omitempty"` // Compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none) + TraceConfig *TraceConfig `json:"traceConfig,omitempty"` } -// RecordClockSyncMarker record a clock sync marker in the trace. +// Start start trace events collection. // // parameters: -// syncID - The ID of this clock sync marker -func RecordClockSyncMarker(syncID string) *RecordClockSyncMarkerParams { - return &RecordClockSyncMarkerParams{ - SyncID: syncID, - } +func Start() *StartParams { + return &StartParams{} } -// Do executes Tracing.recordClockSyncMarker against the provided context and -// target handler. -func (p *RecordClockSyncMarkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) { - return h.Execute(ctxt, cdp.CommandTracingRecordClockSyncMarker, p, nil) +// WithBufferUsageReportingInterval if set, the agent will issue bufferUsage +// events at this interval, specified in milliseconds. +func (p StartParams) WithBufferUsageReportingInterval(bufferUsageReportingInterval float64) *StartParams { + p.BufferUsageReportingInterval = bufferUsageReportingInterval + return &p +} + +// WithTransferMode whether to report trace events as series of dataCollected +// events or to save trace to a stream (defaults to ReportEvents). +func (p StartParams) WithTransferMode(transferMode TransferMode) *StartParams { + p.TransferMode = transferMode + return &p +} + +// WithStreamCompression compression format to use. This only applies when +// using ReturnAsStream transfer mode (defaults to none). +func (p StartParams) WithStreamCompression(streamCompression StreamCompression) *StartParams { + p.StreamCompression = streamCompression + return &p +} + +// WithTraceConfig [no description]. +func (p StartParams) WithTraceConfig(traceConfig *TraceConfig) *StartParams { + p.TraceConfig = traceConfig + return &p +} + +// Do executes Tracing.start against the provided context and +// target handler. +func (p *StartParams) Do(ctxt context.Context, h cdp.Handler) (err error) { + return h.Execute(ctxt, cdp.CommandTracingStart, p, nil) } diff --git a/cdp/tracing/types.go b/cdp/tracing/types.go index 120a813..0d82f2a 100644 --- a/cdp/tracing/types.go +++ b/cdp/tracing/types.go @@ -26,6 +26,48 @@ type TraceConfig struct { MemoryDumpConfig *MemoryDumpConfig `json:"memoryDumpConfig,omitempty"` // Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. } +// StreamCompression compression type to use for traces returned via streams. +type StreamCompression string + +// String returns the StreamCompression as string value. +func (t StreamCompression) String() string { + return string(t) +} + +// StreamCompression values. +const ( + StreamCompressionNone StreamCompression = "none" + StreamCompressionGzip StreamCompression = "gzip" +) + +// MarshalEasyJSON satisfies easyjson.Marshaler. +func (t StreamCompression) MarshalEasyJSON(out *jwriter.Writer) { + out.String(string(t)) +} + +// MarshalJSON satisfies json.Marshaler. +func (t StreamCompression) MarshalJSON() ([]byte, error) { + return easyjson.Marshal(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *StreamCompression) UnmarshalEasyJSON(in *jlexer.Lexer) { + switch StreamCompression(in.String()) { + case StreamCompressionNone: + *t = StreamCompressionNone + case StreamCompressionGzip: + *t = StreamCompressionGzip + + default: + in.AddError(errors.New("unknown StreamCompression value")) + } +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *StreamCompression) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} + // RecordMode controls how the trace buffer stores data. type RecordMode string diff --git a/cmd/chromedp-gen/protocol.json b/cmd/chromedp-gen/protocol.json index 916a5cf..3116a9a 100644 --- a/cmd/chromedp-gen/protocol.json +++ b/cmd/chromedp-gen/protocol.json @@ -5,17 +5,6131 @@ }, "domains": [ { - "domain": "Inspector", + "domain": "Accessibility", "experimental": true, - "types": [], + "dependencies": [ + "DOM" + ], + "types": [ + { + "id": "AXNodeId", + "description": "Unique accessibility node identifier.", + "type": "string" + }, + { + "id": "AXValueType", + "description": "Enum of possible property types.", + "type": "string", + "enum": [ + "boolean", + "tristate", + "booleanOrUndefined", + "idref", + "idrefList", + "integer", + "node", + "nodeList", + "number", + "string", + "computedString", + "token", + "tokenList", + "domRelation", + "role", + "internalRole", + "valueUndefined" + ] + }, + { + "id": "AXValueSourceType", + "description": "Enum of possible property sources.", + "type": "string", + "enum": [ + "attribute", + "implicit", + "style", + "contents", + "placeholder", + "relatedElement" + ] + }, + { + "id": "AXValueNativeSourceType", + "description": "Enum of possible native property sources (as a subtype of a particular AXValueSourceType).", + "type": "string", + "enum": [ + "figcaption", + "label", + "labelfor", + "labelwrapped", + "legend", + "tablecaption", + "title", + "other" + ] + }, + { + "id": "AXValueSource", + "description": "A single source for a computed AX property.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "What type of source this is.", + "$ref": "AXValueSourceType" + }, + { + "name": "value", + "description": "The value of this property source.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "attribute", + "description": "The name of the relevant attribute, if any.", + "optional": true, + "type": "string" + }, + { + "name": "attributeValue", + "description": "The value of the relevant attribute, if any.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "superseded", + "description": "Whether this source is superseded by a higher priority source.", + "optional": true, + "type": "boolean" + }, + { + "name": "nativeSource", + "description": "The native markup source for this value, e.g. a element.", + "optional": true, + "$ref": "AXValueNativeSourceType" + }, + { + "name": "nativeSourceValue", + "description": "The value, such as a node or node list, of the native source.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "invalid", + "description": "Whether the value for this property is invalid.", + "optional": true, + "type": "boolean" + }, + { + "name": "invalidReason", + "description": "Reason for the value being invalid, if it is.", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "AXRelatedNode", + "type": "object", + "properties": [ + { + "name": "backendDOMNodeId", + "description": "The BackendNodeId of the related DOM node.", + "$ref": "DOM.BackendNodeId" + }, + { + "name": "idref", + "description": "The IDRef value provided, if any.", + "optional": true, + "type": "string" + }, + { + "name": "text", + "description": "The text alternative of this node in the current context.", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "AXProperty", + "type": "object", + "properties": [ + { + "name": "name", + "description": "The name of this property.", + "$ref": "AXPropertyName" + }, + { + "name": "value", + "description": "The value of this property.", + "$ref": "AXValue" + } + ] + }, + { + "id": "AXValue", + "description": "A single computed AX property.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "The type of this value.", + "$ref": "AXValueType" + }, + { + "name": "value", + "description": "The computed value of this property.", + "optional": true, + "type": "any" + }, + { + "name": "relatedNodes", + "description": "One or more related nodes, if applicable.", + "optional": true, + "type": "array", + "items": { + "$ref": "AXRelatedNode" + } + }, + { + "name": "sources", + "description": "The sources which contributed to the computation of this property.", + "optional": true, + "type": "array", + "items": { + "$ref": "AXValueSource" + } + } + ] + }, + { + "id": "AXPropertyName", + "description": "Values of AXProperty name: from 'busy' to 'roledescription' - states which apply to every AX\nnode, from 'live' to 'root' - attributes which apply to nodes in live regions, from\n'autocomplete' to 'valuetext' - attributes which apply to widgets, from 'checked' to 'selected'\n- states which apply to widgets, from 'activedescendant' to 'owns' - relationships between\nelements other than parent/child/sibling.", + "type": "string", + "enum": [ + "busy", + "disabled", + "hidden", + "hiddenRoot", + "invalid", + "keyshortcuts", + "roledescription", + "live", + "atomic", + "relevant", + "root", + "autocomplete", + "haspopup", + "level", + "multiselectable", + "orientation", + "multiline", + "readonly", + "required", + "valuemin", + "valuemax", + "valuetext", + "checked", + "expanded", + "modal", + "pressed", + "selected", + "activedescendant", + "controls", + "describedby", + "details", + "errormessage", + "flowto", + "labelledby", + "owns" + ] + }, + { + "id": "AXNode", + "description": "A node in the accessibility tree.", + "type": "object", + "properties": [ + { + "name": "nodeId", + "description": "Unique identifier for this node.", + "$ref": "AXNodeId" + }, + { + "name": "ignored", + "description": "Whether this node is ignored for accessibility", + "type": "boolean" + }, + { + "name": "ignoredReasons", + "description": "Collection of reasons why this node is hidden.", + "optional": true, + "type": "array", + "items": { + "$ref": "AXProperty" + } + }, + { + "name": "role", + "description": "This `Node`'s role, whether explicit or implicit.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "name", + "description": "The accessible name for this `Node`.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "description", + "description": "The accessible description for this `Node`.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "value", + "description": "The value for this `Node`.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "properties", + "description": "All other properties", + "optional": true, + "type": "array", + "items": { + "$ref": "AXProperty" + } + }, + { + "name": "childIds", + "description": "IDs for each of this node's child nodes.", + "optional": true, + "type": "array", + "items": { + "$ref": "AXNodeId" + } + }, + { + "name": "backendDOMNodeId", + "description": "The backend ID for the associated DOM node, if any.", + "optional": true, + "$ref": "DOM.BackendNodeId" + } + ] + } + ], + "commands": [ + { + "name": "getPartialAXTree", + "description": "Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "ID of node to get the partial accessibility tree for.", + "$ref": "DOM.NodeId" + }, + { + "name": "fetchRelatives", + "description": "Whether to fetch this nodes ancestors, siblings and children. Defaults to true.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "nodes", + "description": "The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and\nchildren, if requested.", + "type": "array", + "items": { + "$ref": "AXNode" + } + } + ] + } + ] + }, + { + "domain": "Animation", + "experimental": true, + "dependencies": [ + "Runtime", + "DOM" + ], + "types": [ + { + "id": "Animation", + "description": "Animation instance.", + "type": "object", + "properties": [ + { + "name": "id", + "description": "`Animation`'s id.", + "type": "string" + }, + { + "name": "name", + "description": "`Animation`'s name.", + "type": "string" + }, + { + "name": "pausedState", + "description": "`Animation`'s internal paused state.", + "type": "boolean" + }, + { + "name": "playState", + "description": "`Animation`'s play state.", + "type": "string" + }, + { + "name": "playbackRate", + "description": "`Animation`'s playback rate.", + "type": "number" + }, + { + "name": "startTime", + "description": "`Animation`'s start time.", + "type": "number" + }, + { + "name": "currentTime", + "description": "`Animation`'s current time.", + "type": "number" + }, + { + "name": "type", + "description": "Animation type of `Animation`.", + "type": "string", + "enum": [ + "CSSTransition", + "CSSAnimation", + "WebAnimation" + ] + }, + { + "name": "source", + "description": "`Animation`'s source animation node.", + "optional": true, + "$ref": "AnimationEffect" + }, + { + "name": "cssId", + "description": "A unique ID for `Animation` representing the sources that triggered this CSS\nanimation/transition.", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "AnimationEffect", + "description": "AnimationEffect instance", + "type": "object", + "properties": [ + { + "name": "delay", + "description": "`AnimationEffect`'s delay.", + "type": "number" + }, + { + "name": "endDelay", + "description": "`AnimationEffect`'s end delay.", + "type": "number" + }, + { + "name": "iterationStart", + "description": "`AnimationEffect`'s iteration start.", + "type": "number" + }, + { + "name": "iterations", + "description": "`AnimationEffect`'s iterations.", + "type": "number" + }, + { + "name": "duration", + "description": "`AnimationEffect`'s iteration duration.", + "type": "number" + }, + { + "name": "direction", + "description": "`AnimationEffect`'s playback direction.", + "type": "string" + }, + { + "name": "fill", + "description": "`AnimationEffect`'s fill mode.", + "type": "string" + }, + { + "name": "backendNodeId", + "description": "`AnimationEffect`'s target node.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "keyframesRule", + "description": "`AnimationEffect`'s keyframes.", + "optional": true, + "$ref": "KeyframesRule" + }, + { + "name": "easing", + "description": "`AnimationEffect`'s timing function.", + "type": "string" + } + ] + }, + { + "id": "KeyframesRule", + "description": "Keyframes Rule", + "type": "object", + "properties": [ + { + "name": "name", + "description": "CSS keyframed animation's name.", + "optional": true, + "type": "string" + }, + { + "name": "keyframes", + "description": "List of animation keyframes.", + "type": "array", + "items": { + "$ref": "KeyframeStyle" + } + } + ] + }, + { + "id": "KeyframeStyle", + "description": "Keyframe Style", + "type": "object", + "properties": [ + { + "name": "offset", + "description": "Keyframe's time offset.", + "type": "string" + }, + { + "name": "easing", + "description": "`AnimationEffect`'s timing function.", + "type": "string" + } + ] + } + ], + "commands": [ + { + "name": "disable", + "description": "Disables animation domain notifications." + }, + { + "name": "enable", + "description": "Enables animation domain notifications." + }, + { + "name": "getCurrentTime", + "description": "Returns the current time of the an animation.", + "parameters": [ + { + "name": "id", + "description": "Id of animation.", + "type": "string" + } + ], + "returns": [ + { + "name": "currentTime", + "description": "Current time of the page.", + "type": "number" + } + ] + }, + { + "name": "getPlaybackRate", + "description": "Gets the playback rate of the document timeline.", + "returns": [ + { + "name": "playbackRate", + "description": "Playback rate for animations on page.", + "type": "number" + } + ] + }, + { + "name": "releaseAnimations", + "description": "Releases a set of animations to no longer be manipulated.", + "parameters": [ + { + "name": "animations", + "description": "List of animation ids to seek.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "resolveAnimation", + "description": "Gets the remote object of the Animation.", + "parameters": [ + { + "name": "animationId", + "description": "Animation id.", + "type": "string" + } + ], + "returns": [ + { + "name": "remoteObject", + "description": "Corresponding remote object.", + "$ref": "Runtime.RemoteObject" + } + ] + }, + { + "name": "seekAnimations", + "description": "Seek a set of animations to a particular time within each animation.", + "parameters": [ + { + "name": "animations", + "description": "List of animation ids to seek.", + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "currentTime", + "description": "Set the current time of each animation.", + "type": "number" + } + ] + }, + { + "name": "setPaused", + "description": "Sets the paused state of a set of animations.", + "parameters": [ + { + "name": "animations", + "description": "Animations to set the pause state of.", + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "paused", + "description": "Paused state to set to.", + "type": "boolean" + } + ] + }, + { + "name": "setPlaybackRate", + "description": "Sets the playback rate of the document timeline.", + "parameters": [ + { + "name": "playbackRate", + "description": "Playback rate for animations on page", + "type": "number" + } + ] + }, + { + "name": "setTiming", + "description": "Sets the timing of an animation node.", + "parameters": [ + { + "name": "animationId", + "description": "Animation id.", + "type": "string" + }, + { + "name": "duration", + "description": "Duration of the animation.", + "type": "number" + }, + { + "name": "delay", + "description": "Delay of the animation.", + "type": "number" + } + ] + } + ], + "events": [ + { + "name": "animationCanceled", + "description": "Event for when an animation has been cancelled.", + "parameters": [ + { + "name": "id", + "description": "Id of the animation that was cancelled.", + "type": "string" + } + ] + }, + { + "name": "animationCreated", + "description": "Event for each animation that has been created.", + "parameters": [ + { + "name": "id", + "description": "Id of the animation that was created.", + "type": "string" + } + ] + }, + { + "name": "animationStarted", + "description": "Event for animation that has been started.", + "parameters": [ + { + "name": "animation", + "description": "Animation that was started.", + "$ref": "Animation" + } + ] + } + ] + }, + { + "domain": "ApplicationCache", + "experimental": true, + "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 inspector domain notifications." + "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.", + "experimental": true, + "dependencies": [ + "Network" + ], + "commands": [ + { + "name": "getEncodedResponse", + "description": "Returns the response body and size if it were re-encoded with the specified settings. Only\napplies to images.", + "parameters": [ + { + "name": "requestId", + "description": "Identifier of the network request to get content for.", + "$ref": "Network.RequestId" + }, + { + "name": "encoding", + "description": "The encoding to use.", + "type": "string", + "enum": [ + "webp", + "jpeg", + "png" + ] + }, + { + "name": "quality", + "description": "The quality of the encoding (0-1). (defaults to 1)", + "optional": true, + "type": "number" + }, + { + "name": "sizeOnly", + "description": "Whether to only return the size information (defaults to false).", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "body", + "description": "The encoded body as a base64 string. Omitted if sizeOnly is true.", + "optional": true, + "type": "string" + }, + { + "name": "originalSize", + "description": "Size before re-encoding.", + "type": "integer" + }, + { + "name": "encodedSize", + "description": "Size after re-encoding.", + "type": "integer" + } + ] + } + ] + }, + { + "domain": "Browser", + "description": "The Browser domain defines methods and events for browser managing.", + "types": [ + { + "id": "WindowID", + "experimental": true, + "type": "integer" + }, + { + "id": "WindowState", + "description": "The state of the browser window.", + "experimental": true, + "type": "string", + "enum": [ + "normal", + "minimized", + "maximized", + "fullscreen" + ] + }, + { + "id": "Bounds", + "description": "Browser window bounds information", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "left", + "description": "The offset from the left edge of the screen to the window in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "top", + "description": "The offset from the top edge of the screen to the window in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "width", + "description": "The window width in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "height", + "description": "The window height in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "windowState", + "description": "The window state. Default to normal.", + "optional": true, + "$ref": "WindowState" + } + ] + } + ], + "commands": [ + { + "name": "close", + "description": "Close browser gracefully." + }, + { + "name": "getVersion", + "description": "Returns version information.", + "returns": [ + { + "name": "protocolVersion", + "description": "Protocol version.", + "type": "string" + }, + { + "name": "product", + "description": "Product name.", + "type": "string" + }, + { + "name": "revision", + "description": "Product revision.", + "type": "string" + }, + { + "name": "userAgent", + "description": "User-Agent.", + "type": "string" + }, + { + "name": "jsVersion", + "description": "V8 version.", + "type": "string" + } + ] + }, + { + "name": "getWindowBounds", + "description": "Get position and size of the browser window.", + "experimental": true, + "parameters": [ + { + "name": "windowId", + "description": "Browser window id.", + "$ref": "WindowID" + } + ], + "returns": [ + { + "name": "bounds", + "description": "Bounds information of the window. When window state is 'minimized', the restored window\nposition and size are returned.", + "$ref": "Bounds" + } + ] + }, + { + "name": "getWindowForTarget", + "description": "Get the browser window that contains the devtools target.", + "experimental": true, + "parameters": [ + { + "name": "targetId", + "description": "Devtools agent host id.", + "$ref": "Target.TargetID" + } + ], + "returns": [ + { + "name": "windowId", + "description": "Browser window id.", + "$ref": "WindowID" + }, + { + "name": "bounds", + "description": "Bounds information of the window. When window state is 'minimized', the restored window\nposition and size are returned.", + "$ref": "Bounds" + } + ] + }, + { + "name": "setWindowBounds", + "description": "Set position and/or size of the browser window.", + "experimental": true, + "parameters": [ + { + "name": "windowId", + "description": "Browser window id.", + "$ref": "WindowID" + }, + { + "name": "bounds", + "description": "New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined\nwith 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.", + "$ref": "Bounds" + } + ] + } + ] + }, + { + "domain": "CSS", + "description": "This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles)\nhave an associated `id` used in subsequent operations on the related object. Each object type has\na specific `id` structure, and those are not interchangeable between objects of different kinds.\nCSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client\ncan also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and\nsubsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.", + "experimental": true, + "dependencies": [ + "DOM" + ], + "types": [ + { + "id": "StyleSheetId", + "type": "string" + }, + { + "id": "StyleSheetOrigin", + "description": "Stylesheet type: \"injected\" for stylesheets injected via extension, \"user-agent\" for user-agent\nstylesheets, \"inspector\" for stylesheets created by the inspector (i.e. those holding the \"via\ninspector\" rules), \"regular\" for regular stylesheets.", + "type": "string", + "enum": [ + "injected", + "user-agent", + "inspector", + "regular" + ] + }, + { + "id": "PseudoElementMatches", + "description": "CSS rule collection for a single pseudo style.", + "type": "object", + "properties": [ + { + "name": "pseudoType", + "description": "Pseudo element type.", + "$ref": "DOM.PseudoType" + }, + { + "name": "matches", + "description": "Matches of CSS rules applicable to the pseudo style.", + "type": "array", + "items": { + "$ref": "RuleMatch" + } + } + ] + }, + { + "id": "InheritedStyleEntry", + "description": "Inherited CSS rule collection from ancestor node.", + "type": "object", + "properties": [ + { + "name": "inlineStyle", + "description": "The ancestor node's inline style, if any, in the style inheritance chain.", + "optional": true, + "$ref": "CSSStyle" + }, + { + "name": "matchedCSSRules", + "description": "Matches of CSS rules matching the ancestor node in the style inheritance chain.", + "type": "array", + "items": { + "$ref": "RuleMatch" + } + } + ] + }, + { + "id": "RuleMatch", + "description": "Match data for a CSS rule.", + "type": "object", + "properties": [ + { + "name": "rule", + "description": "CSS rule in the match.", + "$ref": "CSSRule" + }, + { + "name": "matchingSelectors", + "description": "Matching selector indices in the rule's selectorList selectors (0-based).", + "type": "array", + "items": { + "type": "integer" + } + } + ] + }, + { + "id": "Value", + "description": "Data for a simple selector (these are delimited by commas in a selector list).", + "type": "object", + "properties": [ + { + "name": "text", + "description": "Value text.", + "type": "string" + }, + { + "name": "range", + "description": "Value range in the underlying resource (if available).", + "optional": true, + "$ref": "SourceRange" + } + ] + }, + { + "id": "SelectorList", + "description": "Selector list data.", + "type": "object", + "properties": [ + { + "name": "selectors", + "description": "Selectors in the list.", + "type": "array", + "items": { + "$ref": "Value" + } + }, + { + "name": "text", + "description": "Rule selector text.", + "type": "string" + } + ] + }, + { + "id": "CSSStyleSheetHeader", + "description": "CSS stylesheet metainformation.", + "type": "object", + "properties": [ + { + "name": "styleSheetId", + "description": "The stylesheet identifier.", + "$ref": "StyleSheetId" + }, + { + "name": "frameId", + "description": "Owner frame identifier.", + "$ref": "Page.FrameId" + }, + { + "name": "sourceURL", + "description": "Stylesheet resource URL.", + "type": "string" + }, + { + "name": "sourceMapURL", + "description": "URL of source map associated with the stylesheet (if any).", + "optional": true, + "type": "string" + }, + { + "name": "origin", + "description": "Stylesheet origin.", + "$ref": "StyleSheetOrigin" + }, + { + "name": "title", + "description": "Stylesheet title.", + "type": "string" + }, + { + "name": "ownerNode", + "description": "The backend id for the owner node of the stylesheet.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "disabled", + "description": "Denotes whether the stylesheet is disabled.", + "type": "boolean" + }, + { + "name": "hasSourceURL", + "description": "Whether the sourceURL field value comes from the sourceURL comment.", + "optional": true, + "type": "boolean" + }, + { + "name": "isInline", + "description": "Whether this stylesheet is created for STYLE tag by parser. This flag is not set for\ndocument.written STYLE tags.", + "type": "boolean" + }, + { + "name": "startLine", + "description": "Line offset of the stylesheet within the resource (zero based).", + "type": "number" + }, + { + "name": "startColumn", + "description": "Column offset of the stylesheet within the resource (zero based).", + "type": "number" + }, + { + "name": "length", + "description": "Size of the content (in characters).", + "type": "number" + } + ] + }, + { + "id": "CSSRule", + "description": "CSS rule representation.", + "type": "object", + "properties": [ + { + "name": "styleSheetId", + "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", + "optional": true, + "$ref": "StyleSheetId" + }, + { + "name": "selectorList", + "description": "Rule selector data.", + "$ref": "SelectorList" + }, + { + "name": "origin", + "description": "Parent stylesheet's origin.", + "$ref": "StyleSheetOrigin" + }, + { + "name": "style", + "description": "Associated style declaration.", + "$ref": "CSSStyle" + }, + { + "name": "media", + "description": "Media list array (for rules involving media queries). The array enumerates media queries\nstarting with the innermost one, going outwards.", + "optional": true, + "type": "array", + "items": { + "$ref": "CSSMedia" + } + } + ] + }, + { + "id": "RuleUsage", + "description": "CSS coverage information.", + "type": "object", + "properties": [ + { + "name": "styleSheetId", + "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", + "$ref": "StyleSheetId" + }, + { + "name": "startOffset", + "description": "Offset of the start of the rule (including selector) from the beginning of the stylesheet.", + "type": "number" + }, + { + "name": "endOffset", + "description": "Offset of the end of the rule body from the beginning of the stylesheet.", + "type": "number" + }, + { + "name": "used", + "description": "Indicates whether the rule was actually used by some element in the page.", + "type": "boolean" + } + ] + }, + { + "id": "SourceRange", + "description": "Text range within a resource. All numbers are zero-based.", + "type": "object", + "properties": [ + { + "name": "startLine", + "description": "Start line of range.", + "type": "integer" + }, + { + "name": "startColumn", + "description": "Start column of range (inclusive).", + "type": "integer" + }, + { + "name": "endLine", + "description": "End line of range", + "type": "integer" + }, + { + "name": "endColumn", + "description": "End column of range (exclusive).", + "type": "integer" + } + ] + }, + { + "id": "ShorthandEntry", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Shorthand name.", + "type": "string" + }, + { + "name": "value", + "description": "Shorthand value.", + "type": "string" + }, + { + "name": "important", + "description": "Whether the property has \"!important\" annotation (implies `false` if absent).", + "optional": true, + "type": "boolean" + } + ] + }, + { + "id": "CSSComputedStyleProperty", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Computed style property name.", + "type": "string" + }, + { + "name": "value", + "description": "Computed style property value.", + "type": "string" + } + ] + }, + { + "id": "CSSStyle", + "description": "CSS style representation.", + "type": "object", + "properties": [ + { + "name": "styleSheetId", + "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", + "optional": true, + "$ref": "StyleSheetId" + }, + { + "name": "cssProperties", + "description": "CSS properties in the style.", + "type": "array", + "items": { + "$ref": "CSSProperty" + } + }, + { + "name": "shorthandEntries", + "description": "Computed values for all shorthands found in the style.", + "type": "array", + "items": { + "$ref": "ShorthandEntry" + } + }, + { + "name": "cssText", + "description": "Style declaration text (if available).", + "optional": true, + "type": "string" + }, + { + "name": "range", + "description": "Style declaration range in the enclosing stylesheet (if available).", + "optional": true, + "$ref": "SourceRange" + } + ] + }, + { + "id": "CSSProperty", + "description": "CSS property declaration data.", + "type": "object", + "properties": [ + { + "name": "name", + "description": "The property name.", + "type": "string" + }, + { + "name": "value", + "description": "The property value.", + "type": "string" + }, + { + "name": "important", + "description": "Whether the property has \"!important\" annotation (implies `false` if absent).", + "optional": true, + "type": "boolean" + }, + { + "name": "implicit", + "description": "Whether the property is implicit (implies `false` if absent).", + "optional": true, + "type": "boolean" + }, + { + "name": "text", + "description": "The full property text as specified in the style.", + "optional": true, + "type": "string" + }, + { + "name": "parsedOk", + "description": "Whether the property is understood by the browser (implies `true` if absent).", + "optional": true, + "type": "boolean" + }, + { + "name": "disabled", + "description": "Whether the property is disabled by the user (present for source-based properties only).", + "optional": true, + "type": "boolean" + }, + { + "name": "range", + "description": "The entire property range in the enclosing style declaration (if available).", + "optional": true, + "$ref": "SourceRange" + } + ] + }, + { + "id": "CSSMedia", + "description": "CSS media rule descriptor.", + "type": "object", + "properties": [ + { + "name": "text", + "description": "Media query text.", + "type": "string" + }, + { + "name": "source", + "description": "Source of the media query: \"mediaRule\" if specified by a @media rule, \"importRule\" if\nspecified by an @import rule, \"linkedSheet\" if specified by a \"media\" attribute in a linked\nstylesheet's LINK tag, \"inlineSheet\" if specified by a \"media\" attribute in an inline\nstylesheet's STYLE tag.", + "type": "string", + "enum": [ + "mediaRule", + "importRule", + "linkedSheet", + "inlineSheet" + ] + }, + { + "name": "sourceURL", + "description": "URL of the document containing the media query description.", + "optional": true, + "type": "string" + }, + { + "name": "range", + "description": "The associated rule (@media or @import) header range in the enclosing stylesheet (if\navailable).", + "optional": true, + "$ref": "SourceRange" + }, + { + "name": "styleSheetId", + "description": "Identifier of the stylesheet containing this object (if exists).", + "optional": true, + "$ref": "StyleSheetId" + }, + { + "name": "mediaList", + "description": "Array of media queries.", + "optional": true, + "type": "array", + "items": { + "$ref": "MediaQuery" + } + } + ] + }, + { + "id": "MediaQuery", + "description": "Media query descriptor.", + "type": "object", + "properties": [ + { + "name": "expressions", + "description": "Array of media query expressions.", + "type": "array", + "items": { + "$ref": "MediaQueryExpression" + } + }, + { + "name": "active", + "description": "Whether the media query condition is satisfied.", + "type": "boolean" + } + ] + }, + { + "id": "MediaQueryExpression", + "description": "Media query expression descriptor.", + "type": "object", + "properties": [ + { + "name": "value", + "description": "Media query expression value.", + "type": "number" + }, + { + "name": "unit", + "description": "Media query expression units.", + "type": "string" + }, + { + "name": "feature", + "description": "Media query expression feature.", + "type": "string" + }, + { + "name": "valueRange", + "description": "The associated range of the value text in the enclosing stylesheet (if available).", + "optional": true, + "$ref": "SourceRange" + }, + { + "name": "computedLength", + "description": "Computed length of media query expression (if applicable).", + "optional": true, + "type": "number" + } + ] + }, + { + "id": "PlatformFontUsage", + "description": "Information about amount of glyphs that were rendered with given font.", + "type": "object", + "properties": [ + { + "name": "familyName", + "description": "Font's family name reported by platform.", + "type": "string" + }, + { + "name": "isCustomFont", + "description": "Indicates if the font was downloaded or resolved locally.", + "type": "boolean" + }, + { + "name": "glyphCount", + "description": "Amount of glyphs that were rendered with this font.", + "type": "number" + } + ] + }, + { + "id": "CSSKeyframesRule", + "description": "CSS keyframes rule representation.", + "type": "object", + "properties": [ + { + "name": "animationName", + "description": "Animation name.", + "$ref": "Value" + }, + { + "name": "keyframes", + "description": "List of keyframes.", + "type": "array", + "items": { + "$ref": "CSSKeyframeRule" + } + } + ] + }, + { + "id": "CSSKeyframeRule", + "description": "CSS keyframe rule representation.", + "type": "object", + "properties": [ + { + "name": "styleSheetId", + "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", + "optional": true, + "$ref": "StyleSheetId" + }, + { + "name": "origin", + "description": "Parent stylesheet's origin.", + "$ref": "StyleSheetOrigin" + }, + { + "name": "keyText", + "description": "Associated key text.", + "$ref": "Value" + }, + { + "name": "style", + "description": "Associated style declaration.", + "$ref": "CSSStyle" + } + ] + }, + { + "id": "StyleDeclarationEdit", + "description": "A descriptor of operation to mutate style declaration text.", + "type": "object", + "properties": [ + { + "name": "styleSheetId", + "description": "The css style sheet identifier.", + "$ref": "StyleSheetId" + }, + { + "name": "range", + "description": "The range of the style text in the enclosing stylesheet.", + "$ref": "SourceRange" + }, + { + "name": "text", + "description": "New style text.", + "type": "string" + } + ] + } + ], + "commands": [ + { + "name": "addRule", + "description": "Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the\nposition specified by `location`.", + "parameters": [ + { + "name": "styleSheetId", + "description": "The css style sheet identifier where a new rule should be inserted.", + "$ref": "StyleSheetId" + }, + { + "name": "ruleText", + "description": "The text of a new rule.", + "type": "string" + }, + { + "name": "location", + "description": "Text position of a new rule in the target style sheet.", + "$ref": "SourceRange" + } + ], + "returns": [ + { + "name": "rule", + "description": "The newly created rule.", + "$ref": "CSSRule" + } + ] + }, + { + "name": "collectClassNames", + "description": "Returns all class names from specified stylesheet.", + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + } + ], + "returns": [ + { + "name": "classNames", + "description": "Class name list.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "createStyleSheet", + "description": "Creates a new special \"via-inspector\" stylesheet in the frame with given `frameId`.", + "parameters": [ + { + "name": "frameId", + "description": "Identifier of the frame where \"via-inspector\" stylesheet should be created.", + "$ref": "Page.FrameId" + } + ], + "returns": [ + { + "name": "styleSheetId", + "description": "Identifier of the created \"via-inspector\" stylesheet.", + "$ref": "StyleSheetId" + } + ] }, + { + "name": "disable", + "description": "Disables the CSS agent for the given page." + }, + { + "name": "enable", + "description": "Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been\nenabled until the result of this command is received." + }, + { + "name": "forcePseudoState", + "description": "Ensures that the given node will have specified pseudo-classes whenever its style is computed by\nthe browser.", + "parameters": [ + { + "name": "nodeId", + "description": "The element id for which to force the pseudo state.", + "$ref": "DOM.NodeId" + }, + { + "name": "forcedPseudoClasses", + "description": "Element pseudo classes to force when computing the element's style.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "getBackgroundColors", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to get background colors for.", + "$ref": "DOM.NodeId" + } + ], + "returns": [ + { + "name": "backgroundColors", + "description": "The range of background colors behind this element, if it contains any visible text. If no\nvisible text is present, this will be undefined. In the case of a flat background color,\nthis will consist of simply that color. In the case of a gradient, this will consist of each\nof the color stops. For anything more complicated, this will be an empty array. Images will\nbe ignored (as if the image had failed to load).", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "computedFontSize", + "description": "The computed font size for this node, as a CSS computed value string (e.g. '12px').", + "optional": true, + "type": "string" + }, + { + "name": "computedFontWeight", + "description": "The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or\n'100').", + "optional": true, + "type": "string" + }, + { + "name": "computedBodyFontSize", + "description": "The computed font size for the document body, as a computed CSS value string (e.g. '16px').", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "getComputedStyleForNode", + "description": "Returns the computed style for a DOM node identified by `nodeId`.", + "parameters": [ + { + "name": "nodeId", + "$ref": "DOM.NodeId" + } + ], + "returns": [ + { + "name": "computedStyle", + "description": "Computed style for the specified DOM node.", + "type": "array", + "items": { + "$ref": "CSSComputedStyleProperty" + } + } + ] + }, + { + "name": "getInlineStylesForNode", + "description": "Returns the styles defined inline (explicitly in the \"style\" attribute and implicitly, using DOM\nattributes) for a DOM node identified by `nodeId`.", + "parameters": [ + { + "name": "nodeId", + "$ref": "DOM.NodeId" + } + ], + "returns": [ + { + "name": "inlineStyle", + "description": "Inline style for the specified DOM node.", + "optional": true, + "$ref": "CSSStyle" + }, + { + "name": "attributesStyle", + "description": "Attribute-defined element style (e.g. resulting from \"width=20 height=100%\").", + "optional": true, + "$ref": "CSSStyle" + } + ] + }, + { + "name": "getMatchedStylesForNode", + "description": "Returns requested styles for a DOM node identified by `nodeId`.", + "parameters": [ + { + "name": "nodeId", + "$ref": "DOM.NodeId" + } + ], + "returns": [ + { + "name": "inlineStyle", + "description": "Inline style for the specified DOM node.", + "optional": true, + "$ref": "CSSStyle" + }, + { + "name": "attributesStyle", + "description": "Attribute-defined element style (e.g. resulting from \"width=20 height=100%\").", + "optional": true, + "$ref": "CSSStyle" + }, + { + "name": "matchedCSSRules", + "description": "CSS rules matching this node, from all applicable stylesheets.", + "optional": true, + "type": "array", + "items": { + "$ref": "RuleMatch" + } + }, + { + "name": "pseudoElements", + "description": "Pseudo style matches for this node.", + "optional": true, + "type": "array", + "items": { + "$ref": "PseudoElementMatches" + } + }, + { + "name": "inherited", + "description": "A chain of inherited styles (from the immediate node parent up to the DOM tree root).", + "optional": true, + "type": "array", + "items": { + "$ref": "InheritedStyleEntry" + } + }, + { + "name": "cssKeyframesRules", + "description": "A list of CSS keyframed animations matching this node.", + "optional": true, + "type": "array", + "items": { + "$ref": "CSSKeyframesRule" + } + } + ] + }, + { + "name": "getMediaQueries", + "description": "Returns all media queries parsed by the rendering engine.", + "returns": [ + { + "name": "medias", + "type": "array", + "items": { + "$ref": "CSSMedia" + } + } + ] + }, + { + "name": "getPlatformFontsForNode", + "description": "Requests information about platform fonts which we used to render child TextNodes in the given\nnode.", + "parameters": [ + { + "name": "nodeId", + "$ref": "DOM.NodeId" + } + ], + "returns": [ + { + "name": "fonts", + "description": "Usage statistics for every employed platform font.", + "type": "array", + "items": { + "$ref": "PlatformFontUsage" + } + } + ] + }, + { + "name": "getStyleSheetText", + "description": "Returns the current textual content and the URL for a stylesheet.", + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + } + ], + "returns": [ + { + "name": "text", + "description": "The stylesheet text.", + "type": "string" + } + ] + }, + { + "name": "setEffectivePropertyValueForNode", + "description": "Find a rule with the given active property for the given node and set the new value for this\nproperty", + "parameters": [ + { + "name": "nodeId", + "description": "The element id for which to set property.", + "$ref": "DOM.NodeId" + }, + { + "name": "propertyName", + "type": "string" + }, + { + "name": "value", + "type": "string" + } + ] + }, + { + "name": "setKeyframeKey", + "description": "Modifies the keyframe rule key text.", + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + }, + { + "name": "range", + "$ref": "SourceRange" + }, + { + "name": "keyText", + "type": "string" + } + ], + "returns": [ + { + "name": "keyText", + "description": "The resulting key text after modification.", + "$ref": "Value" + } + ] + }, + { + "name": "setMediaText", + "description": "Modifies the rule selector.", + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + }, + { + "name": "range", + "$ref": "SourceRange" + }, + { + "name": "text", + "type": "string" + } + ], + "returns": [ + { + "name": "media", + "description": "The resulting CSS media rule after modification.", + "$ref": "CSSMedia" + } + ] + }, + { + "name": "setRuleSelector", + "description": "Modifies the rule selector.", + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + }, + { + "name": "range", + "$ref": "SourceRange" + }, + { + "name": "selector", + "type": "string" + } + ], + "returns": [ + { + "name": "selectorList", + "description": "The resulting selector list after modification.", + "$ref": "SelectorList" + } + ] + }, + { + "name": "setStyleSheetText", + "description": "Sets the new stylesheet text.", + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + }, + { + "name": "text", + "type": "string" + } + ], + "returns": [ + { + "name": "sourceMapURL", + "description": "URL of source map associated with script (if any).", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "setStyleTexts", + "description": "Applies specified style edits one after another in the given order.", + "parameters": [ + { + "name": "edits", + "type": "array", + "items": { + "$ref": "StyleDeclarationEdit" + } + } + ], + "returns": [ + { + "name": "styles", + "description": "The resulting styles after modification.", + "type": "array", + "items": { + "$ref": "CSSStyle" + } + } + ] + }, + { + "name": "startRuleUsageTracking", + "description": "Enables the selector recording." + }, + { + "name": "stopRuleUsageTracking", + "description": "The list of rules with an indication of whether these were used", + "returns": [ + { + "name": "ruleUsage", + "type": "array", + "items": { + "$ref": "RuleUsage" + } + } + ] + }, + { + "name": "takeCoverageDelta", + "description": "Obtain list of rules that became used since last call to this method (or since start of coverage\ninstrumentation)", + "returns": [ + { + "name": "coverage", + "type": "array", + "items": { + "$ref": "RuleUsage" + } + } + ] + } + ], + "events": [ + { + "name": "fontsUpdated", + "description": "Fires whenever a web font gets loaded." + }, + { + "name": "mediaQueryResultChanged", + "description": "Fires whenever a MediaQuery result changes (for example, after a browser window has been\nresized.) The current implementation considers only viewport-dependent media features." + }, + { + "name": "styleSheetAdded", + "description": "Fired whenever an active document stylesheet is added.", + "parameters": [ + { + "name": "header", + "description": "Added stylesheet metainfo.", + "$ref": "CSSStyleSheetHeader" + } + ] + }, + { + "name": "styleSheetChanged", + "description": "Fired whenever a stylesheet is changed as a result of the client operation.", + "parameters": [ + { + "name": "styleSheetId", + "$ref": "StyleSheetId" + } + ] + }, + { + "name": "styleSheetRemoved", + "description": "Fired whenever an active document stylesheet is removed.", + "parameters": [ + { + "name": "styleSheetId", + "description": "Identifier of the removed stylesheet.", + "$ref": "StyleSheetId" + } + ] + } + ] + }, + { + "domain": "CacheStorage", + "experimental": true, + "types": [ + { + "id": "CacheId", + "description": "Unique identifier of the Cache object.", + "type": "string" + }, + { + "id": "DataEntry", + "description": "Data entry.", + "type": "object", + "properties": [ + { + "name": "requestURL", + "description": "Request URL.", + "type": "string" + }, + { + "name": "requestMethod", + "description": "Request method.", + "type": "string" + }, + { + "name": "requestHeaders", + "description": "Request headers", + "type": "array", + "items": { + "$ref": "Header" + } + }, + { + "name": "responseTime", + "description": "Number of seconds since epoch.", + "type": "number" + }, + { + "name": "responseStatus", + "description": "HTTP response status code.", + "type": "integer" + }, + { + "name": "responseStatusText", + "description": "HTTP response status text.", + "type": "string" + }, + { + "name": "responseHeaders", + "description": "Response headers", + "type": "array", + "items": { + "$ref": "Header" + } + } + ] + }, + { + "id": "Cache", + "description": "Cache identifier.", + "type": "object", + "properties": [ + { + "name": "cacheId", + "description": "An opaque unique id of the cache.", + "$ref": "CacheId" + }, + { + "name": "securityOrigin", + "description": "Security origin of the cache.", + "type": "string" + }, + { + "name": "cacheName", + "description": "The name of the cache.", + "type": "string" + } + ] + }, + { + "id": "Header", + "type": "object", + "properties": [ + { + "name": "name", + "type": "string" + }, + { + "name": "value", + "type": "string" + } + ] + }, + { + "id": "CachedResponse", + "description": "Cached response", + "type": "object", + "properties": [ + { + "name": "body", + "description": "Entry content, base64-encoded.", + "type": "string" + } + ] + } + ], + "commands": [ + { + "name": "deleteCache", + "description": "Deletes a cache.", + "parameters": [ + { + "name": "cacheId", + "description": "Id of cache for deletion.", + "$ref": "CacheId" + } + ] + }, + { + "name": "deleteEntry", + "description": "Deletes a cache entry.", + "parameters": [ + { + "name": "cacheId", + "description": "Id of cache where the entry will be deleted.", + "$ref": "CacheId" + }, + { + "name": "request", + "description": "URL spec of the request.", + "type": "string" + } + ] + }, + { + "name": "requestCacheNames", + "description": "Requests cache names.", + "parameters": [ + { + "name": "securityOrigin", + "description": "Security origin.", + "type": "string" + } + ], + "returns": [ + { + "name": "caches", + "description": "Caches for the security origin.", + "type": "array", + "items": { + "$ref": "Cache" + } + } + ] + }, + { + "name": "requestCachedResponse", + "description": "Fetches cache entry.", + "parameters": [ + { + "name": "cacheId", + "description": "Id of cache that contains the enty.", + "$ref": "CacheId" + }, + { + "name": "requestURL", + "description": "URL spec of the request.", + "type": "string" + } + ], + "returns": [ + { + "name": "response", + "description": "Response read from the cache.", + "$ref": "CachedResponse" + } + ] + }, + { + "name": "requestEntries", + "description": "Requests data from cache.", + "parameters": [ + { + "name": "cacheId", + "description": "ID of cache to get entries from.", + "$ref": "CacheId" + }, + { + "name": "skipCount", + "description": "Number of records to skip.", + "type": "integer" + }, + { + "name": "pageSize", + "description": "Number of records to fetch.", + "type": "integer" + } + ], + "returns": [ + { + "name": "cacheDataEntries", + "description": "Array of object store data entries.", + "type": "array", + "items": { + "$ref": "DataEntry" + } + }, + { + "name": "hasMore", + "description": "If true, there are more entries to fetch in the given range.", + "type": "boolean" + } + ] + } + ] + }, + { + "domain": "DOM", + "description": "This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object\nthat has an `id`. This `id` can be used to get additional information on the Node, resolve it into\nthe JavaScript object wrapper, etc. It is important that client receives DOM events only for the\nnodes that are known to the client. Backend keeps track of the nodes that were sent to the client\nand never sends the same node twice. It is client's responsibility to collect information about\nthe nodes that were sent to the client.Note that `iframe` owner elements will return\ncorresponding document elements as their child nodes.", + "dependencies": [ + "Runtime" + ], + "types": [ + { + "id": "NodeId", + "description": "Unique DOM node identifier.", + "type": "integer" + }, + { + "id": "BackendNodeId", + "description": "Unique DOM node identifier used to reference a node that may not have been pushed to the\nfront-end.", + "type": "integer" + }, + { + "id": "BackendNode", + "description": "Backend node with a friendly name.", + "type": "object", + "properties": [ + { + "name": "nodeType", + "description": "`Node`'s nodeType.", + "type": "integer" + }, + { + "name": "nodeName", + "description": "`Node`'s nodeName.", + "type": "string" + }, + { + "name": "backendNodeId", + "$ref": "BackendNodeId" + } + ] + }, + { + "id": "PseudoType", + "description": "Pseudo element type.", + "type": "string", + "enum": [ + "first-line", + "first-letter", + "before", + "after", + "backdrop", + "selection", + "first-line-inherited", + "scrollbar", + "scrollbar-thumb", + "scrollbar-button", + "scrollbar-track", + "scrollbar-track-piece", + "scrollbar-corner", + "resizer", + "input-list-button" + ] + }, + { + "id": "ShadowRootType", + "description": "Shadow root type.", + "type": "string", + "enum": [ + "user-agent", + "open", + "closed" + ] + }, + { + "id": "Node", + "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.\nDOMNode is a base node mirror type.", + "type": "object", + "properties": [ + { + "name": "nodeId", + "description": "Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend\nwill only push node with given `id` once. It is aware of all requested nodes and will only\nfire DOM events for nodes known to the client.", + "$ref": "NodeId" + }, + { + "name": "parentId", + "description": "The id of the parent node if any.", + "optional": true, + "$ref": "NodeId" + }, + { + "name": "backendNodeId", + "description": "The BackendNodeId for this node.", + "$ref": "BackendNodeId" + }, + { + "name": "nodeType", + "description": "`Node`'s nodeType.", + "type": "integer" + }, + { + "name": "nodeName", + "description": "`Node`'s nodeName.", + "type": "string" + }, + { + "name": "localName", + "description": "`Node`'s localName.", + "type": "string" + }, + { + "name": "nodeValue", + "description": "`Node`'s nodeValue.", + "type": "string" + }, + { + "name": "childNodeCount", + "description": "Child count for `Container` nodes.", + "optional": true, + "type": "integer" + }, + { + "name": "children", + "description": "Child nodes of this node when requested with children.", + "optional": true, + "type": "array", + "items": { + "$ref": "Node" + } + }, + { + "name": "attributes", + "description": "Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`.", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "documentURL", + "description": "Document URL that `Document` or `FrameOwner` node points to.", + "optional": true, + "type": "string" + }, + { + "name": "baseURL", + "description": "Base URL that `Document` or `FrameOwner` node uses for URL completion.", + "optional": true, + "type": "string" + }, + { + "name": "publicId", + "description": "`DocumentType`'s publicId.", + "optional": true, + "type": "string" + }, + { + "name": "systemId", + "description": "`DocumentType`'s systemId.", + "optional": true, + "type": "string" + }, + { + "name": "internalSubset", + "description": "`DocumentType`'s internalSubset.", + "optional": true, + "type": "string" + }, + { + "name": "xmlVersion", + "description": "`Document`'s XML version in case of XML documents.", + "optional": true, + "type": "string" + }, + { + "name": "name", + "description": "`Attr`'s name.", + "optional": true, + "type": "string" + }, + { + "name": "value", + "description": "`Attr`'s value.", + "optional": true, + "type": "string" + }, + { + "name": "pseudoType", + "description": "Pseudo element type for this node.", + "optional": true, + "$ref": "PseudoType" + }, + { + "name": "shadowRootType", + "description": "Shadow root type.", + "optional": true, + "$ref": "ShadowRootType" + }, + { + "name": "frameId", + "description": "Frame ID for frame owner elements.", + "optional": true, + "$ref": "Page.FrameId" + }, + { + "name": "contentDocument", + "description": "Content document for frame owner elements.", + "optional": true, + "$ref": "Node" + }, + { + "name": "shadowRoots", + "description": "Shadow root list for given element host.", + "optional": true, + "type": "array", + "items": { + "$ref": "Node" + } + }, + { + "name": "templateContent", + "description": "Content document fragment for template elements.", + "optional": true, + "$ref": "Node" + }, + { + "name": "pseudoElements", + "description": "Pseudo elements associated with this node.", + "optional": true, + "type": "array", + "items": { + "$ref": "Node" + } + }, + { + "name": "importedDocument", + "description": "Import document for the HTMLImport links.", + "optional": true, + "$ref": "Node" + }, + { + "name": "distributedNodes", + "description": "Distributed nodes for given insertion point.", + "optional": true, + "type": "array", + "items": { + "$ref": "BackendNode" + } + }, + { + "name": "isSVG", + "description": "Whether the node is SVG.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "id": "RGBA", + "description": "A structure holding an RGBA color.", + "type": "object", + "properties": [ + { + "name": "r", + "description": "The red component, in the [0-255] range.", + "type": "integer" + }, + { + "name": "g", + "description": "The green component, in the [0-255] range.", + "type": "integer" + }, + { + "name": "b", + "description": "The blue component, in the [0-255] range.", + "type": "integer" + }, + { + "name": "a", + "description": "The alpha component, in the [0-1] range (default: 1).", + "optional": true, + "type": "number" + } + ] + }, + { + "id": "Quad", + "description": "An array of quad vertices, x immediately followed by y for each point, points clock-wise.", + "type": "array", + "items": { + "type": "number" + } + }, + { + "id": "BoxModel", + "description": "Box model.", + "type": "object", + "properties": [ + { + "name": "content", + "description": "Content box", + "$ref": "Quad" + }, + { + "name": "padding", + "description": "Padding box", + "$ref": "Quad" + }, + { + "name": "border", + "description": "Border box", + "$ref": "Quad" + }, + { + "name": "margin", + "description": "Margin box", + "$ref": "Quad" + }, + { + "name": "width", + "description": "Node width", + "type": "integer" + }, + { + "name": "height", + "description": "Node height", + "type": "integer" + }, + { + "name": "shapeOutside", + "description": "Shape outside coordinates", + "optional": true, + "$ref": "ShapeOutsideInfo" + } + ] + }, + { + "id": "ShapeOutsideInfo", + "description": "CSS Shape Outside details.", + "type": "object", + "properties": [ + { + "name": "bounds", + "description": "Shape bounds", + "$ref": "Quad" + }, + { + "name": "shape", + "description": "Shape coordinate details", + "type": "array", + "items": { + "type": "any" + } + }, + { + "name": "marginShape", + "description": "Margin shape bounds", + "type": "array", + "items": { + "type": "any" + } + } + ] + }, + { + "id": "Rect", + "description": "Rectangle.", + "type": "object", + "properties": [ + { + "name": "x", + "description": "X coordinate", + "type": "number" + }, + { + "name": "y", + "description": "Y coordinate", + "type": "number" + }, + { + "name": "width", + "description": "Rectangle width", + "type": "number" + }, + { + "name": "height", + "description": "Rectangle height", + "type": "number" + } + ] + } + ], + "commands": [ + { + "name": "collectClassNamesFromSubtree", + "description": "Collects class names for the node with given id and all of it's child nodes.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to collect class names.", + "$ref": "NodeId" + } + ], + "returns": [ + { + "name": "classNames", + "description": "Class name list.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "copyTo", + "description": "Creates a deep copy of the specified node and places it into the target container before the\ngiven anchor.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to copy.", + "$ref": "NodeId" + }, + { + "name": "targetNodeId", + "description": "Id of the element to drop the copy into.", + "$ref": "NodeId" + }, + { + "name": "insertBeforeNodeId", + "description": "Drop the copy before this node (if absent, the copy becomes the last child of\n`targetNodeId`).", + "optional": true, + "$ref": "NodeId" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "Id of the node clone.", + "$ref": "NodeId" + } + ] + }, + { + "name": "describeNode", + "description": "Describes node given its id, does not require domain to be enabled. Does not start tracking any\nobjects, can be used for automation.", + "parameters": [ + { + "name": "nodeId", + "description": "Identifier of the node.", + "optional": true, + "$ref": "NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node.", + "optional": true, + "$ref": "BackendNodeId" + }, + { + "name": "objectId", + "description": "JavaScript object id of the node wrapper.", + "optional": true, + "$ref": "Runtime.RemoteObjectId" + }, + { + "name": "depth", + "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\nentire subtree or provide an integer larger than 0.", + "optional": true, + "type": "integer" + }, + { + "name": "pierce", + "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree\n(default is false).", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "node", + "description": "Node description.", + "$ref": "Node" + } + ] + }, + { + "name": "disable", + "description": "Disables DOM agent for the given page." + }, + { + "name": "discardSearchResults", + "description": "Discards search results from the session with the given id. `getSearchResults` should no longer\nbe called for that search.", + "experimental": true, + "parameters": [ + { + "name": "searchId", + "description": "Unique search session identifier.", + "type": "string" + } + ] + }, + { + "name": "enable", + "description": "Enables DOM agent for the given page." + }, + { + "name": "focus", + "description": "Focuses the given element.", + "parameters": [ + { + "name": "nodeId", + "description": "Identifier of the node.", + "optional": true, + "$ref": "NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node.", + "optional": true, + "$ref": "BackendNodeId" + }, + { + "name": "objectId", + "description": "JavaScript object id of the node wrapper.", + "optional": true, + "$ref": "Runtime.RemoteObjectId" + } + ] + }, + { + "name": "getAttributes", + "description": "Returns attributes for the specified node.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to retrieve attibutes for.", + "$ref": "NodeId" + } + ], + "returns": [ + { + "name": "attributes", + "description": "An interleaved array of node attribute names and values.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "getBoxModel", + "description": "Returns boxes for the given node.", + "parameters": [ + { + "name": "nodeId", + "description": "Identifier of the node.", + "optional": true, + "$ref": "NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node.", + "optional": true, + "$ref": "BackendNodeId" + }, + { + "name": "objectId", + "description": "JavaScript object id of the node wrapper.", + "optional": true, + "$ref": "Runtime.RemoteObjectId" + } + ], + "returns": [ + { + "name": "model", + "description": "Box model for the node.", + "$ref": "BoxModel" + } + ] + }, + { + "name": "getDocument", + "description": "Returns the root DOM node (and optionally the subtree) to the caller.", + "parameters": [ + { + "name": "depth", + "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\nentire subtree or provide an integer larger than 0.", + "optional": true, + "type": "integer" + }, + { + "name": "pierce", + "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree\n(default is false).", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "root", + "description": "Resulting node.", + "$ref": "Node" + } + ] + }, + { + "name": "getFlattenedDocument", + "description": "Returns the root DOM node (and optionally the subtree) to the caller.", + "parameters": [ + { + "name": "depth", + "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\nentire subtree or provide an integer larger than 0.", + "optional": true, + "type": "integer" + }, + { + "name": "pierce", + "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree\n(default is false).", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "nodes", + "description": "Resulting node.", + "type": "array", + "items": { + "$ref": "Node" + } + } + ] + }, + { + "name": "getNodeForLocation", + "description": "Returns node id at given location.", + "experimental": true, + "parameters": [ + { + "name": "x", + "description": "X coordinate.", + "type": "integer" + }, + { + "name": "y", + "description": "Y coordinate.", + "type": "integer" + }, + { + "name": "includeUserAgentShadowDOM", + "description": "False to skip to the nearest non-UA shadow root ancestor (default: false).", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "Id of the node at given coordinates.", + "$ref": "NodeId" + } + ] + }, + { + "name": "getOuterHTML", + "description": "Returns node's HTML markup.", + "parameters": [ + { + "name": "nodeId", + "description": "Identifier of the node.", + "optional": true, + "$ref": "NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node.", + "optional": true, + "$ref": "BackendNodeId" + }, + { + "name": "objectId", + "description": "JavaScript object id of the node wrapper.", + "optional": true, + "$ref": "Runtime.RemoteObjectId" + } + ], + "returns": [ + { + "name": "outerHTML", + "description": "Outer HTML markup.", + "type": "string" + } + ] + }, + { + "name": "getRelayoutBoundary", + "description": "Returns the id of the nearest ancestor that is a relayout boundary.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node.", + "$ref": "NodeId" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "Relayout boundary node id for the given node.", + "$ref": "NodeId" + } + ] + }, + { + "name": "getSearchResults", + "description": "Returns search results from given `fromIndex` to given `toIndex` from the search with the given\nidentifier.", + "experimental": true, + "parameters": [ + { + "name": "searchId", + "description": "Unique search session identifier.", + "type": "string" + }, + { + "name": "fromIndex", + "description": "Start index of the search result to be returned.", + "type": "integer" + }, + { + "name": "toIndex", + "description": "End index of the search result to be returned.", + "type": "integer" + } + ], + "returns": [ + { + "name": "nodeIds", + "description": "Ids of the search result nodes.", + "type": "array", + "items": { + "$ref": "NodeId" + } + } + ] + }, + { + "name": "hideHighlight", + "description": "Hides any highlight.", + "redirect": "Overlay" + }, + { + "name": "highlightNode", + "description": "Highlights DOM node.", + "redirect": "Overlay" + }, + { + "name": "highlightRect", + "description": "Highlights given rectangle.", + "redirect": "Overlay" + }, + { + "name": "markUndoableState", + "description": "Marks last undoable state.", + "experimental": true + }, + { + "name": "moveTo", + "description": "Moves node into the new container, places it before the given anchor.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to move.", + "$ref": "NodeId" + }, + { + "name": "targetNodeId", + "description": "Id of the element to drop the moved node into.", + "$ref": "NodeId" + }, + { + "name": "insertBeforeNodeId", + "description": "Drop node before this one (if absent, the moved node becomes the last child of\n`targetNodeId`).", + "optional": true, + "$ref": "NodeId" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "New id of the moved node.", + "$ref": "NodeId" + } + ] + }, + { + "name": "performSearch", + "description": "Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or\n`cancelSearch` to end this search session.", + "experimental": true, + "parameters": [ + { + "name": "query", + "description": "Plain text or query selector or XPath search query.", + "type": "string" + }, + { + "name": "includeUserAgentShadowDOM", + "description": "True to search in user agent shadow DOM.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "searchId", + "description": "Unique search session identifier.", + "type": "string" + }, + { + "name": "resultCount", + "description": "Number of search results.", + "type": "integer" + } + ] + }, + { + "name": "pushNodeByPathToFrontend", + "description": "Requests that the node is sent to the caller given its path. // FIXME, use XPath", + "experimental": true, + "parameters": [ + { + "name": "path", + "description": "Path to node in the proprietary format.", + "type": "string" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "Id of the node for given path.", + "$ref": "NodeId" + } + ] + }, + { + "name": "pushNodesByBackendIdsToFrontend", + "description": "Requests that a batch of nodes is sent to the caller given their backend node ids.", + "experimental": true, + "parameters": [ + { + "name": "backendNodeIds", + "description": "The array of backend node ids.", + "type": "array", + "items": { + "$ref": "BackendNodeId" + } + } + ], + "returns": [ + { + "name": "nodeIds", + "description": "The array of ids of pushed nodes that correspond to the backend ids specified in\nbackendNodeIds.", + "type": "array", + "items": { + "$ref": "NodeId" + } + } + ] + }, + { + "name": "querySelector", + "description": "Executes `querySelector` on a given node.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to query upon.", + "$ref": "NodeId" + }, + { + "name": "selector", + "description": "Selector string.", + "type": "string" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "Query selector result.", + "$ref": "NodeId" + } + ] + }, + { + "name": "querySelectorAll", + "description": "Executes `querySelectorAll` on a given node.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to query upon.", + "$ref": "NodeId" + }, + { + "name": "selector", + "description": "Selector string.", + "type": "string" + } + ], + "returns": [ + { + "name": "nodeIds", + "description": "Query selector result.", + "type": "array", + "items": { + "$ref": "NodeId" + } + } + ] + }, + { + "name": "redo", + "description": "Re-does the last undone action.", + "experimental": true + }, + { + "name": "removeAttribute", + "description": "Removes attribute with given name from an element with given id.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the element to remove attribute from.", + "$ref": "NodeId" + }, + { + "name": "name", + "description": "Name of the attribute to remove.", + "type": "string" + } + ] + }, + { + "name": "removeNode", + "description": "Removes node with given id.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to remove.", + "$ref": "NodeId" + } + ] + }, + { + "name": "requestChildNodes", + "description": "Requests that children of the node with given id are returned to the caller in form of\n`setChildNodes` events where not only immediate children are retrieved, but all children down to\nthe specified depth.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to get children for.", + "$ref": "NodeId" + }, + { + "name": "depth", + "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\nentire subtree or provide an integer larger than 0.", + "optional": true, + "type": "integer" + }, + { + "name": "pierce", + "description": "Whether or not iframes and shadow roots should be traversed when returning the sub-tree\n(default is false).", + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "requestNode", + "description": "Requests that the node is sent to the caller given the JavaScript node object reference. All\nnodes that form the path from the node to the root are also sent to the client as a series of\n`setChildNodes` notifications.", + "parameters": [ + { + "name": "objectId", + "description": "JavaScript object id to convert into node.", + "$ref": "Runtime.RemoteObjectId" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "Node id for given object.", + "$ref": "NodeId" + } + ] + }, + { + "name": "resolveNode", + "description": "Resolves the JavaScript node object for a given NodeId or BackendNodeId.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to resolve.", + "optional": true, + "$ref": "NodeId" + }, + { + "name": "backendNodeId", + "description": "Backend identifier of the node to resolve.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "objectGroup", + "description": "Symbolic group name that can be used to release multiple objects.", + "optional": true, + "type": "string" + } + ], + "returns": [ + { + "name": "object", + "description": "JavaScript object wrapper for given node.", + "$ref": "Runtime.RemoteObject" + } + ] + }, + { + "name": "setAttributeValue", + "description": "Sets attribute for an element with given id.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the element to set attribute for.", + "$ref": "NodeId" + }, + { + "name": "name", + "description": "Attribute name.", + "type": "string" + }, + { + "name": "value", + "description": "Attribute value.", + "type": "string" + } + ] + }, + { + "name": "setAttributesAsText", + "description": "Sets attributes on element with given id. This method is useful when user edits some existing\nattribute value and types in several attribute name/value pairs.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the element to set attributes for.", + "$ref": "NodeId" + }, + { + "name": "text", + "description": "Text with a number of attributes. Will parse this text using HTML parser.", + "type": "string" + }, + { + "name": "name", + "description": "Attribute name to replace with new attributes derived from text in case text parsed\nsuccessfully.", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "setFileInputFiles", + "description": "Sets files for the given file input element.", + "parameters": [ + { + "name": "files", + "description": "Array of file paths to set.", + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "nodeId", + "description": "Identifier of the node.", + "optional": true, + "$ref": "NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node.", + "optional": true, + "$ref": "BackendNodeId" + }, + { + "name": "objectId", + "description": "JavaScript object id of the node wrapper.", + "optional": true, + "$ref": "Runtime.RemoteObjectId" + } + ] + }, + { + "name": "setInspectedNode", + "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details\n$x functions).", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "DOM node id to be accessible by means of $x command line API.", + "$ref": "NodeId" + } + ] + }, + { + "name": "setNodeName", + "description": "Sets node name for a node with given id.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to set name for.", + "$ref": "NodeId" + }, + { + "name": "name", + "description": "New node's name.", + "type": "string" + } + ], + "returns": [ + { + "name": "nodeId", + "description": "New node's id.", + "$ref": "NodeId" + } + ] + }, + { + "name": "setNodeValue", + "description": "Sets node value for a node with given id.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to set value for.", + "$ref": "NodeId" + }, + { + "name": "value", + "description": "New node's value.", + "type": "string" + } + ] + }, + { + "name": "setOuterHTML", + "description": "Sets node HTML markup, returns new node id.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to set markup for.", + "$ref": "NodeId" + }, + { + "name": "outerHTML", + "description": "Outer HTML markup to set.", + "type": "string" + } + ] + }, + { + "name": "undo", + "description": "Undoes the last performed action.", + "experimental": true + } + ], + "events": [ + { + "name": "attributeModified", + "description": "Fired when `Element`'s attribute is modified.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node that has changed.", + "$ref": "NodeId" + }, + { + "name": "name", + "description": "Attribute name.", + "type": "string" + }, + { + "name": "value", + "description": "Attribute value.", + "type": "string" + } + ] + }, + { + "name": "attributeRemoved", + "description": "Fired when `Element`'s attribute is removed.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node that has changed.", + "$ref": "NodeId" + }, + { + "name": "name", + "description": "A ttribute name.", + "type": "string" + } + ] + }, + { + "name": "characterDataModified", + "description": "Mirrors `DOMCharacterDataModified` event.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node that has changed.", + "$ref": "NodeId" + }, + { + "name": "characterData", + "description": "New text value.", + "type": "string" + } + ] + }, + { + "name": "childNodeCountUpdated", + "description": "Fired when `Container`'s child node count has changed.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node that has changed.", + "$ref": "NodeId" + }, + { + "name": "childNodeCount", + "description": "New node count.", + "type": "integer" + } + ] + }, + { + "name": "childNodeInserted", + "description": "Mirrors `DOMNodeInserted` event.", + "parameters": [ + { + "name": "parentNodeId", + "description": "Id of the node that has changed.", + "$ref": "NodeId" + }, + { + "name": "previousNodeId", + "description": "If of the previous siblint.", + "$ref": "NodeId" + }, + { + "name": "node", + "description": "Inserted node data.", + "$ref": "Node" + } + ] + }, + { + "name": "childNodeRemoved", + "description": "Mirrors `DOMNodeRemoved` event.", + "parameters": [ + { + "name": "parentNodeId", + "description": "Parent id.", + "$ref": "NodeId" + }, + { + "name": "nodeId", + "description": "Id of the node that has been removed.", + "$ref": "NodeId" + } + ] + }, + { + "name": "distributedNodesUpdated", + "description": "Called when distrubution is changed.", + "experimental": true, + "parameters": [ + { + "name": "insertionPointId", + "description": "Insertion point where distrubuted nodes were updated.", + "$ref": "NodeId" + }, + { + "name": "distributedNodes", + "description": "Distributed nodes for given insertion point.", + "type": "array", + "items": { + "$ref": "BackendNode" + } + } + ] + }, + { + "name": "documentUpdated", + "description": "Fired when `Document` has been totally updated. Node ids are no longer valid." + }, + { + "name": "inlineStyleInvalidated", + "description": "Fired when `Element`'s inline style is modified via a CSS property modification.", + "experimental": true, + "parameters": [ + { + "name": "nodeIds", + "description": "Ids of the nodes for which the inline styles have been invalidated.", + "type": "array", + "items": { + "$ref": "NodeId" + } + } + ] + }, + { + "name": "pseudoElementAdded", + "description": "Called when a pseudo element is added to an element.", + "experimental": true, + "parameters": [ + { + "name": "parentId", + "description": "Pseudo element's parent element id.", + "$ref": "NodeId" + }, + { + "name": "pseudoElement", + "description": "The added pseudo element.", + "$ref": "Node" + } + ] + }, + { + "name": "pseudoElementRemoved", + "description": "Called when a pseudo element is removed from an element.", + "experimental": true, + "parameters": [ + { + "name": "parentId", + "description": "Pseudo element's parent element id.", + "$ref": "NodeId" + }, + { + "name": "pseudoElementId", + "description": "The removed pseudo element id.", + "$ref": "NodeId" + } + ] + }, + { + "name": "setChildNodes", + "description": "Fired when backend wants to provide client with the missing DOM structure. This happens upon\nmost of the calls requesting node ids.", + "parameters": [ + { + "name": "parentId", + "description": "Parent node id to populate with children.", + "$ref": "NodeId" + }, + { + "name": "nodes", + "description": "Child nodes array.", + "type": "array", + "items": { + "$ref": "Node" + } + } + ] + }, + { + "name": "shadowRootPopped", + "description": "Called when shadow root is popped from the element.", + "experimental": true, + "parameters": [ + { + "name": "hostId", + "description": "Host element id.", + "$ref": "NodeId" + }, + { + "name": "rootId", + "description": "Shadow root id.", + "$ref": "NodeId" + } + ] + }, + { + "name": "shadowRootPushed", + "description": "Called when shadow root is pushed into the element.", + "experimental": true, + "parameters": [ + { + "name": "hostId", + "description": "Host element id.", + "$ref": "NodeId" + }, + { + "name": "root", + "description": "Shadow root.", + "$ref": "Node" + } + ] + } + ] + }, + { + "domain": "DOMDebugger", + "description": "DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript\nexecution will stop on these operations as if there was a regular breakpoint set.", + "dependencies": [ + "DOM", + "Debugger" + ], + "types": [ + { + "id": "DOMBreakpointType", + "description": "DOM breakpoint type.", + "type": "string", + "enum": [ + "subtree-modified", + "attribute-modified", + "node-removed" + ] + }, + { + "id": "EventListener", + "description": "Object event listener.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "`EventListener`'s type.", + "type": "string" + }, + { + "name": "useCapture", + "description": "`EventListener`'s useCapture.", + "type": "boolean" + }, + { + "name": "passive", + "description": "`EventListener`'s passive flag.", + "type": "boolean" + }, + { + "name": "once", + "description": "`EventListener`'s once flag.", + "type": "boolean" + }, + { + "name": "scriptId", + "description": "Script id of the handler code.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "lineNumber", + "description": "Line number in the script (0-based).", + "type": "integer" + }, + { + "name": "columnNumber", + "description": "Column number in the script (0-based).", + "type": "integer" + }, + { + "name": "handler", + "description": "Event handler function value.", + "optional": true, + "$ref": "Runtime.RemoteObject" + }, + { + "name": "originalHandler", + "description": "Event original handler function value.", + "optional": true, + "$ref": "Runtime.RemoteObject" + }, + { + "name": "backendNodeId", + "description": "Node the listener is added to (if any).", + "optional": true, + "$ref": "DOM.BackendNodeId" + } + ] + } + ], + "commands": [ + { + "name": "getEventListeners", + "description": "Returns event listeners of the given object.", + "parameters": [ + { + "name": "objectId", + "description": "Identifier of the object to return listeners for.", + "$ref": "Runtime.RemoteObjectId" + }, + { + "name": "depth", + "description": "The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the\nentire subtree or provide an integer larger than 0.", + "optional": true, + "type": "integer" + }, + { + "name": "pierce", + "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree\n(default is false). Reports listeners for all contexts if pierce is enabled.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "listeners", + "description": "Array of relevant listeners.", + "type": "array", + "items": { + "$ref": "EventListener" + } + } + ] + }, + { + "name": "removeDOMBreakpoint", + "description": "Removes DOM breakpoint that was set using `setDOMBreakpoint`.", + "parameters": [ + { + "name": "nodeId", + "description": "Identifier of the node to remove breakpoint from.", + "$ref": "DOM.NodeId" + }, + { + "name": "type", + "description": "Type of the breakpoint to remove.", + "$ref": "DOMBreakpointType" + } + ] + }, + { + "name": "removeEventListenerBreakpoint", + "description": "Removes breakpoint on particular DOM event.", + "parameters": [ + { + "name": "eventName", + "description": "Event name.", + "type": "string" + }, + { + "name": "targetName", + "description": "EventTarget interface name.", + "experimental": true, + "optional": true, + "type": "string" + } + ] + }, + { + "name": "removeInstrumentationBreakpoint", + "description": "Removes breakpoint on particular native event.", + "experimental": true, + "parameters": [ + { + "name": "eventName", + "description": "Instrumentation name to stop on.", + "type": "string" + } + ] + }, + { + "name": "removeXHRBreakpoint", + "description": "Removes breakpoint from XMLHttpRequest.", + "parameters": [ + { + "name": "url", + "description": "Resource URL substring.", + "type": "string" + } + ] + }, + { + "name": "setDOMBreakpoint", + "description": "Sets breakpoint on particular operation with DOM.", + "parameters": [ + { + "name": "nodeId", + "description": "Identifier of the node to set breakpoint on.", + "$ref": "DOM.NodeId" + }, + { + "name": "type", + "description": "Type of the operation to stop upon.", + "$ref": "DOMBreakpointType" + } + ] + }, + { + "name": "setEventListenerBreakpoint", + "description": "Sets breakpoint on particular DOM event.", + "parameters": [ + { + "name": "eventName", + "description": "DOM Event name to stop on (any DOM event will do).", + "type": "string" + }, + { + "name": "targetName", + "description": "EventTarget interface name to stop on. If equal to `\"*\"` or not provided, will stop on any\nEventTarget.", + "experimental": true, + "optional": true, + "type": "string" + } + ] + }, + { + "name": "setInstrumentationBreakpoint", + "description": "Sets breakpoint on particular native event.", + "experimental": true, + "parameters": [ + { + "name": "eventName", + "description": "Instrumentation name to stop on.", + "type": "string" + } + ] + }, + { + "name": "setXHRBreakpoint", + "description": "Sets breakpoint on XMLHttpRequest.", + "parameters": [ + { + "name": "url", + "description": "Resource URL substring. All XHRs having this substring in the URL will get stopped upon.", + "type": "string" + } + ] + } + ] + }, + { + "domain": "DOMSnapshot", + "description": "This domain facilitates obtaining document snapshots with DOM, layout, and style information.", + "experimental": true, + "dependencies": [ + "CSS", + "DOM", + "Page" + ], + "types": [ + { + "id": "DOMNode", + "description": "A Node in the DOM tree.", + "type": "object", + "properties": [ + { + "name": "nodeType", + "description": "`Node`'s nodeType.", + "type": "integer" + }, + { + "name": "nodeName", + "description": "`Node`'s nodeName.", + "type": "string" + }, + { + "name": "nodeValue", + "description": "`Node`'s nodeValue.", + "type": "string" + }, + { + "name": "textValue", + "description": "Only set for textarea elements, contains the text value.", + "optional": true, + "type": "string" + }, + { + "name": "inputValue", + "description": "Only set for input elements, contains the input's associated text value.", + "optional": true, + "type": "string" + }, + { + "name": "inputChecked", + "description": "Only set for radio and checkbox input elements, indicates if the element has been checked", + "optional": true, + "type": "boolean" + }, + { + "name": "optionSelected", + "description": "Only set for option elements, indicates if the element has been selected", + "optional": true, + "type": "boolean" + }, + { + "name": "backendNodeId", + "description": "`Node`'s id, corresponds to DOM.Node.backendNodeId.", + "$ref": "DOM.BackendNodeId" + }, + { + "name": "childNodeIndexes", + "description": "The indexes of the node's child nodes in the `domNodes` array returned by `getSnapshot`, if\nany.", + "optional": true, + "type": "array", + "items": { + "type": "integer" + } + }, + { + "name": "attributes", + "description": "Attributes of an `Element` node.", + "optional": true, + "type": "array", + "items": { + "$ref": "NameValue" + } + }, + { + "name": "pseudoElementIndexes", + "description": "Indexes of pseudo elements associated with this node in the `domNodes` array returned by\n`getSnapshot`, if any.", + "optional": true, + "type": "array", + "items": { + "type": "integer" + } + }, + { + "name": "layoutNodeIndex", + "description": "The index of the node's related layout tree node in the `layoutTreeNodes` array returned by\n`getSnapshot`, if any.", + "optional": true, + "type": "integer" + }, + { + "name": "documentURL", + "description": "Document URL that `Document` or `FrameOwner` node points to.", + "optional": true, + "type": "string" + }, + { + "name": "baseURL", + "description": "Base URL that `Document` or `FrameOwner` node uses for URL completion.", + "optional": true, + "type": "string" + }, + { + "name": "contentLanguage", + "description": "Only set for documents, contains the document's content language.", + "optional": true, + "type": "string" + }, + { + "name": "documentEncoding", + "description": "Only set for documents, contains the document's character set encoding.", + "optional": true, + "type": "string" + }, + { + "name": "publicId", + "description": "`DocumentType` node's publicId.", + "optional": true, + "type": "string" + }, + { + "name": "systemId", + "description": "`DocumentType` node's systemId.", + "optional": true, + "type": "string" + }, + { + "name": "frameId", + "description": "Frame ID for frame owner elements and also for the document node.", + "optional": true, + "$ref": "Page.FrameId" + }, + { + "name": "contentDocumentIndex", + "description": "The index of a frame owner element's content document in the `domNodes` array returned by\n`getSnapshot`, if any.", + "optional": true, + "type": "integer" + }, + { + "name": "importedDocumentIndex", + "description": "Index of the imported document's node of a link element in the `domNodes` array returned by\n`getSnapshot`, if any.", + "optional": true, + "type": "integer" + }, + { + "name": "templateContentIndex", + "description": "Index of the content node of a template element in the `domNodes` array returned by\n`getSnapshot`.", + "optional": true, + "type": "integer" + }, + { + "name": "pseudoType", + "description": "Type of a pseudo element node.", + "optional": true, + "$ref": "DOM.PseudoType" + }, + { + "name": "isClickable", + "description": "Whether this DOM node responds to mouse clicks. This includes nodes that have had click\nevent listeners attached via JavaScript as well as anchor tags that naturally navigate when\nclicked.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "id": "InlineTextBox", + "description": "Details of post layout rendered text positions. The exact layout should not be regarded as\nstable and may change between versions.", + "type": "object", + "properties": [ + { + "name": "boundingBox", + "description": "The absolute position bounding box.", + "$ref": "DOM.Rect" + }, + { + "name": "startCharacterIndex", + "description": "The starting index in characters, for this post layout textbox substring.", + "type": "integer" + }, + { + "name": "numCharacters", + "description": "The number of characters in this post layout textbox substring.", + "type": "integer" + } + ] + }, + { + "id": "LayoutTreeNode", + "description": "Details of an element in the DOM tree with a LayoutObject.", + "type": "object", + "properties": [ + { + "name": "domNodeIndex", + "description": "The index of the related DOM node in the `domNodes` array returned by `getSnapshot`.", + "type": "integer" + }, + { + "name": "boundingBox", + "description": "The absolute position bounding box.", + "$ref": "DOM.Rect" + }, + { + "name": "layoutText", + "description": "Contents of the LayoutText, if any.", + "optional": true, + "type": "string" + }, + { + "name": "inlineTextNodes", + "description": "The post-layout inline text nodes, if any.", + "optional": true, + "type": "array", + "items": { + "$ref": "InlineTextBox" + } + }, + { + "name": "styleIndex", + "description": "Index into the `computedStyles` array returned by `getSnapshot`.", + "optional": true, + "type": "integer" + } + ] + }, + { + "id": "ComputedStyle", + "description": "A subset of the full ComputedStyle as defined by the request whitelist.", + "type": "object", + "properties": [ + { + "name": "properties", + "description": "Name/value pairs of computed style properties.", + "type": "array", + "items": { + "$ref": "NameValue" + } + } + ] + }, + { + "id": "NameValue", + "description": "A name/value pair.", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Attribute/property name.", + "type": "string" + }, + { + "name": "value", + "description": "Attribute/property value.", + "type": "string" + } + ] + } + ], + "commands": [ + { + "name": "getSnapshot", + "description": "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\ntemplate contents, and imported documents) in a flattened array, as well as layout and\nwhite-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\nflattened.", + "parameters": [ + { + "name": "computedStyleWhitelist", + "description": "Whitelist of computed styles to return.", + "type": "array", + "items": { + "type": "string" + } + } + ], + "returns": [ + { + "name": "domNodes", + "description": "The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.", + "type": "array", + "items": { + "$ref": "DOMNode" + } + }, + { + "name": "layoutTreeNodes", + "description": "The nodes in the layout tree.", + "type": "array", + "items": { + "$ref": "LayoutTreeNode" + } + }, + { + "name": "computedStyles", + "description": "Whitelisted ComputedStyle properties for each node in the layout tree.", + "type": "array", + "items": { + "$ref": "ComputedStyle" + } + } + ] + } + ] + }, + { + "domain": "DOMStorage", + "description": "Query and modify DOM storage.", + "experimental": true, + "types": [ + { + "id": "StorageId", + "description": "DOM Storage identifier.", + "type": "object", + "properties": [ + { + "name": "securityOrigin", + "description": "Security origin for the storage.", + "type": "string" + }, + { + "name": "isLocalStorage", + "description": "Whether the storage is local storage (not session storage).", + "type": "boolean" + } + ] + }, + { + "id": "Item", + "description": "DOM Storage item.", + "type": "array", + "items": { + "type": "string" + } + } + ], + "commands": [ + { + "name": "clear", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + } + ] + }, + { + "name": "disable", + "description": "Disables storage tracking, prevents storage events from being sent to the client." + }, + { + "name": "enable", + "description": "Enables storage tracking, storage events will now be delivered to the client." + }, + { + "name": "getDOMStorageItems", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + } + ], + "returns": [ + { + "name": "entries", + "type": "array", + "items": { + "$ref": "Item" + } + } + ] + }, + { + "name": "removeDOMStorageItem", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + }, + { + "name": "key", + "type": "string" + } + ] + }, + { + "name": "setDOMStorageItem", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + }, + { + "name": "key", + "type": "string" + }, + { + "name": "value", + "type": "string" + } + ] + } + ], + "events": [ + { + "name": "domStorageItemAdded", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + }, + { + "name": "key", + "type": "string" + }, + { + "name": "newValue", + "type": "string" + } + ] + }, + { + "name": "domStorageItemRemoved", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + }, + { + "name": "key", + "type": "string" + } + ] + }, + { + "name": "domStorageItemUpdated", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + }, + { + "name": "key", + "type": "string" + }, + { + "name": "oldValue", + "type": "string" + }, + { + "name": "newValue", + "type": "string" + } + ] + }, + { + "name": "domStorageItemsCleared", + "parameters": [ + { + "name": "storageId", + "$ref": "StorageId" + } + ] + } + ] + }, + { + "domain": "Database", + "experimental": true, + "types": [ + { + "id": "DatabaseId", + "description": "Unique identifier of Database object.", + "type": "string" + }, + { + "id": "Database", + "description": "Database object.", + "type": "object", + "properties": [ + { + "name": "id", + "description": "Database ID.", + "$ref": "DatabaseId" + }, + { + "name": "domain", + "description": "Database domain.", + "type": "string" + }, + { + "name": "name", + "description": "Database name.", + "type": "string" + }, + { + "name": "version", + "description": "Database version.", + "type": "string" + } + ] + }, + { + "id": "Error", + "description": "Database error.", + "type": "object", + "properties": [ + { + "name": "message", + "description": "Error message.", + "type": "string" + }, + { + "name": "code", + "description": "Error code.", + "type": "integer" + } + ] + } + ], + "commands": [ + { + "name": "disable", + "description": "Disables database tracking, prevents database events from being sent to the client." + }, + { + "name": "enable", + "description": "Enables database tracking, database events will now be delivered to the client." + }, + { + "name": "executeSQL", + "parameters": [ + { + "name": "databaseId", + "$ref": "DatabaseId" + }, + { + "name": "query", + "type": "string" + } + ], + "returns": [ + { + "name": "columnNames", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "values", + "optional": true, + "type": "array", + "items": { + "type": "any" + } + }, + { + "name": "sqlError", + "optional": true, + "$ref": "Error" + } + ] + }, + { + "name": "getDatabaseTableNames", + "parameters": [ + { + "name": "databaseId", + "$ref": "DatabaseId" + } + ], + "returns": [ + { + "name": "tableNames", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "events": [ + { + "name": "addDatabase", + "parameters": [ + { + "name": "database", + "$ref": "Database" + } + ] + } + ] + }, + { + "domain": "DeviceOrientation", + "experimental": true, + "commands": [ + { + "name": "clearDeviceOrientationOverride", + "description": "Clears the overridden Device Orientation." + }, + { + "name": "setDeviceOrientationOverride", + "description": "Overrides the Device Orientation.", + "parameters": [ + { + "name": "alpha", + "description": "Mock alpha", + "type": "number" + }, + { + "name": "beta", + "description": "Mock beta", + "type": "number" + }, + { + "name": "gamma", + "description": "Mock gamma", + "type": "number" + } + ] + } + ] + }, + { + "domain": "Emulation", + "description": "This domain emulates different environments for the page.", + "dependencies": [ + "DOM", + "Page", + "Runtime" + ], + "types": [ + { + "id": "ScreenOrientation", + "description": "Screen orientation.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "Orientation type.", + "type": "string", + "enum": [ + "portraitPrimary", + "portraitSecondary", + "landscapePrimary", + "landscapeSecondary" + ] + }, + { + "name": "angle", + "description": "Orientation angle.", + "type": "integer" + } + ] + }, + { + "id": "VirtualTimePolicy", + "description": "advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to\nallow the next delayed task (if any) to run; pause: The virtual time base may not advance;\npauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending\nresource fetches.", + "experimental": true, + "type": "string", + "enum": [ + "advance", + "pause", + "pauseIfNetworkFetchesPending" + ] + } + ], + "commands": [ + { + "name": "canEmulate", + "description": "Tells whether emulation is supported.", + "returns": [ + { + "name": "result", + "description": "True if emulation is supported.", + "type": "boolean" + } + ] + }, + { + "name": "clearDeviceMetricsOverride", + "description": "Clears the overriden device metrics." + }, + { + "name": "clearGeolocationOverride", + "description": "Clears the overriden Geolocation Position and Error." + }, + { + "name": "resetPageScaleFactor", + "description": "Requests that page scale factor is reset to initial values.", + "experimental": true + }, + { + "name": "setCPUThrottlingRate", + "description": "Enables CPU throttling to emulate slow CPUs.", + "experimental": true, + "parameters": [ + { + "name": "rate", + "description": "Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).", + "type": "number" + } + ] + }, + { + "name": "setDefaultBackgroundColorOverride", + "description": "Sets or clears an override of the default background color of the frame. This override is used\nif the content does not specify one.", + "parameters": [ + { + "name": "color", + "description": "RGBA of the default background color. If not specified, any existing override will be\ncleared.", + "optional": true, + "$ref": "DOM.RGBA" + } + ] + }, + { + "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).", + "parameters": [ + { + "name": "width", + "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.", + "type": "integer" + }, + { + "name": "height", + "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.", + "type": "integer" + }, + { + "name": "deviceScaleFactor", + "description": "Overriding device scale factor value. 0 disables the override.", + "type": "number" + }, + { + "name": "mobile", + "description": "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text\nautosizing and more.", + "type": "boolean" + }, + { + "name": "scale", + "description": "Scale to apply to resulting view image.", + "experimental": true, + "optional": true, + "type": "number" + }, + { + "name": "screenWidth", + "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000).", + "experimental": true, + "optional": true, + "type": "integer" + }, + { + "name": "screenHeight", + "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000).", + "experimental": true, + "optional": true, + "type": "integer" + }, + { + "name": "positionX", + "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000).", + "experimental": true, + "optional": true, + "type": "integer" + }, + { + "name": "positionY", + "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).", + "experimental": true, + "optional": true, + "type": "integer" + }, + { + "name": "dontSetVisibleSize", + "description": "Do not set visible view size, rely upon explicit setVisibleSize call.", + "experimental": true, + "optional": true, + "type": "boolean" + }, + { + "name": "screenOrientation", + "description": "Screen orientation override.", + "optional": true, + "$ref": "ScreenOrientation" + }, + { + "name": "viewport", + "description": "If set, the visible area of the page will be overridden to this viewport. This viewport\nchange is not observed by the page, e.g. viewport-relative elements do not change positions.", + "experimental": true, + "optional": true, + "$ref": "Page.Viewport" + } + ] + }, + { + "name": "setEmitTouchEventsForMouse", + "experimental": true, + "parameters": [ + { + "name": "enabled", + "description": "Whether touch emulation based on mouse input should be enabled.", + "type": "boolean" + }, + { + "name": "configuration", + "description": "Touch/gesture events configuration. Default: current platform.", + "optional": true, + "type": "string", + "enum": [ + "mobile", + "desktop" + ] + } + ] + }, + { + "name": "setEmulatedMedia", + "description": "Emulates the given media for CSS media queries.", + "parameters": [ + { + "name": "media", + "description": "Media type to emulate. Empty string disables the override.", + "type": "string" + } + ] + }, + { + "name": "setGeolocationOverride", + "description": "Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position\nunavailable.", + "parameters": [ + { + "name": "latitude", + "description": "Mock latitude", + "optional": true, + "type": "number" + }, + { + "name": "longitude", + "description": "Mock longitude", + "optional": true, + "type": "number" + }, + { + "name": "accuracy", + "description": "Mock accuracy", + "optional": true, + "type": "number" + } + ] + }, + { + "name": "setNavigatorOverrides", + "description": "Overrides value returned by the javascript navigator object.", + "experimental": true, + "parameters": [ + { + "name": "platform", + "description": "The platform navigator.platform should return.", + "type": "string" + } + ] + }, + { + "name": "setPageScaleFactor", + "description": "Sets a specified page scale factor.", + "experimental": true, + "parameters": [ + { + "name": "pageScaleFactor", + "description": "Page scale factor.", + "type": "number" + } + ] + }, + { + "name": "setScriptExecutionDisabled", + "description": "Switches script execution in the page.", + "parameters": [ + { + "name": "value", + "description": "Whether script execution should be disabled in the page.", + "type": "boolean" + } + ] + }, + { + "name": "setTouchEmulationEnabled", + "description": "Enables touch on platforms which do not support them.", + "parameters": [ + { + "name": "enabled", + "description": "Whether the touch event emulation should be enabled.", + "type": "boolean" + }, + { + "name": "maxTouchPoints", + "description": "Maximum touch points supported. Defaults to one.", + "optional": true, + "type": "integer" + } + ] + }, + { + "name": "setVirtualTimePolicy", + "description": "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\nthe current virtual time policy. Note this supersedes any previous time budget.", + "experimental": true, + "parameters": [ + { + "name": "policy", + "$ref": "VirtualTimePolicy" + }, + { + "name": "budget", + "description": "If set, after this many virtual milliseconds have elapsed virtual time will be paused and a\nvirtualTimeBudgetExpired event is sent.", + "optional": true, + "type": "number" + }, + { + "name": "maxVirtualTimeTaskStarvationCount", + "description": "If set this specifies the maximum number of tasks that can be run before virtual is forced\nforwards to prevent deadlock.", + "optional": true, + "type": "integer" + } + ], + "returns": [ + { + "name": "virtualTimeBase", + "description": "Absolute timestamp at which virtual time was first enabled (milliseconds since epoch).", + "$ref": "Runtime.Timestamp" + } + ] + }, + { + "name": "setVisibleSize", + "description": "Resizes the frame/viewport of the page. Note that this does not affect the frame's container\n(e.g. browser window). Can be used to produce screenshots of the specified size. Not supported\non Android.", + "experimental": true, + "deprecated": true, + "parameters": [ + { + "name": "width", + "description": "Frame width (DIP).", + "type": "integer" + }, + { + "name": "height", + "description": "Frame height (DIP).", + "type": "integer" + } + ] + } + ], + "events": [ + { + "name": "virtualTimeAdvanced", + "description": "Notification sent after the virtual time has advanced.", + "experimental": true, + "parameters": [ + { + "name": "virtualTimeElapsed", + "description": "The amount of virtual time that has elapsed in milliseconds since virtual time was first\nenabled.", + "type": "number" + } + ] + }, + { + "name": "virtualTimeBudgetExpired", + "description": "Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.", + "experimental": true + }, + { + "name": "virtualTimePaused", + "description": "Notification sent after the virtual time has paused.", + "experimental": true, + "parameters": [ + { + "name": "virtualTimeElapsed", + "description": "The amount of virtual time that has elapsed in milliseconds since virtual time was first\nenabled.", + "type": "number" + } + ] + } + ] + }, + { + "domain": "HeadlessExperimental", + "description": "This domain provides experimental commands only supported in headless mode.", + "experimental": true, + "dependencies": [ + "Page", + "Runtime" + ], + "types": [ + { + "id": "ScreenshotParams", + "description": "Encoding options for a screenshot.", + "type": "object", + "properties": [ + { + "name": "format", + "description": "Image compression format (defaults to png).", + "optional": true, + "type": "string", + "enum": [ + "jpeg", + "png" + ] + }, + { + "name": "quality", + "description": "Compression quality from range [0..100] (jpeg only).", + "optional": true, + "type": "integer" + } + ] + } + ], + "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.", + "parameters": [ + { + "name": "frameTime", + "description": "Timestamp of this BeginFrame (milliseconds since epoch). If not set, the current time will\nbe used.", + "optional": true, + "$ref": "Runtime.Timestamp" + }, + { + "name": "deadline", + "description": "Deadline of this BeginFrame (milliseconds since epoch). If not set, the deadline will be\ncalculated from the frameTime and interval.", + "optional": true, + "$ref": "Runtime.Timestamp" + }, + { + "name": "interval", + "description": "The interval between BeginFrames that is reported to the compositor, in milliseconds.\nDefaults to a 60 frames/second interval, i.e. about 16.666 milliseconds.", + "optional": true, + "type": "number" + }, + { + "name": "screenshot", + "description": "If set, a screenshot of the frame will be captured and returned in the response. Otherwise,\nno screenshot will be captured.", + "optional": true, + "$ref": "ScreenshotParams" + } + ], + "returns": [ + { + "name": "hasDamage", + "description": "Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the\ndisplay.", + "type": "boolean" + }, + { + "name": "mainFrameContentUpdated", + "description": "Whether the main frame submitted a new display frame in response to this BeginFrame.", + "type": "boolean" + }, + { + "name": "screenshotData", + "description": "Base64-encoded image data of the screenshot, if one was requested and successfully taken.", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "disable", + "description": "Disables headless events for the target." + }, + { + "name": "enable", + "description": "Enables headless events for the target." + } + ], + "events": [ + { + "name": "mainFrameReadyForScreenshots", + "description": "Issued when the main frame has first submitted a frame to the browser. May only be fired while a\nBeginFrame is in flight. Before this event, screenshotting requests may fail." + }, + { + "name": "needsBeginFramesChanged", + "description": "Issued when the target starts or stops needing BeginFrames.", + "parameters": [ + { + "name": "needsBeginFrames", + "description": "True if BeginFrames are needed, false otherwise.", + "type": "boolean" + } + ] + } + ] + }, + { + "domain": "IO", + "description": "Input/Output operations for streams produced by DevTools.", + "types": [ + { + "id": "StreamHandle", + "description": "This is either obtained from another method or specifed as `blob:<uuid>` where\n`<uuid>` is an UUID of a Blob.", + "type": "string" + } + ], + "commands": [ + { + "name": "close", + "description": "Close the stream, discard any temporary backing storage.", + "parameters": [ + { + "name": "handle", + "description": "Handle of the stream to close.", + "$ref": "StreamHandle" + } + ] + }, + { + "name": "read", + "description": "Read a chunk of the stream", + "parameters": [ + { + "name": "handle", + "description": "Handle of the stream to read.", + "$ref": "StreamHandle" + }, + { + "name": "offset", + "description": "Seek to the specified offset before reading (if not specificed, proceed with offset\nfollowing the last read).", + "optional": true, + "type": "integer" + }, + { + "name": "size", + "description": "Maximum number of bytes to read (left upon the agent discretion if not specified).", + "optional": true, + "type": "integer" + } + ], + "returns": [ + { + "name": "base64Encoded", + "description": "Set if the data is base64-encoded", + "optional": true, + "type": "boolean" + }, + { + "name": "data", + "description": "Data that were read.", + "type": "string" + }, + { + "name": "eof", + "description": "Set if the end-of-file condition occured while reading.", + "type": "boolean" + } + ] + }, + { + "name": "resolveBlob", + "description": "Return UUID of Blob object specified by a remote object id.", + "parameters": [ + { + "name": "objectId", + "description": "Object id of a Blob object wrapper.", + "$ref": "Runtime.RemoteObjectId" + } + ], + "returns": [ + { + "name": "uuid", + "description": "UUID of the specified Blob.", + "type": "string" + } + ] + } + ] + }, + { + "domain": "IndexedDB", + "experimental": true, + "dependencies": [ + "Runtime" + ], + "types": [ + { + "id": "DatabaseWithObjectStores", + "description": "Database with an array of object stores.", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Database name.", + "type": "string" + }, + { + "name": "version", + "description": "Database version.", + "type": "integer" + }, + { + "name": "objectStores", + "description": "Object stores in this database.", + "type": "array", + "items": { + "$ref": "ObjectStore" + } + } + ] + }, + { + "id": "ObjectStore", + "description": "Object store.", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Object store name.", + "type": "string" + }, + { + "name": "keyPath", + "description": "Object store key path.", + "$ref": "KeyPath" + }, + { + "name": "autoIncrement", + "description": "If true, object store has auto increment flag set.", + "type": "boolean" + }, + { + "name": "indexes", + "description": "Indexes in this object store.", + "type": "array", + "items": { + "$ref": "ObjectStoreIndex" + } + } + ] + }, + { + "id": "ObjectStoreIndex", + "description": "Object store index.", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Index name.", + "type": "string" + }, + { + "name": "keyPath", + "description": "Index key path.", + "$ref": "KeyPath" + }, + { + "name": "unique", + "description": "If true, index is unique.", + "type": "boolean" + }, + { + "name": "multiEntry", + "description": "If true, index allows multiple entries for a key.", + "type": "boolean" + } + ] + }, + { + "id": "Key", + "description": "Key.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "Key type.", + "type": "string", + "enum": [ + "number", + "string", + "date", + "array" + ] + }, + { + "name": "number", + "description": "Number value.", + "optional": true, + "type": "number" + }, + { + "name": "string", + "description": "String value.", + "optional": true, + "type": "string" + }, + { + "name": "date", + "description": "Date value.", + "optional": true, + "type": "number" + }, + { + "name": "array", + "description": "Array value.", + "optional": true, + "type": "array", + "items": { + "$ref": "Key" + } + } + ] + }, + { + "id": "KeyRange", + "description": "Key range.", + "type": "object", + "properties": [ + { + "name": "lower", + "description": "Lower bound.", + "optional": true, + "$ref": "Key" + }, + { + "name": "upper", + "description": "Upper bound.", + "optional": true, + "$ref": "Key" + }, + { + "name": "lowerOpen", + "description": "If true lower bound is open.", + "type": "boolean" + }, + { + "name": "upperOpen", + "description": "If true upper bound is open.", + "type": "boolean" + } + ] + }, + { + "id": "DataEntry", + "description": "Data entry.", + "type": "object", + "properties": [ + { + "name": "key", + "description": "Key object.", + "$ref": "Runtime.RemoteObject" + }, + { + "name": "primaryKey", + "description": "Primary key object.", + "$ref": "Runtime.RemoteObject" + }, + { + "name": "value", + "description": "Value object.", + "$ref": "Runtime.RemoteObject" + } + ] + }, + { + "id": "KeyPath", + "description": "Key path.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "Key path type.", + "type": "string", + "enum": [ + "null", + "string", + "array" + ] + }, + { + "name": "string", + "description": "String value.", + "optional": true, + "type": "string" + }, + { + "name": "array", + "description": "Array value.", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "commands": [ + { + "name": "clearObjectStore", + "description": "Clears all entries from an object store.", + "parameters": [ + { + "name": "securityOrigin", + "description": "Security origin.", + "type": "string" + }, + { + "name": "databaseName", + "description": "Database name.", + "type": "string" + }, + { + "name": "objectStoreName", + "description": "Object store name.", + "type": "string" + } + ] + }, + { + "name": "deleteDatabase", + "description": "Deletes a database.", + "parameters": [ + { + "name": "securityOrigin", + "description": "Security origin.", + "type": "string" + }, + { + "name": "databaseName", + "description": "Database name.", + "type": "string" + } + ] + }, + { + "name": "deleteObjectStoreEntries", + "description": "Delete a range of entries from an object store", + "parameters": [ + { + "name": "securityOrigin", + "type": "string" + }, + { + "name": "databaseName", + "type": "string" + }, + { + "name": "objectStoreName", + "type": "string" + }, + { + "name": "keyRange", + "description": "Range of entry keys to delete", + "$ref": "KeyRange" + } + ] + }, + { + "name": "disable", + "description": "Disables events from backend." + }, + { + "name": "enable", + "description": "Enables events from backend." + }, + { + "name": "requestData", + "description": "Requests data from object store or index.", + "parameters": [ + { + "name": "securityOrigin", + "description": "Security origin.", + "type": "string" + }, + { + "name": "databaseName", + "description": "Database name.", + "type": "string" + }, + { + "name": "objectStoreName", + "description": "Object store name.", + "type": "string" + }, + { + "name": "indexName", + "description": "Index name, empty string for object store data requests.", + "type": "string" + }, + { + "name": "skipCount", + "description": "Number of records to skip.", + "type": "integer" + }, + { + "name": "pageSize", + "description": "Number of records to fetch.", + "type": "integer" + }, + { + "name": "keyRange", + "description": "Key range.", + "optional": true, + "$ref": "KeyRange" + } + ], + "returns": [ + { + "name": "objectStoreDataEntries", + "description": "Array of object store data entries.", + "type": "array", + "items": { + "$ref": "DataEntry" + } + }, + { + "name": "hasMore", + "description": "If true, there are more entries to fetch in the given range.", + "type": "boolean" + } + ] + }, + { + "name": "requestDatabase", + "description": "Requests database with given name in given frame.", + "parameters": [ + { + "name": "securityOrigin", + "description": "Security origin.", + "type": "string" + }, + { + "name": "databaseName", + "description": "Database name.", + "type": "string" + } + ], + "returns": [ + { + "name": "databaseWithObjectStores", + "description": "Database with an array of object stores.", + "$ref": "DatabaseWithObjectStores" + } + ] + }, + { + "name": "requestDatabaseNames", + "description": "Requests database names for given security origin.", + "parameters": [ + { + "name": "securityOrigin", + "description": "Security origin.", + "type": "string" + } + ], + "returns": [ + { + "name": "databaseNames", + "description": "Database names for origin.", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "domain": "Input", + "types": [ + { + "id": "TouchPoint", + "type": "object", + "properties": [ + { + "name": "x", + "description": "X coordinate of the event relative to the main frame's viewport in CSS pixels.", + "type": "number" + }, + { + "name": "y", + "description": "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\nthe top of the viewport and Y increases as it proceeds towards the bottom of the viewport.", + "type": "number" + }, + { + "name": "radiusX", + "description": "X radius of the touch area (default: 1.0).", + "optional": true, + "type": "number" + }, + { + "name": "radiusY", + "description": "Y radius of the touch area (default: 1.0).", + "optional": true, + "type": "number" + }, + { + "name": "rotationAngle", + "description": "Rotation angle (default: 0.0).", + "optional": true, + "type": "number" + }, + { + "name": "force", + "description": "Force (default: 1.0).", + "optional": true, + "type": "number" + }, + { + "name": "id", + "description": "Identifier used to track touch sources between events, must be unique within an event.", + "optional": true, + "type": "number" + } + ] + }, + { + "id": "GestureSourceType", + "experimental": true, + "type": "string", + "enum": [ + "default", + "touch", + "mouse" + ] + }, + { + "id": "TimeSinceEpoch", + "description": "UTC time in seconds, counted from January 1, 1970.", + "type": "number" + } + ], + "commands": [ + { + "name": "dispatchKeyEvent", + "description": "Dispatches a key event to the page.", + "parameters": [ + { + "name": "type", + "description": "Type of the key event.", + "type": "string", + "enum": [ + "keyDown", + "keyUp", + "rawKeyDown", + "char" + ] + }, + { + "name": "modifiers", + "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "timestamp", + "description": "Time at which the event occurred.", + "optional": true, + "$ref": "TimeSinceEpoch" + }, + { + "name": "text", + "description": "Text as generated by processing a virtual key code with a keyboard layout. Not needed for\nfor `keyUp` and `rawKeyDown` events (default: \"\")", + "optional": true, + "type": "string" + }, + { + "name": "unmodifiedText", + "description": "Text that would have been generated by the keyboard if no modifiers were pressed (except for\nshift). Useful for shortcut (accelerator) key handling (default: \"\").", + "optional": true, + "type": "string" + }, + { + "name": "keyIdentifier", + "description": "Unique key identifier (e.g., 'U+0041') (default: \"\").", + "optional": true, + "type": "string" + }, + { + "name": "code", + "description": "Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: \"\").", + "optional": true, + "type": "string" + }, + { + "name": "key", + "description": "Unique DOM defined string value describing the meaning of the key in the context of active\nmodifiers, keyboard layout, etc (e.g., 'AltGr') (default: \"\").", + "optional": true, + "type": "string" + }, + { + "name": "windowsVirtualKeyCode", + "description": "Windows virtual key code (default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "nativeVirtualKeyCode", + "description": "Native virtual key code (default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "autoRepeat", + "description": "Whether the event was generated from auto repeat (default: false).", + "optional": true, + "type": "boolean" + }, + { + "name": "isKeypad", + "description": "Whether the event was generated from the keypad (default: false).", + "optional": true, + "type": "boolean" + }, + { + "name": "isSystemKey", + "description": "Whether the event was a system key event (default: false).", + "optional": true, + "type": "boolean" + }, + { + "name": "location", + "description": "Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default:\n0).", + "optional": true, + "type": "integer" + } + ] + }, + { + "name": "dispatchMouseEvent", + "description": "Dispatches a mouse event to the page.", + "parameters": [ + { + "name": "type", + "description": "Type of the mouse event.", + "type": "string", + "enum": [ + "mousePressed", + "mouseReleased", + "mouseMoved", + "mouseWheel" + ] + }, + { + "name": "x", + "description": "X coordinate of the event relative to the main frame's viewport in CSS pixels.", + "type": "number" + }, + { + "name": "y", + "description": "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\nthe top of the viewport and Y increases as it proceeds towards the bottom of the viewport.", + "type": "number" + }, + { + "name": "modifiers", + "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "timestamp", + "description": "Time at which the event occurred.", + "optional": true, + "$ref": "TimeSinceEpoch" + }, + { + "name": "button", + "description": "Mouse button (default: \"none\").", + "optional": true, + "type": "string", + "enum": [ + "none", + "left", + "middle", + "right" + ] + }, + { + "name": "clickCount", + "description": "Number of times the mouse button was clicked (default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "deltaX", + "description": "X delta in CSS pixels for mouse wheel event (default: 0).", + "optional": true, + "type": "number" + }, + { + "name": "deltaY", + "description": "Y delta in CSS pixels for mouse wheel event (default: 0).", + "optional": true, + "type": "number" + } + ] + }, + { + "name": "dispatchTouchEvent", + "description": "Dispatches a touch event to the page.", + "parameters": [ + { + "name": "type", + "description": "Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while\nTouchStart and TouchMove must contains at least one.", + "type": "string", + "enum": [ + "touchStart", + "touchEnd", + "touchMove", + "touchCancel" + ] + }, + { + "name": "touchPoints", + "description": "Active touch points on the touch device. One event per any changed point (compared to\nprevious touch event in a sequence) is generated, emulating pressing/moving/releasing points\none by one.", + "type": "array", + "items": { + "$ref": "TouchPoint" + } + }, + { + "name": "modifiers", + "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "timestamp", + "description": "Time at which the event occurred.", + "optional": true, + "$ref": "TimeSinceEpoch" + } + ] + }, + { + "name": "emulateTouchFromMouseEvent", + "description": "Emulates touch event from the mouse event parameters.", + "experimental": true, + "parameters": [ + { + "name": "type", + "description": "Type of the mouse event.", + "type": "string", + "enum": [ + "mousePressed", + "mouseReleased", + "mouseMoved", + "mouseWheel" + ] + }, + { + "name": "x", + "description": "X coordinate of the mouse pointer in DIP.", + "type": "integer" + }, + { + "name": "y", + "description": "Y coordinate of the mouse pointer in DIP.", + "type": "integer" + }, + { + "name": "timestamp", + "description": "Time at which the event occurred.", + "$ref": "TimeSinceEpoch" + }, + { + "name": "button", + "description": "Mouse button.", + "type": "string", + "enum": [ + "none", + "left", + "middle", + "right" + ] + }, + { + "name": "deltaX", + "description": "X delta in DIP for mouse wheel event (default: 0).", + "optional": true, + "type": "number" + }, + { + "name": "deltaY", + "description": "Y delta in DIP for mouse wheel event (default: 0).", + "optional": true, + "type": "number" + }, + { + "name": "modifiers", + "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "clickCount", + "description": "Number of times the mouse button was clicked (default: 0).", + "optional": true, + "type": "integer" + } + ] + }, + { + "name": "setIgnoreInputEvents", + "description": "Ignores input events (useful while auditing page).", + "parameters": [ + { + "name": "ignore", + "description": "Ignores input events processing when set to true.", + "type": "boolean" + } + ] + }, + { + "name": "synthesizePinchGesture", + "description": "Synthesizes a pinch gesture over a time period by issuing appropriate touch events.", + "experimental": true, + "parameters": [ + { + "name": "x", + "description": "X coordinate of the start of the gesture in CSS pixels.", + "type": "number" + }, + { + "name": "y", + "description": "Y coordinate of the start of the gesture in CSS pixels.", + "type": "number" + }, + { + "name": "scaleFactor", + "description": "Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).", + "type": "number" + }, + { + "name": "relativeSpeed", + "description": "Relative pointer speed in pixels per second (default: 800).", + "optional": true, + "type": "integer" + }, + { + "name": "gestureSourceType", + "description": "Which type of input events to be generated (default: 'default', which queries the platform\nfor the preferred input type).", + "optional": true, + "$ref": "GestureSourceType" + } + ] + }, + { + "name": "synthesizeScrollGesture", + "description": "Synthesizes a scroll gesture over a time period by issuing appropriate touch events.", + "experimental": true, + "parameters": [ + { + "name": "x", + "description": "X coordinate of the start of the gesture in CSS pixels.", + "type": "number" + }, + { + "name": "y", + "description": "Y coordinate of the start of the gesture in CSS pixels.", + "type": "number" + }, + { + "name": "xDistance", + "description": "The distance to scroll along the X axis (positive to scroll left).", + "optional": true, + "type": "number" + }, + { + "name": "yDistance", + "description": "The distance to scroll along the Y axis (positive to scroll up).", + "optional": true, + "type": "number" + }, + { + "name": "xOverscroll", + "description": "The number of additional pixels to scroll back along the X axis, in addition to the given\ndistance.", + "optional": true, + "type": "number" + }, + { + "name": "yOverscroll", + "description": "The number of additional pixels to scroll back along the Y axis, in addition to the given\ndistance.", + "optional": true, + "type": "number" + }, + { + "name": "preventFling", + "description": "Prevent fling (default: true).", + "optional": true, + "type": "boolean" + }, + { + "name": "speed", + "description": "Swipe speed in pixels per second (default: 800).", + "optional": true, + "type": "integer" + }, + { + "name": "gestureSourceType", + "description": "Which type of input events to be generated (default: 'default', which queries the platform\nfor the preferred input type).", + "optional": true, + "$ref": "GestureSourceType" + }, + { + "name": "repeatCount", + "description": "The number of times to repeat the gesture (default: 0).", + "optional": true, + "type": "integer" + }, + { + "name": "repeatDelayMs", + "description": "The number of milliseconds delay between each repeat. (default: 250).", + "optional": true, + "type": "integer" + }, + { + "name": "interactionMarkerName", + "description": "The name of the interaction markers to generate, if not empty (default: \"\").", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "synthesizeTapGesture", + "description": "Synthesizes a tap gesture over a time period by issuing appropriate touch events.", + "experimental": true, + "parameters": [ + { + "name": "x", + "description": "X coordinate of the start of the gesture in CSS pixels.", + "type": "number" + }, + { + "name": "y", + "description": "Y coordinate of the start of the gesture in CSS pixels.", + "type": "number" + }, + { + "name": "duration", + "description": "Duration between touchdown and touchup events in ms (default: 50).", + "optional": true, + "type": "integer" + }, + { + "name": "tapCount", + "description": "Number of times to perform the tap (e.g. 2 for double tap, default: 1).", + "optional": true, + "type": "integer" + }, + { + "name": "gestureSourceType", + "description": "Which type of input events to be generated (default: 'default', which queries the platform\nfor the preferred input type).", + "optional": true, + "$ref": "GestureSourceType" + } + ] + } + ] + }, + { + "domain": "Inspector", + "experimental": true, + "commands": [ { "name": "disable", "description": "Disables inspector domain notifications." + }, + { + "name": "enable", + "description": "Enables inspector domain notifications." } ], "events": [ @@ -25,8 +6139,8 @@ "parameters": [ { "name": "reason", - "type": "string", - "description": "The reason why connection has been terminated." + "description": "The reason why connection has been terminated.", + "type": "string" } ] }, @@ -36,18 +6150,595 @@ } ] }, + { + "domain": "LayerTree", + "experimental": true, + "dependencies": [ + "DOM" + ], + "types": [ + { + "id": "LayerId", + "description": "Unique Layer identifier.", + "type": "string" + }, + { + "id": "SnapshotId", + "description": "Unique snapshot identifier.", + "type": "string" + }, + { + "id": "ScrollRect", + "description": "Rectangle where scrolling happens on the main thread.", + "type": "object", + "properties": [ + { + "name": "rect", + "description": "Rectangle itself.", + "$ref": "DOM.Rect" + }, + { + "name": "type", + "description": "Reason for rectangle to force scrolling on the main thread", + "type": "string", + "enum": [ + "RepaintsOnScroll", + "TouchEventHandler", + "WheelEventHandler" + ] + } + ] + }, + { + "id": "StickyPositionConstraint", + "description": "Sticky position constraints.", + "type": "object", + "properties": [ + { + "name": "stickyBoxRect", + "description": "Layout rectangle of the sticky element before being shifted", + "$ref": "DOM.Rect" + }, + { + "name": "containingBlockRect", + "description": "Layout rectangle of the containing block of the sticky element", + "$ref": "DOM.Rect" + }, + { + "name": "nearestLayerShiftingStickyBox", + "description": "The nearest sticky layer that shifts the sticky box", + "optional": true, + "$ref": "LayerId" + }, + { + "name": "nearestLayerShiftingContainingBlock", + "description": "The nearest sticky layer that shifts the containing block", + "optional": true, + "$ref": "LayerId" + } + ] + }, + { + "id": "PictureTile", + "description": "Serialized fragment of layer picture along with its offset within the layer.", + "type": "object", + "properties": [ + { + "name": "x", + "description": "Offset from owning layer left boundary", + "type": "number" + }, + { + "name": "y", + "description": "Offset from owning layer top boundary", + "type": "number" + }, + { + "name": "picture", + "description": "Base64-encoded snapshot data.", + "type": "string" + } + ] + }, + { + "id": "Layer", + "description": "Information about a compositing layer.", + "type": "object", + "properties": [ + { + "name": "layerId", + "description": "The unique id for this layer.", + "$ref": "LayerId" + }, + { + "name": "parentLayerId", + "description": "The id of parent (not present for root).", + "optional": true, + "$ref": "LayerId" + }, + { + "name": "backendNodeId", + "description": "The backend id for the node associated with this layer.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "offsetX", + "description": "Offset from parent layer, X coordinate.", + "type": "number" + }, + { + "name": "offsetY", + "description": "Offset from parent layer, Y coordinate.", + "type": "number" + }, + { + "name": "width", + "description": "Layer width.", + "type": "number" + }, + { + "name": "height", + "description": "Layer height.", + "type": "number" + }, + { + "name": "transform", + "description": "Transformation matrix for layer, default is identity matrix", + "optional": true, + "type": "array", + "items": { + "type": "number" + } + }, + { + "name": "anchorX", + "description": "Transform anchor point X, absent if no transform specified", + "optional": true, + "type": "number" + }, + { + "name": "anchorY", + "description": "Transform anchor point Y, absent if no transform specified", + "optional": true, + "type": "number" + }, + { + "name": "anchorZ", + "description": "Transform anchor point Z, absent if no transform specified", + "optional": true, + "type": "number" + }, + { + "name": "paintCount", + "description": "Indicates how many time this layer has painted.", + "type": "integer" + }, + { + "name": "drawsContent", + "description": "Indicates whether this layer hosts any content, rather than being used for\ntransform/scrolling purposes only.", + "type": "boolean" + }, + { + "name": "invisible", + "description": "Set if layer is not visible.", + "optional": true, + "type": "boolean" + }, + { + "name": "scrollRects", + "description": "Rectangles scrolling on main thread only.", + "optional": true, + "type": "array", + "items": { + "$ref": "ScrollRect" + } + }, + { + "name": "stickyPositionConstraint", + "description": "Sticky position constraint information", + "optional": true, + "$ref": "StickyPositionConstraint" + } + ] + }, + { + "id": "PaintProfile", + "description": "Array of timings, one per paint step.", + "type": "array", + "items": { + "type": "number" + } + } + ], + "commands": [ + { + "name": "compositingReasons", + "description": "Provides the reasons why the given layer was composited.", + "parameters": [ + { + "name": "layerId", + "description": "The id of the layer for which we want to get the reasons it was composited.", + "$ref": "LayerId" + } + ], + "returns": [ + { + "name": "compositingReasons", + "description": "A list of strings specifying reasons for the given layer to become composited.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "disable", + "description": "Disables compositing tree inspection." + }, + { + "name": "enable", + "description": "Enables compositing tree inspection." + }, + { + "name": "loadSnapshot", + "description": "Returns the snapshot identifier.", + "parameters": [ + { + "name": "tiles", + "description": "An array of tiles composing the snapshot.", + "type": "array", + "items": { + "$ref": "PictureTile" + } + } + ], + "returns": [ + { + "name": "snapshotId", + "description": "The id of the snapshot.", + "$ref": "SnapshotId" + } + ] + }, + { + "name": "makeSnapshot", + "description": "Returns the layer snapshot identifier.", + "parameters": [ + { + "name": "layerId", + "description": "The id of the layer.", + "$ref": "LayerId" + } + ], + "returns": [ + { + "name": "snapshotId", + "description": "The id of the layer snapshot.", + "$ref": "SnapshotId" + } + ] + }, + { + "name": "profileSnapshot", + "parameters": [ + { + "name": "snapshotId", + "description": "The id of the layer snapshot.", + "$ref": "SnapshotId" + }, + { + "name": "minRepeatCount", + "description": "The maximum number of times to replay the snapshot (1, if not specified).", + "optional": true, + "type": "integer" + }, + { + "name": "minDuration", + "description": "The minimum duration (in seconds) to replay the snapshot.", + "optional": true, + "type": "number" + }, + { + "name": "clipRect", + "description": "The clip rectangle to apply when replaying the snapshot.", + "optional": true, + "$ref": "DOM.Rect" + } + ], + "returns": [ + { + "name": "timings", + "description": "The array of paint profiles, one per run.", + "type": "array", + "items": { + "$ref": "PaintProfile" + } + } + ] + }, + { + "name": "releaseSnapshot", + "description": "Releases layer snapshot captured by the back-end.", + "parameters": [ + { + "name": "snapshotId", + "description": "The id of the layer snapshot.", + "$ref": "SnapshotId" + } + ] + }, + { + "name": "replaySnapshot", + "description": "Replays the layer snapshot and returns the resulting bitmap.", + "parameters": [ + { + "name": "snapshotId", + "description": "The id of the layer snapshot.", + "$ref": "SnapshotId" + }, + { + "name": "fromStep", + "description": "The first step to replay from (replay from the very start if not specified).", + "optional": true, + "type": "integer" + }, + { + "name": "toStep", + "description": "The last step to replay to (replay till the end if not specified).", + "optional": true, + "type": "integer" + }, + { + "name": "scale", + "description": "The scale to apply while replaying (defaults to 1).", + "optional": true, + "type": "number" + } + ], + "returns": [ + { + "name": "dataURL", + "description": "A data: URL for resulting image.", + "type": "string" + } + ] + }, + { + "name": "snapshotCommandLog", + "description": "Replays the layer snapshot and returns canvas log.", + "parameters": [ + { + "name": "snapshotId", + "description": "The id of the layer snapshot.", + "$ref": "SnapshotId" + } + ], + "returns": [ + { + "name": "commandLog", + "description": "The array of canvas function calls.", + "type": "array", + "items": { + "type": "object" + } + } + ] + } + ], + "events": [ + { + "name": "layerPainted", + "parameters": [ + { + "name": "layerId", + "description": "The id of the painted layer.", + "$ref": "LayerId" + }, + { + "name": "clip", + "description": "Clip rectangle.", + "$ref": "DOM.Rect" + } + ] + }, + { + "name": "layerTreeDidChange", + "parameters": [ + { + "name": "layers", + "description": "Layer tree, absent if not in the comspositing mode.", + "optional": true, + "type": "array", + "items": { + "$ref": "Layer" + } + } + ] + } + ] + }, + { + "domain": "Log", + "description": "Provides access to log entries.", + "dependencies": [ + "Runtime", + "Network" + ], + "types": [ + { + "id": "LogEntry", + "description": "Log entry.", + "type": "object", + "properties": [ + { + "name": "source", + "description": "Log entry source.", + "type": "string", + "enum": [ + "xml", + "javascript", + "network", + "storage", + "appcache", + "rendering", + "security", + "deprecation", + "worker", + "violation", + "intervention", + "recommendation", + "other" + ] + }, + { + "name": "level", + "description": "Log entry severity.", + "type": "string", + "enum": [ + "verbose", + "info", + "warning", + "error" + ] + }, + { + "name": "text", + "description": "Logged text.", + "type": "string" + }, + { + "name": "timestamp", + "description": "Timestamp when this entry was added.", + "$ref": "Runtime.Timestamp" + }, + { + "name": "url", + "description": "URL of the resource if known.", + "optional": true, + "type": "string" + }, + { + "name": "lineNumber", + "description": "Line number in the resource.", + "optional": true, + "type": "integer" + }, + { + "name": "stackTrace", + "description": "JavaScript stack trace.", + "optional": true, + "$ref": "Runtime.StackTrace" + }, + { + "name": "networkRequestId", + "description": "Identifier of the network request associated with this entry.", + "optional": true, + "$ref": "Network.RequestId" + }, + { + "name": "workerId", + "description": "Identifier of the worker associated with this entry.", + "optional": true, + "type": "string" + }, + { + "name": "args", + "description": "Call arguments.", + "optional": true, + "type": "array", + "items": { + "$ref": "Runtime.RemoteObject" + } + } + ] + }, + { + "id": "ViolationSetting", + "description": "Violation configuration setting.", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Violation type.", + "type": "string", + "enum": [ + "longTask", + "longLayout", + "blockedEvent", + "blockedParser", + "discouragedAPIUse", + "handler", + "recurringHandler" + ] + }, + { + "name": "threshold", + "description": "Time threshold to trigger upon.", + "type": "number" + } + ] + } + ], + "commands": [ + { + "name": "clear", + "description": "Clears the log." + }, + { + "name": "disable", + "description": "Disables log domain, prevents further log entries from being reported to the client." + }, + { + "name": "enable", + "description": "Enables log domain, sends the entries collected so far to the client by means of the\n`entryAdded` notification." + }, + { + "name": "startViolationsReport", + "description": "start violation reporting.", + "parameters": [ + { + "name": "config", + "description": "Configuration for violations.", + "type": "array", + "items": { + "$ref": "ViolationSetting" + } + } + ] + }, + { + "name": "stopViolationsReport", + "description": "Stop violation reporting." + } + ], + "events": [ + { + "name": "entryAdded", + "description": "Issued when new message was logged.", + "parameters": [ + { + "name": "entry", + "description": "The entry.", + "$ref": "LogEntry" + } + ] + } + ] + }, { "domain": "Memory", "experimental": true, "types": [ { "id": "PressureLevel", + "description": "Memory pressure level.", "type": "string", "enum": [ "moderate", "critical" - ], - "description": "Memory pressure level." + ] } ], "commands": [ @@ -77,8 +6768,8 @@ "parameters": [ { "name": "suppressed", - "type": "boolean", - "description": "If true, memory pressure notifications will be suppressed." + "description": "If true, memory pressure notifications will be suppressed.", + "type": "boolean" } ] }, @@ -88,75 +6779,2203 @@ "parameters": [ { "name": "level", - "$ref": "PressureLevel", - "description": "Memory pressure level of the notification." + "description": "Memory pressure level of the notification.", + "$ref": "PressureLevel" } ] } ] }, { - "domain": "Performance", + "domain": "Network", + "description": "Network domain allows tracking network activities of the page. It exposes information about http,\nfile, data and other requests and responses, their headers, bodies, timing, etc.", + "dependencies": [ + "Debugger", + "Runtime", + "Security" + ], "types": [ { - "id": "Metric", + "id": "LoaderId", + "description": "Unique loader identifier.", + "type": "string" + }, + { + "id": "RequestId", + "description": "Unique request identifier.", + "type": "string" + }, + { + "id": "InterceptionId", + "description": "Unique intercepted request identifier.", + "type": "string" + }, + { + "id": "ErrorReason", + "description": "Network level fetch failure reason.", + "type": "string", + "enum": [ + "Failed", + "Aborted", + "TimedOut", + "AccessDenied", + "ConnectionClosed", + "ConnectionReset", + "ConnectionRefused", + "ConnectionAborted", + "ConnectionFailed", + "NameNotResolved", + "InternetDisconnected", + "AddressUnreachable" + ] + }, + { + "id": "TimeSinceEpoch", + "description": "UTC time in seconds, counted from January 1, 1970.", + "type": "number" + }, + { + "id": "MonotonicTime", + "description": "Monotonically increasing time in seconds since an arbitrary point in the past.", + "type": "number" + }, + { + "id": "Headers", + "description": "Request / response headers as keys / values of JSON object.", + "type": "object" + }, + { + "id": "ConnectionType", + "description": "The underlying connection technology that the browser is supposedly using.", + "type": "string", + "enum": [ + "none", + "cellular2g", + "cellular3g", + "cellular4g", + "bluetooth", + "ethernet", + "wifi", + "wimax", + "other" + ] + }, + { + "id": "CookieSameSite", + "description": "Represents the cookie's 'SameSite' status:\nhttps://tools.ietf.org/html/draft-west-first-party-cookies", + "type": "string", + "enum": [ + "Strict", + "Lax" + ] + }, + { + "id": "ResourceTiming", + "description": "Timing information for the request.", + "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.", + "type": "number" + }, + { + "name": "proxyStart", + "description": "Started resolving proxy.", + "type": "number" + }, + { + "name": "proxyEnd", + "description": "Finished resolving proxy.", + "type": "number" + }, + { + "name": "dnsStart", + "description": "Started DNS address resolve.", + "type": "number" + }, + { + "name": "dnsEnd", + "description": "Finished DNS address resolve.", + "type": "number" + }, + { + "name": "connectStart", + "description": "Started connecting to the remote host.", + "type": "number" + }, + { + "name": "connectEnd", + "description": "Connected to the remote host.", + "type": "number" + }, + { + "name": "sslStart", + "description": "Started SSL handshake.", + "type": "number" + }, + { + "name": "sslEnd", + "description": "Finished SSL handshake.", + "type": "number" + }, + { + "name": "workerStart", + "description": "Started running ServiceWorker.", + "experimental": true, + "type": "number" + }, + { + "name": "workerReady", + "description": "Finished Starting ServiceWorker.", + "experimental": true, + "type": "number" + }, + { + "name": "sendStart", + "description": "Started sending request.", + "type": "number" + }, + { + "name": "sendEnd", + "description": "Finished sending request.", + "type": "number" + }, + { + "name": "pushStart", + "description": "Time the server started pushing request.", + "experimental": true, + "type": "number" + }, + { + "name": "pushEnd", + "description": "Time the server finished pushing request.", + "experimental": true, + "type": "number" + }, + { + "name": "receiveHeadersEnd", + "description": "Finished receiving response headers.", + "type": "number" + } + ] + }, + { + "id": "ResourcePriority", + "description": "Loading priority of a resource request.", + "type": "string", + "enum": [ + "VeryLow", + "Low", + "Medium", + "High", + "VeryHigh" + ] + }, + { + "id": "Request", + "description": "HTTP request data.", + "type": "object", + "properties": [ + { + "name": "url", + "description": "Request URL.", + "type": "string" + }, + { + "name": "method", + "description": "HTTP request method.", + "type": "string" + }, + { + "name": "headers", + "description": "HTTP request headers.", + "$ref": "Headers" + }, + { + "name": "postData", + "description": "HTTP POST request data.", + "optional": true, + "type": "string" + }, + { + "name": "mixedContentType", + "description": "The mixed content type of the request.", + "optional": true, + "$ref": "Security.MixedContentType" + }, + { + "name": "initialPriority", + "description": "Priority of the resource request at the time request is sent.", + "$ref": "ResourcePriority" + }, + { + "name": "referrerPolicy", + "description": "The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/", + "type": "string", + "enum": [ + "unsafe-url", + "no-referrer-when-downgrade", + "no-referrer", + "origin", + "origin-when-cross-origin", + "same-origin", + "strict-origin", + "strict-origin-when-cross-origin" + ] + }, + { + "name": "isLinkPreload", + "description": "Whether is loaded via link preload.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "id": "SignedCertificateTimestamp", + "description": "Details of a signed certificate timestamp (SCT).", + "type": "object", + "properties": [ + { + "name": "status", + "description": "Validation status.", + "type": "string" + }, + { + "name": "origin", + "description": "Origin.", + "type": "string" + }, + { + "name": "logDescription", + "description": "Log name / description.", + "type": "string" + }, + { + "name": "logId", + "description": "Log ID.", + "type": "string" + }, + { + "name": "timestamp", + "description": "Issuance date.", + "$ref": "TimeSinceEpoch" + }, + { + "name": "hashAlgorithm", + "description": "Hash algorithm.", + "type": "string" + }, + { + "name": "signatureAlgorithm", + "description": "Signature algorithm.", + "type": "string" + }, + { + "name": "signatureData", + "description": "Signature data.", + "type": "string" + } + ] + }, + { + "id": "SecurityDetails", + "description": "Security details about a request.", + "type": "object", + "properties": [ + { + "name": "protocol", + "description": "Protocol name (e.g. \"TLS 1.2\" or \"QUIC\").", + "type": "string" + }, + { + "name": "keyExchange", + "description": "Key Exchange used by the connection, or the empty string if not applicable.", + "type": "string" + }, + { + "name": "keyExchangeGroup", + "description": "(EC)DH group used by the connection, if applicable.", + "optional": true, + "type": "string" + }, + { + "name": "cipher", + "description": "Cipher name.", + "type": "string" + }, + { + "name": "mac", + "description": "TLS MAC. Note that AEAD ciphers do not have separate MACs.", + "optional": true, + "type": "string" + }, + { + "name": "certificateId", + "description": "Certificate ID value.", + "$ref": "Security.CertificateId" + }, + { + "name": "subjectName", + "description": "Certificate subject name.", + "type": "string" + }, + { + "name": "sanList", + "description": "Subject Alternative Name (SAN) DNS names and IP addresses.", + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "issuer", + "description": "Name of the issuing CA.", + "type": "string" + }, + { + "name": "validFrom", + "description": "Certificate valid from date.", + "$ref": "TimeSinceEpoch" + }, + { + "name": "validTo", + "description": "Certificate valid to (expiration) date", + "$ref": "TimeSinceEpoch" + }, + { + "name": "signedCertificateTimestampList", + "description": "List of signed certificate timestamps (SCTs).", + "type": "array", + "items": { + "$ref": "SignedCertificateTimestamp" + } + } + ] + }, + { + "id": "BlockedReason", + "description": "The reason why request was blocked.", + "type": "string", + "enum": [ + "csp", + "mixed-content", + "origin", + "inspector", + "subresource-filter", + "other" + ] + }, + { + "id": "Response", + "description": "HTTP response data.", + "type": "object", + "properties": [ + { + "name": "url", + "description": "Response URL. This URL can be different from CachedResource.url in case of redirect.", + "type": "string" + }, + { + "name": "status", + "description": "HTTP response status code.", + "type": "integer" + }, + { + "name": "statusText", + "description": "HTTP response status text.", + "type": "string" + }, + { + "name": "headers", + "description": "HTTP response headers.", + "$ref": "Headers" + }, + { + "name": "headersText", + "description": "HTTP response headers text.", + "optional": true, + "type": "string" + }, + { + "name": "mimeType", + "description": "Resource mimeType as determined by the browser.", + "type": "string" + }, + { + "name": "requestHeaders", + "description": "Refined HTTP request headers that were actually transmitted over the network.", + "optional": true, + "$ref": "Headers" + }, + { + "name": "requestHeadersText", + "description": "HTTP request headers text.", + "optional": true, + "type": "string" + }, + { + "name": "connectionReused", + "description": "Specifies whether physical connection was actually reused for this request.", + "type": "boolean" + }, + { + "name": "connectionId", + "description": "Physical connection id that was actually used for this request.", + "type": "number" + }, + { + "name": "remoteIPAddress", + "description": "Remote IP address.", + "optional": true, + "type": "string" + }, + { + "name": "remotePort", + "description": "Remote port.", + "optional": true, + "type": "integer" + }, + { + "name": "fromDiskCache", + "description": "Specifies that the request was served from the disk cache.", + "optional": true, + "type": "boolean" + }, + { + "name": "fromServiceWorker", + "description": "Specifies that the request was served from the ServiceWorker.", + "optional": true, + "type": "boolean" + }, + { + "name": "encodedDataLength", + "description": "Total number of bytes received for this request so far.", + "type": "number" + }, + { + "name": "timing", + "description": "Timing information for the given request.", + "optional": true, + "$ref": "ResourceTiming" + }, + { + "name": "protocol", + "description": "Protocol used to fetch this request.", + "optional": true, + "type": "string" + }, + { + "name": "securityState", + "description": "Security state of the request resource.", + "$ref": "Security.SecurityState" + }, + { + "name": "securityDetails", + "description": "Security details for the request.", + "optional": true, + "$ref": "SecurityDetails" + } + ] + }, + { + "id": "WebSocketRequest", + "description": "WebSocket request data.", + "type": "object", + "properties": [ + { + "name": "headers", + "description": "HTTP request headers.", + "$ref": "Headers" + } + ] + }, + { + "id": "WebSocketResponse", + "description": "WebSocket response data.", + "type": "object", + "properties": [ + { + "name": "status", + "description": "HTTP response status code.", + "type": "integer" + }, + { + "name": "statusText", + "description": "HTTP response status text.", + "type": "string" + }, + { + "name": "headers", + "description": "HTTP response headers.", + "$ref": "Headers" + }, + { + "name": "headersText", + "description": "HTTP response headers text.", + "optional": true, + "type": "string" + }, + { + "name": "requestHeaders", + "description": "HTTP request headers.", + "optional": true, + "$ref": "Headers" + }, + { + "name": "requestHeadersText", + "description": "HTTP request headers text.", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "WebSocketFrame", + "description": "WebSocket frame data.", + "type": "object", + "properties": [ + { + "name": "opcode", + "description": "WebSocket frame opcode.", + "type": "number" + }, + { + "name": "mask", + "description": "WebSocke frame mask.", + "type": "boolean" + }, + { + "name": "payloadData", + "description": "WebSocke frame payload data.", + "type": "string" + } + ] + }, + { + "id": "CachedResource", + "description": "Information about the cached resource.", + "type": "object", + "properties": [ + { + "name": "url", + "description": "Resource URL. This is the url of the original network request.", + "type": "string" + }, + { + "name": "type", + "description": "Type of this resource.", + "$ref": "Page.ResourceType" + }, + { + "name": "response", + "description": "Cached response data.", + "optional": true, + "$ref": "Response" + }, + { + "name": "bodySize", + "description": "Cached response body size.", + "type": "number" + } + ] + }, + { + "id": "Initiator", + "description": "Information about the request initiator.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "Type of this initiator.", + "type": "string", + "enum": [ + "parser", + "script", + "preload", + "other" + ] + }, + { + "name": "stack", + "description": "Initiator JavaScript stack trace, set for Script only.", + "optional": true, + "$ref": "Runtime.StackTrace" + }, + { + "name": "url", + "description": "Initiator URL, set for Parser type or for Script type (when script is importing module).", + "optional": true, + "type": "string" + }, + { + "name": "lineNumber", + "description": "Initiator line number, set for Parser type or for Script type (when script is importing\nmodule) (0-based).", + "optional": true, + "type": "number" + } + ] + }, + { + "id": "Cookie", + "description": "Cookie object", "type": "object", "properties": [ { "name": "name", - "type": "string", - "description": "Metric name." + "description": "Cookie name.", + "type": "string" }, { "name": "value", - "type": "number", - "description": "Metric value." + "description": "Cookie value.", + "type": "string" + }, + { + "name": "domain", + "description": "Cookie domain.", + "type": "string" + }, + { + "name": "path", + "description": "Cookie path.", + "type": "string" + }, + { + "name": "expires", + "description": "Cookie expiration date as the number of seconds since the UNIX epoch.", + "type": "number" + }, + { + "name": "size", + "description": "Cookie size.", + "type": "integer" + }, + { + "name": "httpOnly", + "description": "True if cookie is http-only.", + "type": "boolean" + }, + { + "name": "secure", + "description": "True if cookie is secure.", + "type": "boolean" + }, + { + "name": "session", + "description": "True in case of session cookie.", + "type": "boolean" + }, + { + "name": "sameSite", + "description": "Cookie SameSite type.", + "optional": true, + "$ref": "CookieSameSite" } - ], - "description": "Run-time execution metric." + ] + }, + { + "id": "CookieParam", + "description": "Cookie parameter object", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Cookie name.", + "type": "string" + }, + { + "name": "value", + "description": "Cookie value.", + "type": "string" + }, + { + "name": "url", + "description": "The request-URI to associate with the setting of the cookie. This value can affect the\ndefault domain and path values of the created cookie.", + "optional": true, + "type": "string" + }, + { + "name": "domain", + "description": "Cookie domain.", + "optional": true, + "type": "string" + }, + { + "name": "path", + "description": "Cookie path.", + "optional": true, + "type": "string" + }, + { + "name": "secure", + "description": "True if cookie is secure.", + "optional": true, + "type": "boolean" + }, + { + "name": "httpOnly", + "description": "True if cookie is http-only.", + "optional": true, + "type": "boolean" + }, + { + "name": "sameSite", + "description": "Cookie SameSite type.", + "optional": true, + "$ref": "CookieSameSite" + }, + { + "name": "expires", + "description": "Cookie expiration date, session cookie if not set", + "optional": true, + "$ref": "TimeSinceEpoch" + } + ] + }, + { + "id": "AuthChallenge", + "description": "Authorization challenge for HTTP status code 401 or 407.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "source", + "description": "Source of the authentication challenge.", + "optional": true, + "type": "string", + "enum": [ + "Server", + "Proxy" + ] + }, + { + "name": "origin", + "description": "Origin of the challenger.", + "type": "string" + }, + { + "name": "scheme", + "description": "The authentication scheme used, such as basic or digest", + "type": "string" + }, + { + "name": "realm", + "description": "The realm of the challenge. May be empty.", + "type": "string" + } + ] + }, + { + "id": "AuthChallengeResponse", + "description": "Response to an AuthChallenge.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "response", + "description": "The decision on what to do in response to the authorization challenge. Default means\ndeferring to the default behavior of the net stack, which will likely either the Cancel\nauthentication or display a popup dialog box.", + "type": "string", + "enum": [ + "Default", + "CancelAuth", + "ProvideCredentials" + ] + }, + { + "name": "username", + "description": "The username to provide, possibly empty. Should only be set if response is\nProvideCredentials.", + "optional": true, + "type": "string" + }, + { + "name": "password", + "description": "The password to provide, possibly empty. Should only be set if response is\nProvideCredentials.", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "InterceptionStage", + "description": "Stages of the interception to begin intercepting. Request will intercept before the request is\nsent. Response will intercept after the response is received.", + "experimental": true, + "type": "string", + "enum": [ + "Request", + "HeadersReceived" + ] + }, + { + "id": "RequestPattern", + "description": "Request pattern for interception.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "urlPattern", + "description": "Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is\nbackslash. Omitting is equivalent to \"*\".", + "optional": true, + "type": "string" + }, + { + "name": "resourceType", + "description": "If set, only requests for matching resource types will be intercepted.", + "optional": true, + "$ref": "Page.ResourceType" + }, + { + "name": "interceptionStage", + "description": "Stage at wich to begin intercepting requests. Default is Request.", + "optional": true, + "$ref": "InterceptionStage" + } + ] } ], "commands": [ { - "name": "enable", - "description": "Enable collecting and reporting metrics." + "name": "canClearBrowserCache", + "description": "Tells whether clearing browser cache is supported.", + "deprecated": true, + "returns": [ + { + "name": "result", + "description": "True if browser cache can be cleared.", + "type": "boolean" + } + ] + }, + { + "name": "canClearBrowserCookies", + "description": "Tells whether clearing browser cookies is supported.", + "deprecated": true, + "returns": [ + { + "name": "result", + "description": "True if browser cookies can be cleared.", + "type": "boolean" + } + ] + }, + { + "name": "canEmulateNetworkConditions", + "description": "Tells whether emulation of network conditions is supported.", + "deprecated": true, + "returns": [ + { + "name": "result", + "description": "True if emulation of network conditions is supported.", + "type": "boolean" + } + ] + }, + { + "name": "clearBrowserCache", + "description": "Clears browser cache." + }, + { + "name": "clearBrowserCookies", + "description": "Clears browser cookies." + }, + { + "name": "continueInterceptedRequest", + "description": "Response to Network.requestIntercepted which either modifies the request to continue with any\nmodifications, or blocks it, or completes it with the provided response bytes. If a network\nfetch occurs as a result which encounters a redirect an additional Network.requestIntercepted\nevent will be sent with the same InterceptionId.", + "experimental": true, + "parameters": [ + { + "name": "interceptionId", + "$ref": "InterceptionId" + }, + { + "name": "errorReason", + "description": "If set this causes the request to fail with the given reason. Passing `Aborted` for requests\nmarked with `isNavigationRequest` also cancels the navigation. Must not be set in response\nto an authChallenge.", + "optional": true, + "$ref": "ErrorReason" + }, + { + "name": "rawResponse", + "description": "If set the requests completes using with the provided base64 encoded raw response, including\nHTTP status line and headers etc... Must not be set in response to an authChallenge.", + "optional": true, + "type": "string" + }, + { + "name": "url", + "description": "If set the request url will be modified in a way that's not observable by page. Must not be\nset in response to an authChallenge.", + "optional": true, + "type": "string" + }, + { + "name": "method", + "description": "If set this allows the request method to be overridden. Must not be set in response to an\nauthChallenge.", + "optional": true, + "type": "string" + }, + { + "name": "postData", + "description": "If set this allows postData to be set. Must not be set in response to an authChallenge.", + "optional": true, + "type": "string" + }, + { + "name": "headers", + "description": "If set this allows the request headers to be changed. Must not be set in response to an\nauthChallenge.", + "optional": true, + "$ref": "Headers" + }, + { + "name": "authChallengeResponse", + "description": "Response to a requestIntercepted with an authChallenge. Must not be set otherwise.", + "optional": true, + "$ref": "AuthChallengeResponse" + } + ] + }, + { + "name": "deleteCookies", + "description": "Deletes browser cookies with matching name and url or domain/path pair.", + "parameters": [ + { + "name": "name", + "description": "Name of the cookies to remove.", + "type": "string" + }, + { + "name": "url", + "description": "If specified, deletes all the cookies with the given name where domain and path match\nprovided URL.", + "optional": true, + "type": "string" + }, + { + "name": "domain", + "description": "If specified, deletes only cookies with the exact domain.", + "optional": true, + "type": "string" + }, + { + "name": "path", + "description": "If specified, deletes only cookies with the exact path.", + "optional": true, + "type": "string" + } + ] }, { "name": "disable", - "description": "Disable collecting and reporting metrics." + "description": "Disables network tracking, prevents network events from being sent to the client." }, { - "name": "getMetrics", + "name": "emulateNetworkConditions", + "description": "Activates emulation of network conditions.", + "parameters": [ + { + "name": "offline", + "description": "True to emulate internet disconnection.", + "type": "boolean" + }, + { + "name": "latency", + "description": "Minimum latency from request sent to response headers received (ms).", + "type": "number" + }, + { + "name": "downloadThroughput", + "description": "Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.", + "type": "number" + }, + { + "name": "uploadThroughput", + "description": "Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.", + "type": "number" + }, + { + "name": "connectionType", + "description": "Connection type if known.", + "optional": true, + "$ref": "ConnectionType" + } + ] + }, + { + "name": "enable", + "description": "Enables network tracking, network events will now be delivered to the client.", + "parameters": [ + { + "name": "maxTotalBufferSize", + "description": "Buffer size in bytes to use when preserving network payloads (XHRs, etc).", + "experimental": true, + "optional": true, + "type": "integer" + }, + { + "name": "maxResourceBufferSize", + "description": "Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).", + "experimental": true, + "optional": true, + "type": "integer" + } + ] + }, + { + "name": "getAllCookies", + "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie\ninformation in the `cookies` field.", "returns": [ { - "name": "metrics", + "name": "cookies", + "description": "Array of cookie objects.", "type": "array", "items": { - "$ref": "Metric" - }, - "description": "Current values for run-time metrics." + "$ref": "Cookie" + } + } + ] + }, + { + "name": "getCertificate", + "description": "Returns the DER-encoded certificate.", + "experimental": true, + "parameters": [ + { + "name": "origin", + "description": "Origin to get certificate for.", + "type": "string" } ], - "description": "Retrieve current values of run-time metrics." + "returns": [ + { + "name": "tableNames", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "getCookies", + "description": "Returns all browser cookies for the current URL. Depending on the backend support, will return\ndetailed cookie information in the `cookies` field.", + "parameters": [ + { + "name": "urls", + "description": "The list of URLs for which applicable cookies will be fetched", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + } + ], + "returns": [ + { + "name": "cookies", + "description": "Array of cookie objects.", + "type": "array", + "items": { + "$ref": "Cookie" + } + } + ] + }, + { + "name": "getResponseBody", + "description": "Returns content served for the given request.", + "parameters": [ + { + "name": "requestId", + "description": "Identifier of the network request to get content for.", + "$ref": "RequestId" + } + ], + "returns": [ + { + "name": "body", + "description": "Response body.", + "type": "string" + }, + { + "name": "base64Encoded", + "description": "True, if content was sent as base64.", + "type": "boolean" + } + ] + }, + { + "name": "getResponseBodyForInterception", + "description": "Returns content served for the given currently intercepted request.", + "experimental": true, + "parameters": [ + { + "name": "interceptionId", + "description": "Identifier for the intercepted request to get body for.", + "$ref": "InterceptionId" + } + ], + "returns": [ + { + "name": "body", + "description": "Response body.", + "type": "string" + }, + { + "name": "base64Encoded", + "description": "True, if content was sent as base64.", + "type": "boolean" + } + ] + }, + { + "name": "replayXHR", + "description": "This method sends a new XMLHttpRequest which is identical to the original one. The following\nparameters should be identical: method, url, async, request body, extra headers, withCredentials\nattribute, user, password.", + "experimental": true, + "parameters": [ + { + "name": "requestId", + "description": "Identifier of XHR to replay.", + "$ref": "RequestId" + } + ] + }, + { + "name": "searchInResponseBody", + "description": "Searches for given string in response content.", + "experimental": true, + "parameters": [ + { + "name": "requestId", + "description": "Identifier of the network response to search.", + "$ref": "RequestId" + }, + { + "name": "query", + "description": "String to search for.", + "type": "string" + }, + { + "name": "caseSensitive", + "description": "If true, search is case sensitive.", + "optional": true, + "type": "boolean" + }, + { + "name": "isRegex", + "description": "If true, treats string parameter as regex.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "result", + "description": "List of search matches.", + "type": "array", + "items": { + "$ref": "Debugger.SearchMatch" + } + } + ] + }, + { + "name": "setBlockedURLs", + "description": "Blocks URLs from loading.", + "experimental": true, + "parameters": [ + { + "name": "urls", + "description": "URL patterns to block. Wildcards ('*') are allowed.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "setBypassServiceWorker", + "description": "Toggles ignoring of service worker for each request.", + "experimental": true, + "parameters": [ + { + "name": "bypass", + "description": "Bypass service worker and load from network.", + "type": "boolean" + } + ] + }, + { + "name": "setCacheDisabled", + "description": "Toggles ignoring cache for each request. If `true`, cache will not be used.", + "parameters": [ + { + "name": "cacheDisabled", + "description": "Cache disabled state.", + "type": "boolean" + } + ] + }, + { + "name": "setCookie", + "description": "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.", + "parameters": [ + { + "name": "name", + "description": "Cookie name.", + "type": "string" + }, + { + "name": "value", + "description": "Cookie value.", + "type": "string" + }, + { + "name": "url", + "description": "The request-URI to associate with the setting of the cookie. This value can affect the\ndefault domain and path values of the created cookie.", + "optional": true, + "type": "string" + }, + { + "name": "domain", + "description": "Cookie domain.", + "optional": true, + "type": "string" + }, + { + "name": "path", + "description": "Cookie path.", + "optional": true, + "type": "string" + }, + { + "name": "secure", + "description": "True if cookie is secure.", + "optional": true, + "type": "boolean" + }, + { + "name": "httpOnly", + "description": "True if cookie is http-only.", + "optional": true, + "type": "boolean" + }, + { + "name": "sameSite", + "description": "Cookie SameSite type.", + "optional": true, + "$ref": "CookieSameSite" + }, + { + "name": "expires", + "description": "Cookie expiration date, session cookie if not set", + "optional": true, + "$ref": "TimeSinceEpoch" + } + ], + "returns": [ + { + "name": "success", + "description": "True if successfully set cookie.", + "type": "boolean" + } + ] + }, + { + "name": "setCookies", + "description": "Sets given cookies.", + "parameters": [ + { + "name": "cookies", + "description": "Cookies to be set.", + "type": "array", + "items": { + "$ref": "CookieParam" + } + } + ] + }, + { + "name": "setDataSizeLimitsForTest", + "description": "For testing.", + "experimental": true, + "parameters": [ + { + "name": "maxTotalSize", + "description": "Maximum total buffer size.", + "type": "integer" + }, + { + "name": "maxResourceSize", + "description": "Maximum per-resource size.", + "type": "integer" + } + ] + }, + { + "name": "setExtraHTTPHeaders", + "description": "Specifies whether to always send extra HTTP headers with the requests from this page.", + "parameters": [ + { + "name": "headers", + "description": "Map with extra HTTP headers.", + "$ref": "Headers" + } + ] + }, + { + "name": "setRequestInterception", + "description": "Sets the requests to intercept that match a the provided patterns and optionally resource types.", + "experimental": true, + "parameters": [ + { + "name": "patterns", + "description": "Requests matching any of these patterns will be forwarded and wait for the corresponding\ncontinueInterceptedRequest call.", + "type": "array", + "items": { + "$ref": "RequestPattern" + } + } + ] + }, + { + "name": "setUserAgentOverride", + "description": "Allows overriding user agent with the given string.", + "parameters": [ + { + "name": "userAgent", + "description": "User agent to use.", + "type": "string" + } + ] } ], "events": [ { - "name": "metrics", - "description": "Current values of the metrics.", + "name": "dataReceived", + "description": "Fired when data chunk was received over the network.", "parameters": [ { - "name": "metrics", - "type": "array", - "items": { - "$ref": "Metric" - }, - "description": "Current values of the metrics." + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" }, { - "name": "title", - "type": "string", - "description": "Timestamp title." + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "dataLength", + "description": "Data chunk length.", + "type": "integer" + }, + { + "name": "encodedDataLength", + "description": "Actual bytes received (might be less than dataLength for compressed encodings).", + "type": "integer" + } + ] + }, + { + "name": "eventSourceMessageReceived", + "description": "Fired when EventSource message is received.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "eventName", + "description": "Message type.", + "type": "string" + }, + { + "name": "eventId", + "description": "Message identifier.", + "type": "string" + }, + { + "name": "data", + "description": "Message content.", + "type": "string" + } + ] + }, + { + "name": "loadingFailed", + "description": "Fired when HTTP request has failed to load.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "type", + "description": "Resource type.", + "$ref": "Page.ResourceType" + }, + { + "name": "errorText", + "description": "User friendly error message.", + "type": "string" + }, + { + "name": "canceled", + "description": "True if loading was canceled.", + "optional": true, + "type": "boolean" + }, + { + "name": "blockedReason", + "description": "The reason why loading was blocked, if any.", + "optional": true, + "$ref": "BlockedReason" + } + ] + }, + { + "name": "loadingFinished", + "description": "Fired when HTTP request has finished loading.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "encodedDataLength", + "description": "Total number of bytes received for this request.", + "type": "number" + } + ] + }, + { + "name": "requestIntercepted", + "description": "Details of an intercepted HTTP request, which must be either allowed, blocked, modified or\nmocked.", + "experimental": true, + "parameters": [ + { + "name": "interceptionId", + "description": "Each request the page makes will have a unique id, however if any redirects are encountered\nwhile processing that fetch, they will be reported with the same id as the original fetch.\nLikewise if HTTP authentication is needed then the same fetch id will be used.", + "$ref": "InterceptionId" + }, + { + "name": "request", + "$ref": "Request" + }, + { + "name": "frameId", + "description": "The id of the frame that initiated the request.", + "$ref": "Page.FrameId" + }, + { + "name": "resourceType", + "description": "How the requested resource will be used.", + "$ref": "Page.ResourceType" + }, + { + "name": "isNavigationRequest", + "description": "Whether this is a navigation request, which can abort the navigation completely.", + "type": "boolean" + }, + { + "name": "redirectUrl", + "description": "Redirect location, only sent if a redirect was intercepted.", + "optional": true, + "type": "string" + }, + { + "name": "authChallenge", + "description": "Details of the Authorization Challenge encountered. If this is set then\ncontinueInterceptedRequest must contain an authChallengeResponse.", + "optional": true, + "$ref": "AuthChallenge" + }, + { + "name": "responseErrorReason", + "description": "Response error if intercepted at response stage or if redirect occurred while intercepting\nrequest.", + "optional": true, + "$ref": "ErrorReason" + }, + { + "name": "responseStatusCode", + "description": "Response code if intercepted at response stage or if redirect occurred while intercepting\nrequest or auth retry occurred.", + "optional": true, + "type": "integer" + }, + { + "name": "responseHeaders", + "description": "Response headers if intercepted at the response stage or if redirect occurred while\nintercepting request or auth retry occurred.", + "optional": true, + "$ref": "Headers" + } + ] + }, + { + "name": "requestServedFromCache", + "description": "Fired if request ended up loading from cache.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + } + ] + }, + { + "name": "requestWillBeSent", + "description": "Fired when page is about to send HTTP request.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "loaderId", + "description": "Loader identifier. Empty string if the request is fetched from worker.", + "$ref": "LoaderId" + }, + { + "name": "documentURL", + "description": "URL of the document this request is loaded for.", + "type": "string" + }, + { + "name": "request", + "description": "Request data.", + "$ref": "Request" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "wallTime", + "description": "Timestamp.", + "$ref": "TimeSinceEpoch" + }, + { + "name": "initiator", + "description": "Request initiator.", + "$ref": "Initiator" + }, + { + "name": "redirectResponse", + "description": "Redirect response data.", + "optional": true, + "$ref": "Response" + }, + { + "name": "type", + "description": "Type of this resource.", + "optional": true, + "$ref": "Page.ResourceType" + }, + { + "name": "frameId", + "description": "Frame identifier.", + "optional": true, + "$ref": "Page.FrameId" + } + ] + }, + { + "name": "resourceChangedPriority", + "description": "Fired when resource loading priority is changed", + "experimental": true, + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "newPriority", + "description": "New priority", + "$ref": "ResourcePriority" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + } + ] + }, + { + "name": "responseReceived", + "description": "Fired when HTTP response is available.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "loaderId", + "description": "Loader identifier. Empty string if the request is fetched from worker.", + "$ref": "LoaderId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "type", + "description": "Resource type.", + "$ref": "Page.ResourceType" + }, + { + "name": "response", + "description": "Response data.", + "$ref": "Response" + }, + { + "name": "frameId", + "description": "Frame identifier.", + "optional": true, + "$ref": "Page.FrameId" + } + ] + }, + { + "name": "webSocketClosed", + "description": "Fired when WebSocket is closed.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + } + ] + }, + { + "name": "webSocketCreated", + "description": "Fired upon WebSocket creation.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "url", + "description": "WebSocket request URL.", + "type": "string" + }, + { + "name": "initiator", + "description": "Request initiator.", + "optional": true, + "$ref": "Initiator" + } + ] + }, + { + "name": "webSocketFrameError", + "description": "Fired when WebSocket frame error occurs.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "errorMessage", + "description": "WebSocket frame error message.", + "type": "string" + } + ] + }, + { + "name": "webSocketFrameReceived", + "description": "Fired when WebSocket frame is received.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "response", + "description": "WebSocket response data.", + "$ref": "WebSocketFrame" + } + ] + }, + { + "name": "webSocketFrameSent", + "description": "Fired when WebSocket frame is sent.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "response", + "description": "WebSocket response data.", + "$ref": "WebSocketFrame" + } + ] + }, + { + "name": "webSocketHandshakeResponseReceived", + "description": "Fired when WebSocket handshake response becomes available.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "response", + "description": "WebSocket response data.", + "$ref": "WebSocketResponse" + } + ] + }, + { + "name": "webSocketWillSendHandshakeRequest", + "description": "Fired when WebSocket is about to initiate handshake.", + "parameters": [ + { + "name": "requestId", + "description": "Request identifier.", + "$ref": "RequestId" + }, + { + "name": "timestamp", + "description": "Timestamp.", + "$ref": "MonotonicTime" + }, + { + "name": "wallTime", + "description": "UTC Timestamp.", + "$ref": "TimeSinceEpoch" + }, + { + "name": "request", + "description": "WebSocket request data.", + "$ref": "WebSocketRequest" + } + ] + } + ] + }, + { + "domain": "Overlay", + "description": "This domain provides various functionality related to drawing atop the inspected page.", + "experimental": true, + "dependencies": [ + "DOM", + "Page", + "Runtime" + ], + "types": [ + { + "id": "HighlightConfig", + "description": "Configuration data for the highlighting of page elements.", + "type": "object", + "properties": [ + { + "name": "showInfo", + "description": "Whether the node info tooltip should be shown (default: false).", + "optional": true, + "type": "boolean" + }, + { + "name": "showRulers", + "description": "Whether the rulers should be shown (default: false).", + "optional": true, + "type": "boolean" + }, + { + "name": "showExtensionLines", + "description": "Whether the extension lines from node to the rulers should be shown (default: false).", + "optional": true, + "type": "boolean" + }, + { + "name": "displayAsMaterial", + "optional": true, + "type": "boolean" + }, + { + "name": "contentColor", + "description": "The content box highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "paddingColor", + "description": "The padding highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "borderColor", + "description": "The border highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "marginColor", + "description": "The margin highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "eventTargetColor", + "description": "The event target element highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "shapeColor", + "description": "The shape outside fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "shapeMarginColor", + "description": "The shape margin fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "selectorList", + "description": "Selectors to highlight relevant nodes.", + "optional": true, + "type": "string" + }, + { + "name": "cssGridColor", + "description": "The grid layout color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + } + ] + }, + { + "id": "InspectMode", + "type": "string", + "enum": [ + "searchForNode", + "searchForUAShadowDOM", + "none" + ] + } + ], + "commands": [ + { + "name": "disable", + "description": "Disables domain notifications." + }, + { + "name": "enable", + "description": "Enables domain notifications." + }, + { + "name": "getHighlightObjectForTest", + "description": "For testing.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node to get highlight object for.", + "$ref": "DOM.NodeId" + } + ], + "returns": [ + { + "name": "highlight", + "description": "Highlight data for the node.", + "type": "object" + } + ] + }, + { + "name": "hideHighlight", + "description": "Hides any highlight." + }, + { + "name": "highlightFrame", + "description": "Highlights owner element of the frame with given id.", + "parameters": [ + { + "name": "frameId", + "description": "Identifier of the frame to highlight.", + "$ref": "Page.FrameId" + }, + { + "name": "contentColor", + "description": "The content box highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "contentOutlineColor", + "description": "The content box highlight outline color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + } + ] + }, + { + "name": "highlightNode", + "description": "Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or\nobjectId must be specified.", + "parameters": [ + { + "name": "highlightConfig", + "description": "A descriptor for the highlight appearance.", + "$ref": "HighlightConfig" + }, + { + "name": "nodeId", + "description": "Identifier of the node to highlight.", + "optional": true, + "$ref": "DOM.NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node to highlight.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "objectId", + "description": "JavaScript object id of the node to be highlighted.", + "optional": true, + "$ref": "Runtime.RemoteObjectId" + } + ] + }, + { + "name": "highlightQuad", + "description": "Highlights given quad. Coordinates are absolute with respect to the main frame viewport.", + "parameters": [ + { + "name": "quad", + "description": "Quad to highlight", + "$ref": "DOM.Quad" + }, + { + "name": "color", + "description": "The highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "outlineColor", + "description": "The highlight outline color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + } + ] + }, + { + "name": "highlightRect", + "description": "Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.", + "parameters": [ + { + "name": "x", + "description": "X coordinate", + "type": "integer" + }, + { + "name": "y", + "description": "Y coordinate", + "type": "integer" + }, + { + "name": "width", + "description": "Rectangle width", + "type": "integer" + }, + { + "name": "height", + "description": "Rectangle height", + "type": "integer" + }, + { + "name": "color", + "description": "The highlight fill color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + }, + { + "name": "outlineColor", + "description": "The highlight outline color (default: transparent).", + "optional": true, + "$ref": "DOM.RGBA" + } + ] + }, + { + "name": "setInspectMode", + "description": "Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted.\nBackend then generates 'inspectNodeRequested' event upon element selection.", + "parameters": [ + { + "name": "mode", + "description": "Set an inspection mode.", + "$ref": "InspectMode" + }, + { + "name": "highlightConfig", + "description": "A descriptor for the highlight appearance of hovered-over nodes. May be omitted if `enabled\n== false`.", + "optional": true, + "$ref": "HighlightConfig" + } + ] + }, + { + "name": "setPausedInDebuggerMessage", + "parameters": [ + { + "name": "message", + "description": "The message to display, also triggers resume and step over controls.", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "setShowDebugBorders", + "description": "Requests that backend shows debug borders on layers", + "parameters": [ + { + "name": "show", + "description": "True for showing debug borders", + "type": "boolean" + } + ] + }, + { + "name": "setShowFPSCounter", + "description": "Requests that backend shows the FPS counter", + "parameters": [ + { + "name": "show", + "description": "True for showing the FPS counter", + "type": "boolean" + } + ] + }, + { + "name": "setShowPaintRects", + "description": "Requests that backend shows paint rectangles", + "parameters": [ + { + "name": "result", + "description": "True for showing paint rectangles", + "type": "boolean" + } + ] + }, + { + "name": "setShowScrollBottleneckRects", + "description": "Requests that backend shows scroll bottleneck rects", + "parameters": [ + { + "name": "show", + "description": "True for showing scroll bottleneck rects", + "type": "boolean" + } + ] + }, + { + "name": "setShowViewportSizeOnResize", + "description": "Paints viewport size upon main frame resize.", + "parameters": [ + { + "name": "show", + "description": "Whether to paint size or not.", + "type": "boolean" + } + ] + }, + { + "name": "setSuspended", + "parameters": [ + { + "name": "suspended", + "description": "Whether overlay should be suspended and not consume any resources until resumed.", + "type": "boolean" + } + ] + } + ], + "events": [ + { + "name": "inspectNodeRequested", + "description": "Fired when the node should be inspected. This happens after call to `setInspectMode` or when\nuser manually inspects an element.", + "parameters": [ + { + "name": "backendNodeId", + "description": "Id of the node to inspect.", + "$ref": "DOM.BackendNodeId" + } + ] + }, + { + "name": "nodeHighlightRequested", + "description": "Fired when the node should be highlighted. This happens after call to `setInspectMode`.", + "parameters": [ + { + "name": "nodeId", + "$ref": "DOM.NodeId" + } + ] + }, + { + "name": "screenshotRequested", + "description": "Fired when user asks to capture screenshot of some area on the page.", + "parameters": [ + { + "name": "viewport", + "description": "Viewport to capture, in CSS.", + "$ref": "Page.Viewport" } ] } @@ -173,6 +8992,7 @@ "types": [ { "id": "ResourceType", + "description": "Resource type as it was perceived by the rendering engine.", "type": "string", "enum": [ "Document", @@ -188,172 +9008,171 @@ "WebSocket", "Manifest", "Other" - ], - "description": "Resource type as it was perceived by the rendering engine." + ] }, { "id": "FrameId", - "type": "string", - "description": "Unique frame identifier." + "description": "Unique frame identifier.", + "type": "string" }, { "id": "Frame", - "type": "object", "description": "Information about the Frame on the page.", + "type": "object", "properties": [ { "name": "id", - "type": "string", - "description": "Frame unique identifier." + "description": "Frame unique identifier.", + "type": "string" }, { "name": "parentId", - "type": "string", + "description": "Parent frame identifier.", "optional": true, - "description": "Parent frame identifier." + "type": "string" }, { "name": "loaderId", - "$ref": "Network.LoaderId", - "description": "Identifier of the loader associated with this frame." + "description": "Identifier of the loader associated with this frame.", + "$ref": "Network.LoaderId" }, { "name": "name", - "type": "string", + "description": "Frame's name as specified in the tag.", "optional": true, - "description": "Frame's name as specified in the tag." + "type": "string" }, { "name": "url", - "type": "string", - "description": "Frame document's URL." + "description": "Frame document's URL.", + "type": "string" }, { "name": "securityOrigin", - "type": "string", - "description": "Frame document's security origin." + "description": "Frame document's security origin.", + "type": "string" }, { "name": "mimeType", - "type": "string", - "description": "Frame document's mimeType as determined by the browser." + "description": "Frame document's mimeType as determined by the browser.", + "type": "string" }, { "name": "unreachableUrl", - "type": "string", - "optional": true, + "description": "If the frame failed to load, this contains the URL that could not be loaded.", "experimental": true, - "description": "If the frame failed to load, this contains the URL that could not be loaded." + "optional": true, + "type": "string" } ] }, { "id": "FrameResource", - "type": "object", "description": "Information about the Resource on the page.", + "experimental": true, + "type": "object", "properties": [ { "name": "url", - "type": "string", - "description": "Resource URL." + "description": "Resource URL.", + "type": "string" }, { "name": "type", - "$ref": "ResourceType", - "description": "Type of this resource." + "description": "Type of this resource.", + "$ref": "ResourceType" }, { "name": "mimeType", - "type": "string", - "description": "Resource mimeType as determined by the browser." + "description": "Resource mimeType as determined by the browser.", + "type": "string" }, { "name": "lastModified", - "$ref": "Network.TimeSinceEpoch", "description": "last-modified timestamp as reported by server.", - "optional": true + "optional": true, + "$ref": "Network.TimeSinceEpoch" }, { "name": "contentSize", - "type": "number", "description": "Resource content size.", - "optional": true + "optional": true, + "type": "number" }, { "name": "failed", - "type": "boolean", + "description": "True if the resource failed to load.", "optional": true, - "description": "True if the resource failed to load." + "type": "boolean" }, { "name": "canceled", - "type": "boolean", + "description": "True if the resource was canceled during loading.", "optional": true, - "description": "True if the resource was canceled during loading." + "type": "boolean" } - ], - "experimental": true + ] }, { "id": "FrameResourceTree", - "type": "object", "description": "Information about the Frame hierarchy along with their cached resources.", + "experimental": true, + "type": "object", "properties": [ { "name": "frame", - "$ref": "Frame", - "description": "Frame information for this tree item." + "description": "Frame information for this tree item.", + "$ref": "Frame" }, { "name": "childFrames", - "type": "array", + "description": "Child frames.", "optional": true, + "type": "array", "items": { "$ref": "FrameResourceTree" - }, - "description": "Child frames." + } }, { "name": "resources", + "description": "Information about frame resources.", "type": "array", "items": { "$ref": "FrameResource" - }, - "description": "Information about frame resources." + } } - ], - "experimental": true + ] }, { "id": "FrameTree", - "type": "object", "description": "Information about the Frame hierarchy.", + "type": "object", "properties": [ { "name": "frame", - "$ref": "Frame", - "description": "Frame information for this tree item." + "description": "Frame information for this tree item.", + "$ref": "Frame" }, { "name": "childFrames", - "type": "array", + "description": "Child frames.", "optional": true, + "type": "array", "items": { "$ref": "FrameTree" - }, - "description": "Child frames." + } } ] }, { "id": "ScriptIdentifier", - "type": "string", - "description": "Unique script identifier." + "description": "Unique script identifier.", + "type": "string" }, { "id": "TransitionType", - "type": "string", "description": "Transition type.", + "type": "string", "enum": [ "link", "typed", @@ -371,79 +9190,79 @@ }, { "id": "NavigationEntry", - "type": "object", "description": "Navigation history entry.", + "type": "object", "properties": [ { "name": "id", - "type": "integer", - "description": "Unique id of the navigation history entry." + "description": "Unique id of the navigation history entry.", + "type": "integer" }, { "name": "url", - "type": "string", - "description": "URL of the navigation history entry." + "description": "URL of the navigation history entry.", + "type": "string" }, { "name": "userTypedURL", - "type": "string", - "description": "URL that the user typed in the url bar." + "description": "URL that the user typed in the url bar.", + "type": "string" }, { "name": "title", - "type": "string", - "description": "Title of the navigation history entry." + "description": "Title of the navigation history entry.", + "type": "string" }, { "name": "transitionType", - "$ref": "TransitionType", - "description": "Transition type." + "description": "Transition type.", + "$ref": "TransitionType" } ] }, { "id": "ScreencastFrameMetadata", - "type": "object", "description": "Screencast frame metadata.", + "experimental": true, + "type": "object", "properties": [ { "name": "offsetTop", - "type": "number", - "description": "Top offset in DIP." + "description": "Top offset in DIP.", + "type": "number" }, { "name": "pageScaleFactor", - "type": "number", - "description": "Page scale factor." + "description": "Page scale factor.", + "type": "number" }, { "name": "deviceWidth", - "type": "number", - "description": "Device screen width in DIP." + "description": "Device screen width in DIP.", + "type": "number" }, { "name": "deviceHeight", - "type": "number", - "description": "Device screen height in DIP." + "description": "Device screen height in DIP.", + "type": "number" }, { "name": "scrollOffsetX", - "type": "number", - "description": "Position of horizontal scroll in CSS pixels." + "description": "Position of horizontal scroll in CSS pixels.", + "type": "number" }, { "name": "scrollOffsetY", - "type": "number", - "description": "Position of vertical scroll in CSS pixels." + "description": "Position of vertical scroll in CSS pixels.", + "type": "number" }, { "name": "timestamp", - "$ref": "Network.TimeSinceEpoch", + "description": "Frame swap timestamp.", "optional": true, - "description": "Frame swap timestamp." + "$ref": "Network.TimeSinceEpoch" } - ], - "experimental": true + ] }, { "id": "DialogType", @@ -463,139 +9282,134 @@ "properties": [ { "name": "message", - "type": "string", - "description": "Error message." + "description": "Error message.", + "type": "string" }, { "name": "critical", - "type": "integer", - "description": "If criticial, this is a non-recoverable parse error." + "description": "If criticial, this is a non-recoverable parse error.", + "type": "integer" }, { "name": "line", - "type": "integer", - "description": "Error line." + "description": "Error line.", + "type": "integer" }, { "name": "column", - "type": "integer", - "description": "Error column." + "description": "Error column.", + "type": "integer" } ] }, { "id": "LayoutViewport", - "type": "object", "description": "Layout viewport position and dimensions.", + "type": "object", "properties": [ { "name": "pageX", - "type": "integer", - "description": "Horizontal offset relative to the document (CSS pixels)." + "description": "Horizontal offset relative to the document (CSS pixels).", + "type": "integer" }, { "name": "pageY", - "type": "integer", - "description": "Vertical offset relative to the document (CSS pixels)." + "description": "Vertical offset relative to the document (CSS pixels).", + "type": "integer" }, { "name": "clientWidth", - "type": "integer", - "description": "Width (CSS pixels), excludes scrollbar if present." + "description": "Width (CSS pixels), excludes scrollbar if present.", + "type": "integer" }, { "name": "clientHeight", - "type": "integer", - "description": "Height (CSS pixels), excludes scrollbar if present." + "description": "Height (CSS pixels), excludes scrollbar if present.", + "type": "integer" } ] }, { "id": "VisualViewport", - "type": "object", "description": "Visual viewport position, dimensions, and scale.", + "type": "object", "properties": [ { "name": "offsetX", - "type": "number", - "description": "Horizontal offset relative to the layout viewport (CSS pixels)." + "description": "Horizontal offset relative to the layout viewport (CSS pixels).", + "type": "number" }, { "name": "offsetY", - "type": "number", - "description": "Vertical offset relative to the layout viewport (CSS pixels)." + "description": "Vertical offset relative to the layout viewport (CSS pixels).", + "type": "number" }, { "name": "pageX", - "type": "number", - "description": "Horizontal offset relative to the document (CSS pixels)." + "description": "Horizontal offset relative to the document (CSS pixels).", + "type": "number" }, { "name": "pageY", - "type": "number", - "description": "Vertical offset relative to the document (CSS pixels)." + "description": "Vertical offset relative to the document (CSS pixels).", + "type": "number" }, { "name": "clientWidth", - "type": "number", - "description": "Width (CSS pixels), excludes scrollbar if present." + "description": "Width (CSS pixels), excludes scrollbar if present.", + "type": "number" }, { "name": "clientHeight", - "type": "number", - "description": "Height (CSS pixels), excludes scrollbar if present." + "description": "Height (CSS pixels), excludes scrollbar if present.", + "type": "number" }, { "name": "scale", - "type": "number", - "description": "Scale relative to the ideal viewport (size at width=device-width)." + "description": "Scale relative to the ideal viewport (size at width=device-width).", + "type": "number" } ] }, { "id": "Viewport", - "type": "object", "description": "Viewport for capturing screenshot.", + "type": "object", "properties": [ { "name": "x", - "type": "number", - "description": "X offset in CSS pixels." + "description": "X offset in CSS pixels.", + "type": "number" }, { "name": "y", - "type": "number", - "description": "Y offset in CSS pixels" + "description": "Y offset in CSS pixels", + "type": "number" }, { "name": "width", - "type": "number", - "description": "Rectangle width in CSS pixels" + "description": "Rectangle width in CSS pixels", + "type": "number" }, { "name": "height", - "type": "number", - "description": "Rectangle height in CSS pixels" + "description": "Rectangle height in CSS pixels", + "type": "number" }, { "name": "scale", - "type": "number", - "description": "Page scale factor." + "description": "Page scale factor.", + "type": "number" } ] } ], "commands": [ - { - "name": "enable", - "description": "Enables page domain notifications." - }, - { - "name": "disable", - "description": "Disables page domain notifications." - }, { "name": "addScriptToEvaluateOnLoad", + "description": "Deprecated, please use addScriptToEvaluateOnNewDocument instead.", + "experimental": true, + "deprecated": true, "parameters": [ { "name": "scriptSource", @@ -605,28 +9419,14 @@ "returns": [ { "name": "identifier", - "$ref": "ScriptIdentifier", - "description": "Identifier of the added script." - } - ], - "deprecated": true, - "description": "Deprecated, please use addScriptToEvaluateOnNewDocument instead.", - "experimental": true - }, - { - "name": "removeScriptToEvaluateOnLoad", - "parameters": [ - { - "name": "identifier", + "description": "Identifier of the added script.", "$ref": "ScriptIdentifier" } - ], - "deprecated": true, - "description": "Deprecated, please use removeScriptToEvaluateOnNewDocument instead.", - "experimental": true + ] }, { "name": "addScriptToEvaluateOnNewDocument", + "description": "Evaluates given script in every frame upon creation (before loading frame's scripts).", "parameters": [ { "name": "source", @@ -636,470 +9436,14 @@ "returns": [ { "name": "identifier", - "$ref": "ScriptIdentifier", - "description": "Identifier of the added script." - } - ], - "description": "Evaluates given script in every frame upon creation (before loading frame's scripts)." - }, - { - "name": "removeScriptToEvaluateOnNewDocument", - "parameters": [ - { - "name": "identifier", + "description": "Identifier of the added script.", "$ref": "ScriptIdentifier" } - ], - "description": "Removes given script from the list." - }, - { - "name": "setAutoAttachToCreatedPages", - "parameters": [ - { - "name": "autoAttach", - "type": "boolean", - "description": "If true, browser will open a new inspector window for every page created from this one." - } - ], - "description": "Controls whether browser will open a new inspector window for connected pages.", - "experimental": true - }, - { - "name": "setLifecycleEventsEnabled", - "parameters": [ - { - "name": "enabled", - "type": "boolean", - "description": "If true, starts emitting lifecycle events." - } - ], - "description": "Controls whether page will emit lifecycle events.", - "experimental": true - }, - { - "name": "reload", - "parameters": [ - { - "name": "ignoreCache", - "type": "boolean", - "optional": true, - "description": "If true, browser cache is ignored (as if the user pressed Shift+refresh)." - }, - { - "name": "scriptToEvaluateOnLoad", - "type": "string", - "optional": true, - "description": "If set, the script will be injected into all frames of the inspected page after reload." - } - ], - "description": "Reloads given page optionally ignoring the cache." - }, - { - "name": "setAdBlockingEnabled", - "description": "Enable Chrome's experimental ad filter on all sites.", - "parameters": [ - { - "name": "enabled", - "type": "boolean", - "description": "Whether to block ads." - } - ], - "experimental": true - }, - { - "name": "navigate", - "parameters": [ - { - "name": "url", - "type": "string", - "description": "URL to navigate the page to." - }, - { - "name": "referrer", - "type": "string", - "optional": true, - "description": "Referrer URL." - }, - { - "name": "transitionType", - "$ref": "TransitionType", - "optional": true, - "description": "Intended transition type." - } - ], - "returns": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Frame id that has navigated (or failed to navigate)" - }, - { - "name": "loaderId", - "$ref": "Network.LoaderId", - "optional": true, - "description": "Loader identifier." - }, - { - "name": "errorText", - "type": "string", - "optional": true, - "description": "User friendly error message, present if and only if navigation has failed." - } - ], - "description": "Navigates current page to the given URL." - }, - { - "name": "stopLoading", - "description": "Force the page stop all navigations and pending resource fetches." - }, - { - "name": "getNavigationHistory", - "returns": [ - { - "name": "currentIndex", - "type": "integer", - "description": "Index of the current navigation history entry." - }, - { - "name": "entries", - "type": "array", - "items": { - "$ref": "NavigationEntry" - }, - "description": "Array of navigation history entries." - } - ], - "description": "Returns navigation history for the current page." - }, - { - "name": "navigateToHistoryEntry", - "parameters": [ - { - "name": "entryId", - "type": "integer", - "description": "Unique id of the entry to navigate to." - } - ], - "description": "Navigates current page to the given history entry." - }, - { - "name": "getCookies", - "returns": [ - { - "name": "cookies", - "type": "array", - "items": { - "$ref": "Network.Cookie" - }, - "description": "Array of cookie objects." - } - ], - "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies field.", - "deprecated": true, - "experimental": true, - "redirect": "Network" - }, - { - "name": "deleteCookie", - "parameters": [ - { - "name": "cookieName", - "type": "string", - "description": "Name of the cookie to remove." - }, - { - "name": "url", - "type": "string", - "description": "URL to match cooke domain and path." - } - ], - "description": "Deletes browser cookie with given name, domain and path.", - "deprecated": true, - "experimental": true, - "redirect": "Network" - }, - { - "name": "getResourceTree", - "description": "Returns present frame / resource tree structure.", - "returns": [ - { - "name": "frameTree", - "$ref": "FrameResourceTree", - "description": "Present frame / resource tree structure." - } - ], - "experimental": true - }, - { - "name": "getFrameTree", - "description": "Returns present frame tree structure.", - "returns": [ - { - "name": "frameTree", - "$ref": "FrameTree", - "description": "Present frame tree structure." - } ] }, { - "name": "getResourceContent", - "description": "Returns content of the given resource.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Frame id to get resource for." - }, - { - "name": "url", - "type": "string", - "description": "URL of the resource to get content for." - } - ], - "returns": [ - { - "name": "content", - "type": "string", - "description": "Resource content." - }, - { - "name": "base64Encoded", - "type": "boolean", - "description": "True, if content was served as base64." - } - ], - "experimental": true - }, - { - "name": "searchInResource", - "description": "Searches for given string in resource content.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Frame id for resource to search in." - }, - { - "name": "url", - "type": "string", - "description": "URL of the resource to search in." - }, - { - "name": "query", - "type": "string", - "description": "String to search for." - }, - { - "name": "caseSensitive", - "type": "boolean", - "optional": true, - "description": "If true, search is case sensitive." - }, - { - "name": "isRegex", - "type": "boolean", - "optional": true, - "description": "If true, treats string parameter as regex." - } - ], - "returns": [ - { - "name": "result", - "type": "array", - "items": { - "$ref": "Debugger.SearchMatch" - }, - "description": "List of search matches." - } - ], - "experimental": true - }, - { - "name": "setDocumentContent", - "description": "Sets given markup as the document's HTML.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Frame id to set HTML for." - }, - { - "name": "html", - "type": "string", - "description": "HTML content to set." - } - ] - }, - { - "name": "setDeviceMetricsOverride", - "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results).", - "parameters": [ - { - "name": "width", - "type": "integer", - "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override." - }, - { - "name": "height", - "type": "integer", - "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." - }, - { - "name": "deviceScaleFactor", - "type": "number", - "description": "Overriding device scale factor value. 0 disables the override." - }, - { - "name": "mobile", - "type": "boolean", - "description": "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more." - }, - { - "name": "scale", - "type": "number", - "optional": true, - "description": "Scale to apply to resulting view image." - }, - { - "name": "screenWidth", - "type": "integer", - "optional": true, - "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "screenHeight", - "type": "integer", - "optional": true, - "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "positionX", - "type": "integer", - "optional": true, - "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "positionY", - "type": "integer", - "optional": true, - "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "dontSetVisibleSize", - "type": "boolean", - "optional": true, - "description": "Do not set visible view size, rely upon explicit setVisibleSize call." - }, - { - "name": "screenOrientation", - "$ref": "Emulation.ScreenOrientation", - "optional": true, - "description": "Screen orientation override." - }, - { - "name": "viewport", - "$ref": "Viewport", - "optional": true, - "description": "The viewport dimensions and scale. If not set, the override is cleared." - } - ], - "experimental": true, - "deprecated": true, - "redirect": "Emulation" - }, - { - "name": "clearDeviceMetricsOverride", - "description": "Clears the overriden device metrics.", - "redirect": "Emulation", - "deprecated": true, - "experimental": true - }, - { - "name": "setGeolocationOverride", - "description": "Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.", - "parameters": [ - { - "name": "latitude", - "type": "number", - "optional": true, - "description": "Mock latitude" - }, - { - "name": "longitude", - "type": "number", - "optional": true, - "description": "Mock longitude" - }, - { - "name": "accuracy", - "type": "number", - "optional": true, - "description": "Mock accuracy" - } - ], - "redirect": "Emulation", - "deprecated": true - }, - { - "name": "clearGeolocationOverride", - "description": "Clears the overriden Geolocation Position and Error.", - "redirect": "Emulation", - "deprecated": true - }, - { - "name": "setDeviceOrientationOverride", - "description": "Overrides the Device Orientation.", - "parameters": [ - { - "name": "alpha", - "type": "number", - "description": "Mock alpha" - }, - { - "name": "beta", - "type": "number", - "description": "Mock beta" - }, - { - "name": "gamma", - "type": "number", - "description": "Mock gamma" - } - ], - "redirect": "DeviceOrientation", - "deprecated": true, - "experimental": true - }, - { - "name": "clearDeviceOrientationOverride", - "description": "Clears the overridden Device Orientation.", - "redirect": "DeviceOrientation", - "deprecated": true, - "experimental": true - }, - { - "name": "setTouchEmulationEnabled", - "parameters": [ - { - "name": "enabled", - "type": "boolean", - "description": "Whether the touch event emulation should be enabled." - }, - { - "name": "configuration", - "type": "string", - "enum": [ - "mobile", - "desktop" - ], - "optional": true, - "description": "Touch/gesture events configuration. Default: current platform." - } - ], - "description": "Toggles mouse event-based touch event emulation.", - "experimental": true, - "deprecated": true, - "redirect": "Emulation" + "name": "bringToFront", + "description": "Brings page to front (activates tab)." }, { "name": "captureScreenshot", @@ -1107,209 +9451,126 @@ "parameters": [ { "name": "format", - "type": "string", + "description": "Image compression format (defaults to png).", "optional": true, + "type": "string", "enum": [ "jpeg", "png" - ], - "description": "Image compression format (defaults to png)." + ] }, { "name": "quality", - "type": "integer", + "description": "Compression quality from range [0..100] (jpeg only).", "optional": true, - "description": "Compression quality from range [0..100] (jpeg only)." + "type": "integer" }, { "name": "clip", - "$ref": "Viewport", + "description": "Capture the screenshot of a given region only.", "optional": true, - "description": "Capture the screenshot of a given region only." + "$ref": "Viewport" }, { "name": "fromSurface", - "type": "boolean", - "optional": true, "description": "Capture the screenshot from the surface, rather than the view. Defaults to true.", - "experimental": true + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ { "name": "data", - "type": "string", - "description": "Base64-encoded image data." + "description": "Base64-encoded image data.", + "type": "string" } ] }, { - "name": "printToPDF", - "description": "Print page as PDF.", + "name": "clearDeviceMetricsOverride", + "description": "Clears the overriden device metrics.", + "experimental": true, + "deprecated": true, + "redirect": "Emulation" + }, + { + "name": "clearDeviceOrientationOverride", + "description": "Clears the overridden Device Orientation.", + "experimental": true, + "deprecated": true, + "redirect": "DeviceOrientation" + }, + { + "name": "clearGeolocationOverride", + "description": "Clears the overriden Geolocation Position and Error.", + "deprecated": true, + "redirect": "Emulation" + }, + { + "name": "createIsolatedWorld", + "description": "Creates an isolated world for the given frame.", "parameters": [ { - "name": "landscape", - "type": "boolean", - "optional": true, - "description": "Paper orientation. Defaults to false." + "name": "frameId", + "description": "Id of the frame in which the isolated world should be created.", + "$ref": "FrameId" }, { - "name": "displayHeaderFooter", - "type": "boolean", + "name": "worldName", + "description": "An optional name which is reported in the Execution Context.", "optional": true, - "description": "Display header and footer. Defaults to false." + "type": "string" }, { - "name": "printBackground", - "type": "boolean", + "name": "grantUniveralAccess", + "description": "Whether or not universal access should be granted to the isolated world. This is a powerful\noption, use with caution.", "optional": true, - "description": "Print background graphics. Defaults to false." - }, - { - "name": "scale", - "type": "number", - "optional": true, - "description": "Scale of the webpage rendering. Defaults to 1." - }, - { - "name": "paperWidth", - "type": "number", - "optional": true, - "description": "Paper width in inches. Defaults to 8.5 inches." - }, - { - "name": "paperHeight", - "type": "number", - "optional": true, - "description": "Paper height in inches. Defaults to 11 inches." - }, - { - "name": "marginTop", - "type": "number", - "optional": true, - "description": "Top margin in inches. Defaults to 1cm (~0.4 inches)." - }, - { - "name": "marginBottom", - "type": "number", - "optional": true, - "description": "Bottom margin in inches. Defaults to 1cm (~0.4 inches)." - }, - { - "name": "marginLeft", - "type": "number", - "optional": true, - "description": "Left margin in inches. Defaults to 1cm (~0.4 inches)." - }, - { - "name": "marginRight", - "type": "number", - "optional": true, - "description": "Right margin in inches. Defaults to 1cm (~0.4 inches)." - }, - { - "name": "pageRanges", - "type": "string", - "optional": true, - "description": "Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages." - }, - { - "name": "ignoreInvalidPageRanges", - "type": "boolean", - "optional": true, - "description": "Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false." + "type": "boolean" } ], "returns": [ { - "name": "data", - "type": "string", - "description": "Base64-encoded pdf data." + "name": "executionContextId", + "description": "Execution context of the isolated world.", + "$ref": "Runtime.ExecutionContextId" } ] }, { - "name": "startScreencast", - "description": "Starts sending each frame using the screencastFrame event.", + "name": "deleteCookie", + "description": "Deletes browser cookie with given name, domain and path.", + "experimental": true, + "deprecated": true, + "redirect": "Network", "parameters": [ { - "name": "format", - "type": "string", - "optional": true, - "enum": [ - "jpeg", - "png" - ], - "description": "Image compression format." + "name": "cookieName", + "description": "Name of the cookie to remove.", + "type": "string" }, { - "name": "quality", - "type": "integer", - "optional": true, - "description": "Compression quality from range [0..100]." - }, - { - "name": "maxWidth", - "type": "integer", - "optional": true, - "description": "Maximum screenshot width." - }, - { - "name": "maxHeight", - "type": "integer", - "optional": true, - "description": "Maximum screenshot height." - }, - { - "name": "everyNthFrame", - "type": "integer", - "optional": true, - "description": "Send every n-th frame." - } - ], - "experimental": true - }, - { - "name": "stopScreencast", - "description": "Stops sending each frame in the screencastFrame.", - "experimental": true - }, - { - "name": "screencastFrameAck", - "description": "Acknowledges that a screencast frame has been received by the frontend.", - "parameters": [ - { - "name": "sessionId", - "type": "integer", - "description": "Frame number." - } - ], - "experimental": true - }, - { - "name": "handleJavaScriptDialog", - "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).", - "parameters": [ - { - "name": "accept", - "type": "boolean", - "description": "Whether to accept or dismiss the dialog." - }, - { - "name": "promptText", - "type": "string", - "optional": true, - "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." + "name": "url", + "description": "URL to match cooke domain and path.", + "type": "string" } ] }, + { + "name": "disable", + "description": "Disables page domain notifications." + }, + { + "name": "enable", + "description": "Enables page domain notifications." + }, { "name": "getAppManifest", "returns": [ { "name": "url", - "type": "string", - "description": "Manifest location." + "description": "Manifest location.", + "type": "string" }, { "name": "errors", @@ -1320,9 +9581,325 @@ }, { "name": "data", - "type": "string", + "description": "Manifest content.", "optional": true, - "description": "Manifest content." + "type": "string" + } + ] + }, + { + "name": "getCookies", + "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie\ninformation in the `cookies` field.", + "experimental": true, + "deprecated": true, + "redirect": "Network", + "returns": [ + { + "name": "cookies", + "description": "Array of cookie objects.", + "type": "array", + "items": { + "$ref": "Network.Cookie" + } + } + ] + }, + { + "name": "getFrameTree", + "description": "Returns present frame tree structure.", + "returns": [ + { + "name": "frameTree", + "description": "Present frame tree structure.", + "$ref": "FrameTree" + } + ] + }, + { + "name": "getLayoutMetrics", + "description": "Returns metrics relating to the layouting of the page, such as viewport bounds/scale.", + "returns": [ + { + "name": "layoutViewport", + "description": "Metrics relating to the layout viewport.", + "$ref": "LayoutViewport" + }, + { + "name": "visualViewport", + "description": "Metrics relating to the visual viewport.", + "$ref": "VisualViewport" + }, + { + "name": "contentSize", + "description": "Size of scrollable area.", + "$ref": "DOM.Rect" + } + ] + }, + { + "name": "getNavigationHistory", + "description": "Returns navigation history for the current page.", + "returns": [ + { + "name": "currentIndex", + "description": "Index of the current navigation history entry.", + "type": "integer" + }, + { + "name": "entries", + "description": "Array of navigation history entries.", + "type": "array", + "items": { + "$ref": "NavigationEntry" + } + } + ] + }, + { + "name": "getResourceContent", + "description": "Returns content of the given resource.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "Frame id to get resource for.", + "$ref": "FrameId" + }, + { + "name": "url", + "description": "URL of the resource to get content for.", + "type": "string" + } + ], + "returns": [ + { + "name": "content", + "description": "Resource content.", + "type": "string" + }, + { + "name": "base64Encoded", + "description": "True, if content was served as base64.", + "type": "boolean" + } + ] + }, + { + "name": "getResourceTree", + "description": "Returns present frame / resource tree structure.", + "experimental": true, + "returns": [ + { + "name": "frameTree", + "description": "Present frame / resource tree structure.", + "$ref": "FrameResourceTree" + } + ] + }, + { + "name": "handleJavaScriptDialog", + "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).", + "parameters": [ + { + "name": "accept", + "description": "Whether to accept or dismiss the dialog.", + "type": "boolean" + }, + { + "name": "promptText", + "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt\ndialog.", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "navigate", + "description": "Navigates current page to the given URL.", + "parameters": [ + { + "name": "url", + "description": "URL to navigate the page to.", + "type": "string" + }, + { + "name": "referrer", + "description": "Referrer URL.", + "optional": true, + "type": "string" + }, + { + "name": "transitionType", + "description": "Intended transition type.", + "optional": true, + "$ref": "TransitionType" + } + ], + "returns": [ + { + "name": "frameId", + "description": "Frame id that has navigated (or failed to navigate)", + "$ref": "FrameId" + }, + { + "name": "loaderId", + "description": "Loader identifier.", + "optional": true, + "$ref": "Network.LoaderId" + }, + { + "name": "errorText", + "description": "User friendly error message, present if and only if navigation has failed.", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "navigateToHistoryEntry", + "description": "Navigates current page to the given history entry.", + "parameters": [ + { + "name": "entryId", + "description": "Unique id of the entry to navigate to.", + "type": "integer" + } + ] + }, + { + "name": "printToPDF", + "description": "Print page as PDF.", + "parameters": [ + { + "name": "landscape", + "description": "Paper orientation. Defaults to false.", + "optional": true, + "type": "boolean" + }, + { + "name": "displayHeaderFooter", + "description": "Display header and footer. Defaults to false.", + "optional": true, + "type": "boolean" + }, + { + "name": "printBackground", + "description": "Print background graphics. Defaults to false.", + "optional": true, + "type": "boolean" + }, + { + "name": "scale", + "description": "Scale of the webpage rendering. Defaults to 1.", + "optional": true, + "type": "number" + }, + { + "name": "paperWidth", + "description": "Paper width in inches. Defaults to 8.5 inches.", + "optional": true, + "type": "number" + }, + { + "name": "paperHeight", + "description": "Paper height in inches. Defaults to 11 inches.", + "optional": true, + "type": "number" + }, + { + "name": "marginTop", + "description": "Top margin in inches. Defaults to 1cm (~0.4 inches).", + "optional": true, + "type": "number" + }, + { + "name": "marginBottom", + "description": "Bottom margin in inches. Defaults to 1cm (~0.4 inches).", + "optional": true, + "type": "number" + }, + { + "name": "marginLeft", + "description": "Left margin in inches. Defaults to 1cm (~0.4 inches).", + "optional": true, + "type": "number" + }, + { + "name": "marginRight", + "description": "Right margin in inches. Defaults to 1cm (~0.4 inches).", + "optional": true, + "type": "number" + }, + { + "name": "pageRanges", + "description": "Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means\nprint all pages.", + "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.", + "optional": true, + "type": "string" + }, + { + "name": "footerTemplate", + "description": "HTML template for the print footer. Should use the same format as the `headerTemplate`.", + "optional": true, + "type": "string" + } + ], + "returns": [ + { + "name": "data", + "description": "Base64-encoded pdf data.", + "type": "string" + } + ] + }, + { + "name": "reload", + "description": "Reloads given page optionally ignoring the cache.", + "parameters": [ + { + "name": "ignoreCache", + "description": "If true, browser cache is ignored (as if the user pressed Shift+refresh).", + "optional": true, + "type": "boolean" + }, + { + "name": "scriptToEvaluateOnLoad", + "description": "If set, the script will be injected into all frames of the inspected page after reload.\nArgument will be ignored if reloading dataURL origin.", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "removeScriptToEvaluateOnLoad", + "description": "Deprecated, please use removeScriptToEvaluateOnNewDocument instead.", + "experimental": true, + "deprecated": true, + "parameters": [ + { + "name": "identifier", + "$ref": "ScriptIdentifier" + } + ] + }, + { + "name": "removeScriptToEvaluateOnNewDocument", + "description": "Removes given script from the list.", + "parameters": [ + { + "name": "identifier", + "$ref": "ScriptIdentifier" } ] }, @@ -1331,59 +9908,201 @@ "experimental": true }, { - "name": "getLayoutMetrics", - "description": "Returns metrics relating to the layouting of the page, such as viewport bounds/scale.", - "returns": [ + "name": "screencastFrameAck", + "description": "Acknowledges that a screencast frame has been received by the frontend.", + "experimental": true, + "parameters": [ { - "name": "layoutViewport", - "$ref": "LayoutViewport", - "description": "Metrics relating to the layout viewport." - }, - { - "name": "visualViewport", - "$ref": "VisualViewport", - "description": "Metrics relating to the visual viewport." - }, - { - "name": "contentSize", - "$ref": "DOM.Rect", - "description": "Size of scrollable area." + "name": "sessionId", + "description": "Frame number.", + "type": "integer" } ] }, { - "name": "createIsolatedWorld", - "description": "Creates an isolated world for the given frame.", + "name": "searchInResource", + "description": "Searches for given string in resource content.", + "experimental": true, "parameters": [ { "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame in which the isolated world should be created." + "description": "Frame id for resource to search in.", + "$ref": "FrameId" }, { - "name": "worldName", - "type": "string", - "optional": true, - "description": "An optional name which is reported in the Execution Context." + "name": "url", + "description": "URL of the resource to search in.", + "type": "string" }, { - "name": "grantUniveralAccess", - "type": "boolean", + "name": "query", + "description": "String to search for.", + "type": "string" + }, + { + "name": "caseSensitive", + "description": "If true, search is case sensitive.", "optional": true, - "description": "Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution." + "type": "boolean" + }, + { + "name": "isRegex", + "description": "If true, treats string parameter as regex.", + "optional": true, + "type": "boolean" } ], "returns": [ { - "name": "executionContextId", - "$ref": "Runtime.ExecutionContextId", - "description": "Execution context of the isolated world." + "name": "result", + "description": "List of search matches.", + "type": "array", + "items": { + "$ref": "Debugger.SearchMatch" + } } ] }, { - "name": "bringToFront", - "description": "Brings page to front (activates tab)." + "name": "setAdBlockingEnabled", + "description": "Enable Chrome's experimental ad filter on all sites.", + "experimental": true, + "parameters": [ + { + "name": "enabled", + "description": "Whether to block ads.", + "type": "boolean" + } + ] + }, + { + "name": "setAutoAttachToCreatedPages", + "description": "Controls whether browser will open a new inspector window for connected pages.", + "experimental": true, + "parameters": [ + { + "name": "autoAttach", + "description": "If true, browser will open a new inspector window for every page created from this one.", + "type": "boolean" + } + ] + }, + { + "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).", + "experimental": true, + "deprecated": true, + "redirect": "Emulation", + "parameters": [ + { + "name": "width", + "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.", + "type": "integer" + }, + { + "name": "height", + "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.", + "type": "integer" + }, + { + "name": "deviceScaleFactor", + "description": "Overriding device scale factor value. 0 disables the override.", + "type": "number" + }, + { + "name": "mobile", + "description": "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text\nautosizing and more.", + "type": "boolean" + }, + { + "name": "scale", + "description": "Scale to apply to resulting view image.", + "optional": true, + "type": "number" + }, + { + "name": "screenWidth", + "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000).", + "optional": true, + "type": "integer" + }, + { + "name": "screenHeight", + "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000).", + "optional": true, + "type": "integer" + }, + { + "name": "positionX", + "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000).", + "optional": true, + "type": "integer" + }, + { + "name": "positionY", + "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).", + "optional": true, + "type": "integer" + }, + { + "name": "dontSetVisibleSize", + "description": "Do not set visible view size, rely upon explicit setVisibleSize call.", + "optional": true, + "type": "boolean" + }, + { + "name": "screenOrientation", + "description": "Screen orientation override.", + "optional": true, + "$ref": "Emulation.ScreenOrientation" + }, + { + "name": "viewport", + "description": "The viewport dimensions and scale. If not set, the override is cleared.", + "optional": true, + "$ref": "Viewport" + } + ] + }, + { + "name": "setDeviceOrientationOverride", + "description": "Overrides the Device Orientation.", + "experimental": true, + "deprecated": true, + "redirect": "DeviceOrientation", + "parameters": [ + { + "name": "alpha", + "description": "Mock alpha", + "type": "number" + }, + { + "name": "beta", + "description": "Mock beta", + "type": "number" + }, + { + "name": "gamma", + "description": "Mock gamma", + "type": "number" + } + ] + }, + { + "name": "setDocumentContent", + "description": "Sets given markup as the document's HTML.", + "parameters": [ + { + "name": "frameId", + "description": "Frame id to set HTML for.", + "$ref": "FrameId" + }, + { + "name": "html", + "description": "HTML content to set.", + "type": "string" + } + ] }, { "name": "setDownloadBehavior", @@ -1392,21 +10111,133 @@ "parameters": [ { "name": "behavior", + "description": "Whether to allow all or deny all download requests, or use default Chrome behavior if\navailable (otherwise deny).", "type": "string", "enum": [ "deny", "allow", "default" - ], - "description": "Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny)." + ] }, { "name": "downloadPath", - "type": "string", + "description": "The default path to save downloaded files to. This is requred if behavior is set to 'allow'", "optional": true, - "description": "The default path to save downloaded files to. This is requred if behavior is set to 'allow'" + "type": "string" } ] + }, + { + "name": "setGeolocationOverride", + "description": "Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position\nunavailable.", + "deprecated": true, + "redirect": "Emulation", + "parameters": [ + { + "name": "latitude", + "description": "Mock latitude", + "optional": true, + "type": "number" + }, + { + "name": "longitude", + "description": "Mock longitude", + "optional": true, + "type": "number" + }, + { + "name": "accuracy", + "description": "Mock accuracy", + "optional": true, + "type": "number" + } + ] + }, + { + "name": "setLifecycleEventsEnabled", + "description": "Controls whether page will emit lifecycle events.", + "experimental": true, + "parameters": [ + { + "name": "enabled", + "description": "If true, starts emitting lifecycle events.", + "type": "boolean" + } + ] + }, + { + "name": "setTouchEmulationEnabled", + "description": "Toggles mouse event-based touch event emulation.", + "experimental": true, + "deprecated": true, + "redirect": "Emulation", + "parameters": [ + { + "name": "enabled", + "description": "Whether the touch event emulation should be enabled.", + "type": "boolean" + }, + { + "name": "configuration", + "description": "Touch/gesture events configuration. Default: current platform.", + "optional": true, + "type": "string", + "enum": [ + "mobile", + "desktop" + ] + } + ] + }, + { + "name": "startScreencast", + "description": "Starts sending each frame using the `screencastFrame` event.", + "experimental": true, + "parameters": [ + { + "name": "format", + "description": "Image compression format.", + "optional": true, + "type": "string", + "enum": [ + "jpeg", + "png" + ] + }, + { + "name": "quality", + "description": "Compression quality from range [0..100].", + "optional": true, + "type": "integer" + }, + { + "name": "maxWidth", + "description": "Maximum screenshot width.", + "optional": true, + "type": "integer" + }, + { + "name": "maxHeight", + "description": "Maximum screenshot height.", + "optional": true, + "type": "integer" + }, + { + "name": "everyNthFrame", + "description": "Send every n-th frame.", + "optional": true, + "type": "integer" + } + ] + }, + { + "name": "stopLoading", + "description": "Force the page stop all navigations and pending resource fetches." + }, + { + "name": "stopScreencast", + "description": "Stops sending each frame in the `screencastFrame`.", + "experimental": true } ], "events": [ @@ -1419,6 +10250,201 @@ } ] }, + { + "name": "frameAttached", + "description": "Fired when frame has been attached to its parent.", + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame that has been attached.", + "$ref": "FrameId" + }, + { + "name": "parentFrameId", + "description": "Parent frame identifier.", + "$ref": "FrameId" + }, + { + "name": "stack", + "description": "JavaScript stack trace of when frame was attached, only set if frame initiated from script.", + "optional": true, + "$ref": "Runtime.StackTrace" + } + ] + }, + { + "name": "frameClearedScheduledNavigation", + "description": "Fired when frame no longer has a scheduled navigation.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame that has cleared its scheduled navigation.", + "$ref": "FrameId" + } + ] + }, + { + "name": "frameDetached", + "description": "Fired when frame has been detached from its parent.", + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame that has been detached.", + "$ref": "FrameId" + } + ] + }, + { + "name": "frameNavigated", + "description": "Fired once navigation of the frame has completed. Frame is now associated with the new loader.", + "parameters": [ + { + "name": "frame", + "description": "Frame object.", + "$ref": "Frame" + } + ] + }, + { + "name": "frameResized", + "experimental": true + }, + { + "name": "frameScheduledNavigation", + "description": "Fired when frame schedules a potential navigation.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame that has scheduled a navigation.", + "$ref": "FrameId" + }, + { + "name": "delay", + "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not\nguaranteed to start.", + "type": "number" + }, + { + "name": "reason", + "description": "The reason for the navigation.", + "type": "string", + "enum": [ + "formSubmissionGet", + "formSubmissionPost", + "httpHeaderRefresh", + "scriptInitiated", + "metaTagRefresh", + "pageBlockInterstitial", + "reload" + ] + }, + { + "name": "url", + "description": "The destination URL for the scheduled navigation.", + "type": "string" + } + ] + }, + { + "name": "frameStartedLoading", + "description": "Fired when frame has started loading.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame that has started loading.", + "$ref": "FrameId" + } + ] + }, + { + "name": "frameStoppedLoading", + "description": "Fired when frame has stopped loading.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame that has stopped loading.", + "$ref": "FrameId" + } + ] + }, + { + "name": "interstitialHidden", + "description": "Fired when interstitial page was hidden" + }, + { + "name": "interstitialShown", + "description": "Fired when interstitial page was shown" + }, + { + "name": "javascriptDialogClosed", + "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been\nclosed.", + "parameters": [ + { + "name": "result", + "description": "Whether dialog was confirmed.", + "type": "boolean" + }, + { + "name": "userInput", + "description": "User input in case of prompt.", + "type": "string" + } + ] + }, + { + "name": "javascriptDialogOpening", + "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to\nopen.", + "parameters": [ + { + "name": "url", + "description": "Frame url.", + "type": "string" + }, + { + "name": "message", + "description": "Message that will be displayed by the dialog.", + "type": "string" + }, + { + "name": "type", + "description": "Dialog type.", + "$ref": "DialogType" + }, + { + "name": "defaultPrompt", + "description": "Default dialog prompt.", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "lifecycleEvent", + "description": "Fired for top level page lifecycle events such as navigation, load, paint, etc.", + "parameters": [ + { + "name": "frameId", + "description": "Id of the frame.", + "$ref": "FrameId" + }, + { + "name": "loaderId", + "description": "Loader identifier. Empty string if the request is fetched from worker.", + "$ref": "Network.LoaderId" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "timestamp", + "$ref": "Network.MonotonicTime" + } + ] + }, { "name": "loadEventFired", "parameters": [ @@ -1428,1003 +10454,135 @@ } ] }, - { - "name": "lifecycleEvent", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame." - }, - { - "name": "loaderId", - "$ref": "Network.LoaderId", - "description": "Loader identifier. Empty string if the request is fetched from worker." - }, - { - "name": "name", - "type": "string" - }, - { - "name": "timestamp", - "$ref": "Network.MonotonicTime" - } - ], - "description": "Fired for top level page lifecycle events such as navigation, load, paint, etc." - }, - { - "name": "frameAttached", - "description": "Fired when frame has been attached to its parent.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame that has been attached." - }, - { - "name": "parentFrameId", - "$ref": "FrameId", - "description": "Parent frame identifier." - }, - { - "name": "stack", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "JavaScript stack trace of when frame was attached, only set if frame initiated from script." - } - ] - }, - { - "name": "frameNavigated", - "description": "Fired once navigation of the frame has completed. Frame is now associated with the new loader.", - "parameters": [ - { - "name": "frame", - "$ref": "Frame", - "description": "Frame object." - } - ] - }, - { - "name": "frameDetached", - "description": "Fired when frame has been detached from its parent.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame that has been detached." - } - ] - }, - { - "name": "frameStartedLoading", - "description": "Fired when frame has started loading.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame that has started loading." - } - ], - "experimental": true - }, - { - "name": "frameStoppedLoading", - "description": "Fired when frame has stopped loading.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame that has stopped loading." - } - ], - "experimental": true - }, - { - "name": "frameScheduledNavigation", - "description": "Fired when frame schedules a potential navigation.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame that has scheduled a navigation." - }, - { - "name": "delay", - "type": "number", - "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start." - }, - { - "name": "reason", - "type": "string", - "enum": [ - "formSubmissionGet", - "formSubmissionPost", - "httpHeaderRefresh", - "scriptInitiated", - "metaTagRefresh", - "pageBlockInterstitial", - "reload" - ], - "description": "The reason for the navigation." - }, - { - "name": "url", - "type": "string", - "description": "The destination URL for the scheduled navigation." - } - ], - "experimental": true - }, - { - "name": "frameClearedScheduledNavigation", - "description": "Fired when frame no longer has a scheduled navigation.", - "parameters": [ - { - "name": "frameId", - "$ref": "FrameId", - "description": "Id of the frame that has cleared its scheduled navigation." - } - ], - "experimental": true - }, - { - "name": "frameResized", - "experimental": true - }, - { - "name": "javascriptDialogOpening", - "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.", - "parameters": [ - { - "name": "url", - "type": "string", - "description": "Frame url." - }, - { - "name": "message", - "type": "string", - "description": "Message that will be displayed by the dialog." - }, - { - "name": "type", - "$ref": "DialogType", - "description": "Dialog type." - }, - { - "name": "defaultPrompt", - "optional": true, - "type": "string", - "description": "Default dialog prompt." - } - ] - }, - { - "name": "javascriptDialogClosed", - "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.", - "parameters": [ - { - "name": "result", - "type": "boolean", - "description": "Whether dialog was confirmed." - }, - { - "name": "userInput", - "type": "string", - "description": "User input in case of prompt." - } - ] - }, { "name": "screencastFrame", - "description": "Compressed image data requested by the startScreencast.", + "description": "Compressed image data requested by the `startScreencast`.", + "experimental": true, "parameters": [ { "name": "data", - "type": "string", - "description": "Base64-encoded compressed image." + "description": "Base64-encoded compressed image.", + "type": "string" }, { "name": "metadata", - "$ref": "ScreencastFrameMetadata", - "description": "Screencast frame metadata." + "description": "Screencast frame metadata.", + "$ref": "ScreencastFrameMetadata" }, { "name": "sessionId", - "type": "integer", - "description": "Frame number." + "description": "Frame number.", + "type": "integer" } - ], - "experimental": true + ] }, { "name": "screencastVisibilityChanged", - "description": "Fired when the page with currently enabled screencast was shown or hidden .", + "description": "Fired when the page with currently enabled screencast was shown or hidden `.", + "experimental": true, "parameters": [ { "name": "visible", - "type": "boolean", - "description": "True if the page is visible." + "description": "True if the page is visible.", + "type": "boolean" } - ], - "experimental": true - }, - { - "name": "interstitialShown", - "description": "Fired when interstitial page was shown" - }, - { - "name": "interstitialHidden", - "description": "Fired when interstitial page was hidden" + ] }, { "name": "windowOpen", - "description": "Fired when a new window is going to be opened, via window.open(), link click, form submission, etc.", + "description": "Fired when a new window is going to be opened, via window.open(), link click, form submission,\netc.", "parameters": [ { "name": "url", - "type": "string", - "description": "The URL for the new window." + "description": "The URL for the new window.", + "type": "string" }, { "name": "windowName", - "type": "string", - "description": "Window name." + "description": "Window name.", + "type": "string" }, { "name": "windowFeatures", + "description": "An array of enabled window features.", "type": "array", "items": { "type": "string" - }, - "description": "An array of enabled window features." + } }, { "name": "userGesture", - "type": "boolean", - "description": "Whether or not it was triggered by user gesture." + "description": "Whether or not it was triggered by user gesture.", + "type": "boolean" } ] } ] }, { - "domain": "Overlay", - "description": "This domain provides various functionality related to drawing atop the inspected page.", - "dependencies": [ - "DOM", - "Page", - "Runtime" - ], - "experimental": true, + "domain": "Performance", "types": [ { - "id": "HighlightConfig", + "id": "Metric", + "description": "Run-time execution metric.", "type": "object", "properties": [ { - "name": "showInfo", - "type": "boolean", - "optional": true, - "description": "Whether the node info tooltip should be shown (default: false)." + "name": "name", + "description": "Metric name.", + "type": "string" }, - { - "name": "showRulers", - "type": "boolean", - "optional": true, - "description": "Whether the rulers should be shown (default: false)." - }, - { - "name": "showExtensionLines", - "type": "boolean", - "optional": true, - "description": "Whether the extension lines from node to the rulers should be shown (default: false)." - }, - { - "name": "displayAsMaterial", - "type": "boolean", - "optional": true - }, - { - "name": "contentColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The content box highlight fill color (default: transparent)." - }, - { - "name": "paddingColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The padding highlight fill color (default: transparent)." - }, - { - "name": "borderColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The border highlight fill color (default: transparent)." - }, - { - "name": "marginColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The margin highlight fill color (default: transparent)." - }, - { - "name": "eventTargetColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The event target element highlight fill color (default: transparent)." - }, - { - "name": "shapeColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The shape outside fill color (default: transparent)." - }, - { - "name": "shapeMarginColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The shape margin fill color (default: transparent)." - }, - { - "name": "selectorList", - "type": "string", - "optional": true, - "description": "Selectors to highlight relevant nodes." - }, - { - "name": "cssGridColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The grid layout color (default: transparent)." - } - ], - "description": "Configuration data for the highlighting of page elements." - }, - { - "id": "InspectMode", - "type": "string", - "enum": [ - "searchForNode", - "searchForUAShadowDOM", - "none" - ] - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables domain notifications." - }, - { - "name": "disable", - "description": "Disables domain notifications." - }, - { - "name": "setShowPaintRects", - "description": "Requests that backend shows paint rectangles", - "parameters": [ - { - "name": "result", - "type": "boolean", - "description": "True for showing paint rectangles" - } - ] - }, - { - "name": "setShowDebugBorders", - "description": "Requests that backend shows debug borders on layers", - "parameters": [ - { - "name": "show", - "type": "boolean", - "description": "True for showing debug borders" - } - ] - }, - { - "name": "setShowFPSCounter", - "description": "Requests that backend shows the FPS counter", - "parameters": [ - { - "name": "show", - "type": "boolean", - "description": "True for showing the FPS counter" - } - ] - }, - { - "name": "setShowScrollBottleneckRects", - "description": "Requests that backend shows scroll bottleneck rects", - "parameters": [ - { - "name": "show", - "type": "boolean", - "description": "True for showing scroll bottleneck rects" - } - ] - }, - { - "name": "setShowViewportSizeOnResize", - "description": "Paints viewport size upon main frame resize.", - "parameters": [ - { - "name": "show", - "type": "boolean", - "description": "Whether to paint size or not." - } - ] - }, - { - "name": "setPausedInDebuggerMessage", - "parameters": [ - { - "name": "message", - "type": "string", - "optional": true, - "description": "The message to display, also triggers resume and step over controls." - } - ] - }, - { - "name": "setSuspended", - "parameters": [ - { - "name": "suspended", - "type": "boolean", - "description": "Whether overlay should be suspended and not consume any resources until resumed." - } - ] - }, - { - "name": "setInspectMode", - "description": "Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.", - "parameters": [ - { - "name": "mode", - "$ref": "InspectMode", - "description": "Set an inspection mode." - }, - { - "name": "highlightConfig", - "$ref": "HighlightConfig", - "optional": true, - "description": "A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false." - } - ] - }, - { - "name": "highlightRect", - "description": "Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.", - "parameters": [ - { - "name": "x", - "type": "integer", - "description": "X coordinate" - }, - { - "name": "y", - "type": "integer", - "description": "Y coordinate" - }, - { - "name": "width", - "type": "integer", - "description": "Rectangle width" - }, - { - "name": "height", - "type": "integer", - "description": "Rectangle height" - }, - { - "name": "color", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The highlight fill color (default: transparent)." - }, - { - "name": "outlineColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The highlight outline color (default: transparent)." - } - ] - }, - { - "name": "highlightQuad", - "description": "Highlights given quad. Coordinates are absolute with respect to the main frame viewport.", - "parameters": [ - { - "name": "quad", - "$ref": "DOM.Quad", - "description": "Quad to highlight" - }, - { - "name": "color", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The highlight fill color (default: transparent)." - }, - { - "name": "outlineColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The highlight outline color (default: transparent)." - } - ] - }, - { - "name": "highlightNode", - "description": "Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.", - "parameters": [ - { - "name": "highlightConfig", - "$ref": "HighlightConfig", - "description": "A descriptor for the highlight appearance." - }, - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "optional": true, - "description": "Identifier of the node to highlight." - }, - { - "name": "backendNodeId", - "$ref": "DOM.BackendNodeId", - "optional": true, - "description": "Identifier of the backend node to highlight." - }, - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "optional": true, - "description": "JavaScript object id of the node to be highlighted." - } - ] - }, - { - "name": "highlightFrame", - "description": "Highlights owner element of the frame with given id.", - "parameters": [ - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "Identifier of the frame to highlight." - }, - { - "name": "contentColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The content box highlight fill color (default: transparent)." - }, - { - "name": "contentOutlineColor", - "$ref": "DOM.RGBA", - "optional": true, - "description": "The content box highlight outline color (default: transparent)." - } - ] - }, - { - "name": "hideHighlight", - "description": "Hides any highlight." - }, - { - "name": "getHighlightObjectForTest", - "description": "For testing.", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "description": "Id of the node to get highlight object for." - } - ], - "returns": [ - { - "name": "highlight", - "type": "object", - "description": "Highlight data for the node." - } - ] - } - ], - "events": [ - { - "name": "nodeHighlightRequested", - "description": "Fired when the node should be highlighted. This happens after call to setInspectMode.", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId" - } - ] - }, - { - "name": "inspectNodeRequested", - "description": "Fired when the node should be inspected. This happens after call to setInspectMode or when user manually inspects an element.", - "parameters": [ - { - "name": "backendNodeId", - "$ref": "DOM.BackendNodeId", - "description": "Id of the node to inspect." - } - ] - }, - { - "name": "screenshotRequested", - "description": "Fired when user asks to capture screenshot of some area on the page.", - "parameters": [ - { - "name": "viewport", - "$ref": "Page.Viewport", - "description": "Viewport to capture, in CSS." - } - ] - } - ] - }, - { - "domain": "Emulation", - "description": "This domain emulates different environments for the page.", - "dependencies": [ - "DOM", - "Page", - "Runtime" - ], - "types": [ - { - "id": "ScreenOrientation", - "type": "object", - "description": "Screen orientation.", - "properties": [ - { - "name": "type", - "type": "string", - "enum": [ - "portraitPrimary", - "portraitSecondary", - "landscapePrimary", - "landscapeSecondary" - ], - "description": "Orientation type." - }, - { - "name": "angle", - "type": "integer", - "description": "Orientation angle." - } - ] - }, - { - "id": "VirtualTimePolicy", - "type": "string", - "enum": [ - "advance", - "pause", - "pauseIfNetworkFetchesPending" - ], - "experimental": true, - "description": "advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to allow the next delayed task (if any) to run; pause: The virtual time base may not advance; pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending resource fetches." - } - ], - "commands": [ - { - "name": "setDeviceMetricsOverride", - "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results).", - "parameters": [ - { - "name": "width", - "type": "integer", - "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override." - }, - { - "name": "height", - "type": "integer", - "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." - }, - { - "name": "deviceScaleFactor", - "type": "number", - "description": "Overriding device scale factor value. 0 disables the override." - }, - { - "name": "mobile", - "type": "boolean", - "description": "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more." - }, - { - "name": "scale", - "type": "number", - "optional": true, - "description": "Scale to apply to resulting view image.", - "experimental": true - }, - { - "name": "screenWidth", - "type": "integer", - "optional": true, - "experimental": true, - "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "screenHeight", - "type": "integer", - "optional": true, - "experimental": true, - "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "positionX", - "type": "integer", - "optional": true, - "experimental": true, - "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "positionY", - "type": "integer", - "optional": true, - "experimental": true, - "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000)." - }, - { - "name": "dontSetVisibleSize", - "type": "boolean", - "optional": true, - "experimental": true, - "description": "Do not set visible view size, rely upon explicit setVisibleSize call." - }, - { - "name": "screenOrientation", - "$ref": "ScreenOrientation", - "optional": true, - "description": "Screen orientation override." - }, - { - "name": "viewport", - "$ref": "Page.Viewport", - "optional": true, - "experimental": true, - "description": "If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions." - } - ] - }, - { - "name": "clearDeviceMetricsOverride", - "description": "Clears the overriden device metrics." - }, - { - "name": "resetPageScaleFactor", - "experimental": true, - "description": "Requests that page scale factor is reset to initial values." - }, - { - "name": "setPageScaleFactor", - "description": "Sets a specified page scale factor.", - "experimental": true, - "parameters": [ - { - "name": "pageScaleFactor", - "type": "number", - "description": "Page scale factor." - } - ] - }, - { - "name": "setVisibleSize", - "description": "Resizes the frame/viewport of the page. Note that this does not affect the frame's container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android.", - "experimental": true, - "deprecated": true, - "parameters": [ - { - "name": "width", - "type": "integer", - "description": "Frame width (DIP)." - }, - { - "name": "height", - "type": "integer", - "description": "Frame height (DIP)." - } - ] - }, - { - "name": "setScriptExecutionDisabled", - "description": "Switches script execution in the page.", - "parameters": [ { "name": "value", - "type": "boolean", - "description": "Whether script execution should be disabled in the page." + "description": "Metric value.", + "type": "number" } ] + } + ], + "commands": [ + { + "name": "disable", + "description": "Disable collecting and reporting metrics." }, { - "name": "setGeolocationOverride", - "description": "Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.", - "parameters": [ - { - "name": "latitude", - "type": "number", - "optional": true, - "description": "Mock latitude" - }, - { - "name": "longitude", - "type": "number", - "optional": true, - "description": "Mock longitude" - }, - { - "name": "accuracy", - "type": "number", - "optional": true, - "description": "Mock accuracy" - } - ] + "name": "enable", + "description": "Enable collecting and reporting metrics." }, { - "name": "clearGeolocationOverride", - "description": "Clears the overriden Geolocation Position and Error." - }, - { - "name": "setTouchEmulationEnabled", - "parameters": [ - { - "name": "enabled", - "type": "boolean", - "description": "Whether the touch event emulation should be enabled." - }, - { - "name": "maxTouchPoints", - "type": "integer", - "optional": true, - "description": "Maximum touch points supported. Defaults to one." - } - ], - "description": "Enables touch on platforms which do not support them." - }, - { - "name": "setEmitTouchEventsForMouse", - "parameters": [ - { - "name": "enabled", - "type": "boolean", - "description": "Whether touch emulation based on mouse input should be enabled." - }, - { - "name": "configuration", - "type": "string", - "enum": [ - "mobile", - "desktop" - ], - "optional": true, - "description": "Touch/gesture events configuration. Default: current platform." - } - ], - "experimental": true - }, - { - "name": "setEmulatedMedia", - "parameters": [ - { - "name": "media", - "type": "string", - "description": "Media type to emulate. Empty string disables the override." - } - ], - "description": "Emulates the given media for CSS media queries." - }, - { - "name": "setCPUThrottlingRate", - "parameters": [ - { - "name": "rate", - "type": "number", - "description": "Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc)." - } - ], - "experimental": true, - "description": "Enables CPU throttling to emulate slow CPUs." - }, - { - "name": "canEmulate", - "description": "Tells whether emulation is supported.", + "name": "getMetrics", + "description": "Retrieve current values of run-time metrics.", "returns": [ { - "name": "result", - "type": "boolean", - "description": "True if emulation is supported." - } - ] - }, - { - "name": "setVirtualTimePolicy", - "description": "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget.", - "parameters": [ - { - "name": "policy", - "$ref": "VirtualTimePolicy" - }, - { - "name": "budget", - "type": "number", - "optional": true, - "description": "If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent." - }, - { - "name": "maxVirtualTimeTaskStarvationCount", - "type": "integer", - "optional": true, - "description": "If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock." - } - ], - "returns": [ - { - "name": "virtualTimeBase", - "$ref": "Runtime.Timestamp", - "description": "Absolute timestamp at which virtual time was first enabled (milliseconds since epoch)." - } - ], - "experimental": true - }, - { - "name": "setNavigatorOverrides", - "description": "Overrides value returned by the javascript navigator object.", - "parameters": [ - { - "name": "platform", - "type": "string", - "description": "The platform navigator.platform should return." - } - ], - "experimental": true - }, - { - "name": "setDefaultBackgroundColorOverride", - "description": "Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.", - "parameters": [ - { - "name": "color", - "$ref": "DOM.RGBA", - "optional": true, - "description": "RGBA of the default background color. If not specified, any existing override will be cleared." + "name": "metrics", + "description": "Current values for run-time metrics.", + "type": "array", + "items": { + "$ref": "Metric" + } } ] } ], "events": [ { - "name": "virtualTimeBudgetExpired", - "experimental": true, - "description": "Notification sent after the virtual time budget for the current VirtualTimePolicy has run out." - }, - { - "name": "virtualTimeAdvanced", - "experimental": true, + "name": "metrics", + "description": "Current values of the metrics.", "parameters": [ { - "name": "virtualTimeElapsed", - "type": "number", - "description": "The amount of virtual time that has elapsed in milliseconds since virtual time was first enabled." - } - ], - "description": "Notification sent after the virtual time has advanced." - }, - { - "name": "virtualTimePaused", - "experimental": true, - "parameters": [ + "name": "metrics", + "description": "Current values of the metrics.", + "type": "array", + "items": { + "$ref": "Metric" + } + }, { - "name": "virtualTimeElapsed", - "type": "number", - "description": "The amount of virtual time that has elapsed in milliseconds since virtual time was first enabled." + "name": "title", + "description": "Timestamp title.", + "type": "string" } - ], - "description": "Notification sent after the virtual time has paused." + ] } ] }, @@ -2434,21 +10592,22 @@ "types": [ { "id": "CertificateId", - "type": "integer", - "description": "An internal certificate ID value." + "description": "An internal certificate ID value.", + "type": "integer" }, { "id": "MixedContentType", + "description": "A description of mixed content (HTTP resources on HTTPS pages), as defined by\nhttps://www.w3.org/TR/mixed-content/#categories", "type": "string", "enum": [ "blockable", "optionally-blockable", "none" - ], - "description": "A description of mixed content (HTTP resources on HTTPS pages), as defined by https://www.w3.org/TR/mixed-content/#categories" + ] }, { "id": "SecurityState", + "description": "The security level of a page or resource.", "type": "string", "enum": [ "unknown", @@ -2456,6775 +10615,193 @@ "insecure", "secure", "info" - ], - "description": "The security level of a page or resource." + ] }, { "id": "SecurityStateExplanation", + "description": "An explanation of an factor contributing to the security state.", "type": "object", "properties": [ { "name": "securityState", - "$ref": "SecurityState", - "description": "Security state representing the severity of the factor being explained." + "description": "Security state representing the severity of the factor being explained.", + "$ref": "SecurityState" + }, + { + "name": "title", + "description": "Title describing the type of factor.", + "type": "string" }, { "name": "summary", - "type": "string", - "description": "Short phrase describing the type of factor." + "description": "Short phrase describing the type of factor.", + "type": "string" }, { "name": "description", - "type": "string", - "description": "Full text explanation of the factor." + "description": "Full text explanation of the factor.", + "type": "string" }, { "name": "mixedContentType", - "$ref": "MixedContentType", - "description": "The type of mixed content described by the explanation." + "description": "The type of mixed content described by the explanation.", + "$ref": "MixedContentType" }, { "name": "certificate", + "description": "Page certificate.", "type": "array", "items": { "type": "string" - }, - "description": "Page certificate." + } } - ], - "description": "An explanation of an factor contributing to the security state." + ] }, { "id": "InsecureContentStatus", + "description": "Information about insecure content on the page.", "type": "object", "properties": [ { "name": "ranMixedContent", - "type": "boolean", - "description": "True if the page was loaded over HTTPS and ran mixed (HTTP) content such as scripts." + "description": "True if the page was loaded over HTTPS and ran mixed (HTTP) content such as scripts.", + "type": "boolean" }, { "name": "displayedMixedContent", - "type": "boolean", - "description": "True if the page was loaded over HTTPS and displayed mixed (HTTP) content such as images." + "description": "True if the page was loaded over HTTPS and displayed mixed (HTTP) content such as images.", + "type": "boolean" }, { "name": "containedMixedForm", - "type": "boolean", - "description": "True if the page was loaded over HTTPS and contained a form targeting an insecure url." + "description": "True if the page was loaded over HTTPS and contained a form targeting an insecure url.", + "type": "boolean" }, { "name": "ranContentWithCertErrors", - "type": "boolean", - "description": "True if the page was loaded over HTTPS without certificate errors, and ran content such as scripts that were loaded with certificate errors." + "description": "True if the page was loaded over HTTPS without certificate errors, and ran content such as\nscripts that were loaded with certificate errors.", + "type": "boolean" }, { "name": "displayedContentWithCertErrors", - "type": "boolean", - "description": "True if the page was loaded over HTTPS without certificate errors, and displayed content such as images that were loaded with certificate errors." + "description": "True if the page was loaded over HTTPS without certificate errors, and displayed content\nsuch as images that were loaded with certificate errors.", + "type": "boolean" }, { "name": "ranInsecureContentStyle", - "$ref": "SecurityState", - "description": "Security state representing a page that ran insecure content." + "description": "Security state representing a page that ran insecure content.", + "$ref": "SecurityState" }, { "name": "displayedInsecureContentStyle", - "$ref": "SecurityState", - "description": "Security state representing a page that displayed insecure content." + "description": "Security state representing a page that displayed insecure content.", + "$ref": "SecurityState" } - ], - "description": "Information about insecure content on the page." + ] }, { "id": "CertificateErrorAction", + "description": "The action to take when a certificate error occurs. continue will continue processing the\nrequest and cancel will cancel the request.", "type": "string", "enum": [ "continue", "cancel" - ], - "description": "The action to take when a certificate error occurs. continue will continue processing the request and cancel will cancel the request." + ] } ], "commands": [ - { - "name": "enable", - "description": "Enables tracking security state changes." - }, { "name": "disable", "description": "Disables tracking security state changes." }, + { + "name": "enable", + "description": "Enables tracking security state changes." + }, { "name": "handleCertificateError", "description": "Handles a certificate error that fired a certificateError event.", "parameters": [ { "name": "eventId", - "type": "integer", - "description": "The ID of the event." + "description": "The ID of the event.", + "type": "integer" }, { "name": "action", - "$ref": "CertificateErrorAction", - "description": "The action to take on the certificate error." + "description": "The action to take on the certificate error.", + "$ref": "CertificateErrorAction" } ] }, { "name": "setOverrideCertificateErrors", - "description": "Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with handleCertificateError commands.", + "description": "Enable/disable overriding certificate errors. If enabled, all certificate error events need to\nbe handled by the DevTools client and should be answered with handleCertificateError commands.", "parameters": [ { "name": "override", - "type": "boolean", - "description": "If true, certificate errors will be overridden." + "description": "If true, certificate errors will be overridden.", + "type": "boolean" } ] } ], "events": [ + { + "name": "certificateError", + "description": "There is a certificate error. If overriding certificate errors is enabled, then it should be\nhandled with the handleCertificateError command. Note: this event does not fire if the\ncertificate error has been allowed internally.", + "parameters": [ + { + "name": "eventId", + "description": "The ID of the event.", + "type": "integer" + }, + { + "name": "errorType", + "description": "The type of the error.", + "type": "string" + }, + { + "name": "requestURL", + "description": "The url that was requested.", + "type": "string" + } + ] + }, { "name": "securityStateChanged", "description": "The security state of the page changed.", "parameters": [ { "name": "securityState", - "$ref": "SecurityState", - "description": "Security state." + "description": "Security state.", + "$ref": "SecurityState" }, { "name": "schemeIsCryptographic", - "type": "boolean", - "description": "True if the page was loaded over cryptographic transport such as HTTPS." + "description": "True if the page was loaded over cryptographic transport such as HTTPS.", + "type": "boolean" }, { "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.", "type": "array", "items": { "$ref": "SecurityStateExplanation" - }, - "description": "List of explanations for the security state. If the overall security state is `insecure` or `warning`, at least one corresponding explanation should be included." + } }, { "name": "insecureContentStatus", - "$ref": "InsecureContentStatus", - "description": "Information about insecure content on the page." + "description": "Information about insecure content on the page.", + "$ref": "InsecureContentStatus" }, { "name": "summary", - "type": "string", "description": "Overrides user-visible description of the state.", - "optional": true - } - ] - }, - { - "name": "certificateError", - "description": "There is a certificate error. If overriding certificate errors is enabled, then it should be handled with the handleCertificateError command. Note: this event does not fire if the certificate error has been allowed internally.", - "parameters": [ - { - "name": "eventId", - "type": "integer", - "description": "The ID of the event." - }, - { - "name": "errorType", - "type": "string", - "description": "The type of the error." - }, - { - "name": "requestURL", - "type": "string", - "description": "The url that was requested." - } - ] - } - ] - }, - { - "domain": "Audits", - "description": "Audits domain allows investigation of page violations and possible improvements.", - "dependencies": [ - "Network" - ], - "experimental": true, - "commands": [ - { - "name": "getEncodedResponse", - "description": "Returns the response body and size if it were re-encoded with the specified settings. Only applies to images.", - "parameters": [ - { - "name": "requestId", - "$ref": "Network.RequestId", - "description": "Identifier of the network request to get content for." - }, - { - "name": "encoding", - "type": "string", - "enum": [ - "webp", - "jpeg", - "png" - ], - "description": "The encoding to use." - }, - { - "name": "quality", - "type": "number", "optional": true, - "description": "The quality of the encoding (0-1). (defaults to 1)" - }, - { - "name": "sizeOnly", - "type": "boolean", - "optional": true, - "description": "Whether to only return the size information (defaults to false)." - } - ], - "returns": [ - { - "name": "body", - "type": "string", - "optional": true, - "description": "The encoded body as a base64 string. Omitted if sizeOnly is true." - }, - { - "name": "originalSize", - "type": "integer", - "description": "Size before re-encoding." - }, - { - "name": "encodedSize", - "type": "integer", - "description": "Size after re-encoding." - } - ] - } - ] - }, - { - "domain": "Network", - "description": "Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.", - "dependencies": [ - "Debugger", - "Runtime", - "Security" - ], - "types": [ - { - "id": "LoaderId", - "type": "string", - "description": "Unique loader identifier." - }, - { - "id": "RequestId", - "type": "string", - "description": "Unique request identifier." - }, - { - "id": "InterceptionId", - "type": "string", - "description": "Unique intercepted request identifier." - }, - { - "id": "ErrorReason", - "type": "string", - "enum": [ - "Failed", - "Aborted", - "TimedOut", - "AccessDenied", - "ConnectionClosed", - "ConnectionReset", - "ConnectionRefused", - "ConnectionAborted", - "ConnectionFailed", - "NameNotResolved", - "InternetDisconnected", - "AddressUnreachable" - ], - "description": "Network level fetch failure reason." - }, - { - "id": "TimeSinceEpoch", - "type": "number", - "description": "UTC time in seconds, counted from January 1, 1970." - }, - { - "id": "MonotonicTime", - "type": "number", - "description": "Monotonically increasing time in seconds since an arbitrary point in the past." - }, - { - "id": "Headers", - "type": "object", - "description": "Request / response headers as keys / values of JSON object." - }, - { - "id": "ConnectionType", - "type": "string", - "enum": [ - "none", - "cellular2g", - "cellular3g", - "cellular4g", - "bluetooth", - "ethernet", - "wifi", - "wimax", - "other" - ], - "description": "The underlying connection technology that the browser is supposedly using." - }, - { - "id": "CookieSameSite", - "type": "string", - "enum": [ - "Strict", - "Lax" - ], - "description": "Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies" - }, - { - "id": "ResourceTiming", - "type": "object", - "description": "Timing information for the request.", - "properties": [ - { - "name": "requestTime", - "type": "number", - "description": "Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime." - }, - { - "name": "proxyStart", - "type": "number", - "description": "Started resolving proxy." - }, - { - "name": "proxyEnd", - "type": "number", - "description": "Finished resolving proxy." - }, - { - "name": "dnsStart", - "type": "number", - "description": "Started DNS address resolve." - }, - { - "name": "dnsEnd", - "type": "number", - "description": "Finished DNS address resolve." - }, - { - "name": "connectStart", - "type": "number", - "description": "Started connecting to the remote host." - }, - { - "name": "connectEnd", - "type": "number", - "description": "Connected to the remote host." - }, - { - "name": "sslStart", - "type": "number", - "description": "Started SSL handshake." - }, - { - "name": "sslEnd", - "type": "number", - "description": "Finished SSL handshake." - }, - { - "name": "workerStart", - "type": "number", - "description": "Started running ServiceWorker.", - "experimental": true - }, - { - "name": "workerReady", - "type": "number", - "description": "Finished Starting ServiceWorker.", - "experimental": true - }, - { - "name": "sendStart", - "type": "number", - "description": "Started sending request." - }, - { - "name": "sendEnd", - "type": "number", - "description": "Finished sending request." - }, - { - "name": "pushStart", - "type": "number", - "description": "Time the server started pushing request.", - "experimental": true - }, - { - "name": "pushEnd", - "type": "number", - "description": "Time the server finished pushing request.", - "experimental": true - }, - { - "name": "receiveHeadersEnd", - "type": "number", - "description": "Finished receiving response headers." - } - ] - }, - { - "id": "ResourcePriority", - "type": "string", - "enum": [ - "VeryLow", - "Low", - "Medium", - "High", - "VeryHigh" - ], - "description": "Loading priority of a resource request." - }, - { - "id": "Request", - "type": "object", - "description": "HTTP request data.", - "properties": [ - { - "name": "url", - "type": "string", - "description": "Request URL." - }, - { - "name": "method", - "type": "string", - "description": "HTTP request method." - }, - { - "name": "headers", - "$ref": "Headers", - "description": "HTTP request headers." - }, - { - "name": "postData", - "type": "string", - "optional": true, - "description": "HTTP POST request data." - }, - { - "name": "mixedContentType", - "$ref": "Security.MixedContentType", - "optional": true, - "description": "The mixed content type of the request." - }, - { - "name": "initialPriority", - "$ref": "ResourcePriority", - "description": "Priority of the resource request at the time request is sent." - }, - { - "name": "referrerPolicy", - "type": "string", - "enum": [ - "unsafe-url", - "no-referrer-when-downgrade", - "no-referrer", - "origin", - "origin-when-cross-origin", - "same-origin", - "strict-origin", - "strict-origin-when-cross-origin" - ], - "description": "The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/" - }, - { - "name": "isLinkPreload", - "type": "boolean", - "optional": true, - "description": "Whether is loaded via link preload." - } - ] - }, - { - "id": "SignedCertificateTimestamp", - "type": "object", - "description": "Details of a signed certificate timestamp (SCT).", - "properties": [ - { - "name": "status", - "type": "string", - "description": "Validation status." - }, - { - "name": "origin", - "type": "string", - "description": "Origin." - }, - { - "name": "logDescription", - "type": "string", - "description": "Log name / description." - }, - { - "name": "logId", - "type": "string", - "description": "Log ID." - }, - { - "name": "timestamp", - "$ref": "TimeSinceEpoch", - "description": "Issuance date." - }, - { - "name": "hashAlgorithm", - "type": "string", - "description": "Hash algorithm." - }, - { - "name": "signatureAlgorithm", - "type": "string", - "description": "Signature algorithm." - }, - { - "name": "signatureData", - "type": "string", - "description": "Signature data." - } - ] - }, - { - "id": "SecurityDetails", - "type": "object", - "description": "Security details about a request.", - "properties": [ - { - "name": "protocol", - "type": "string", - "description": "Protocol name (e.g. \"TLS 1.2\" or \"QUIC\")." - }, - { - "name": "keyExchange", - "type": "string", - "description": "Key Exchange used by the connection, or the empty string if not applicable." - }, - { - "name": "keyExchangeGroup", - "type": "string", - "optional": true, - "description": "(EC)DH group used by the connection, if applicable." - }, - { - "name": "cipher", - "type": "string", - "description": "Cipher name." - }, - { - "name": "mac", - "type": "string", - "optional": true, - "description": "TLS MAC. Note that AEAD ciphers do not have separate MACs." - }, - { - "name": "certificateId", - "$ref": "Security.CertificateId", - "description": "Certificate ID value." - }, - { - "name": "subjectName", - "type": "string", - "description": "Certificate subject name." - }, - { - "name": "sanList", - "type": "array", - "items": { - "type": "string" - }, - "description": "Subject Alternative Name (SAN) DNS names and IP addresses." - }, - { - "name": "issuer", - "type": "string", - "description": "Name of the issuing CA." - }, - { - "name": "validFrom", - "$ref": "TimeSinceEpoch", - "description": "Certificate valid from date." - }, - { - "name": "validTo", - "$ref": "TimeSinceEpoch", - "description": "Certificate valid to (expiration) date" - }, - { - "name": "signedCertificateTimestampList", - "type": "array", - "items": { - "$ref": "SignedCertificateTimestamp" - }, - "description": "List of signed certificate timestamps (SCTs)." - } - ] - }, - { - "id": "BlockedReason", - "type": "string", - "description": "The reason why request was blocked.", - "enum": [ - "csp", - "mixed-content", - "origin", - "inspector", - "subresource-filter", - "other" - ] - }, - { - "id": "Response", - "type": "object", - "description": "HTTP response data.", - "properties": [ - { - "name": "url", - "type": "string", - "description": "Response URL. This URL can be different from CachedResource.url in case of redirect." - }, - { - "name": "status", - "type": "integer", - "description": "HTTP response status code." - }, - { - "name": "statusText", - "type": "string", - "description": "HTTP response status text." - }, - { - "name": "headers", - "$ref": "Headers", - "description": "HTTP response headers." - }, - { - "name": "headersText", - "type": "string", - "optional": true, - "description": "HTTP response headers text." - }, - { - "name": "mimeType", - "type": "string", - "description": "Resource mimeType as determined by the browser." - }, - { - "name": "requestHeaders", - "$ref": "Headers", - "optional": true, - "description": "Refined HTTP request headers that were actually transmitted over the network." - }, - { - "name": "requestHeadersText", - "type": "string", - "optional": true, - "description": "HTTP request headers text." - }, - { - "name": "connectionReused", - "type": "boolean", - "description": "Specifies whether physical connection was actually reused for this request." - }, - { - "name": "connectionId", - "type": "number", - "description": "Physical connection id that was actually used for this request." - }, - { - "name": "remoteIPAddress", - "type": "string", - "optional": true, - "description": "Remote IP address." - }, - { - "name": "remotePort", - "type": "integer", - "optional": true, - "description": "Remote port." - }, - { - "name": "fromDiskCache", - "type": "boolean", - "optional": true, - "description": "Specifies that the request was served from the disk cache." - }, - { - "name": "fromServiceWorker", - "type": "boolean", - "optional": true, - "description": "Specifies that the request was served from the ServiceWorker." - }, - { - "name": "encodedDataLength", - "type": "number", - "optional": false, - "description": "Total number of bytes received for this request so far." - }, - { - "name": "timing", - "$ref": "ResourceTiming", - "optional": true, - "description": "Timing information for the given request." - }, - { - "name": "protocol", - "type": "string", - "optional": true, - "description": "Protocol used to fetch this request." - }, - { - "name": "securityState", - "$ref": "Security.SecurityState", - "description": "Security state of the request resource." - }, - { - "name": "securityDetails", - "$ref": "SecurityDetails", - "optional": true, - "description": "Security details for the request." - } - ] - }, - { - "id": "WebSocketRequest", - "type": "object", - "description": "WebSocket request data.", - "properties": [ - { - "name": "headers", - "$ref": "Headers", - "description": "HTTP request headers." - } - ] - }, - { - "id": "WebSocketResponse", - "type": "object", - "description": "WebSocket response data.", - "properties": [ - { - "name": "status", - "type": "integer", - "description": "HTTP response status code." - }, - { - "name": "statusText", - "type": "string", - "description": "HTTP response status text." - }, - { - "name": "headers", - "$ref": "Headers", - "description": "HTTP response headers." - }, - { - "name": "headersText", - "type": "string", - "optional": true, - "description": "HTTP response headers text." - }, - { - "name": "requestHeaders", - "$ref": "Headers", - "optional": true, - "description": "HTTP request headers." - }, - { - "name": "requestHeadersText", - "type": "string", - "optional": true, - "description": "HTTP request headers text." - } - ] - }, - { - "id": "WebSocketFrame", - "type": "object", - "description": "WebSocket frame data.", - "properties": [ - { - "name": "opcode", - "type": "number", - "description": "WebSocket frame opcode." - }, - { - "name": "mask", - "type": "boolean", - "description": "WebSocke frame mask." - }, - { - "name": "payloadData", - "type": "string", - "description": "WebSocke frame payload data." - } - ] - }, - { - "id": "CachedResource", - "type": "object", - "description": "Information about the cached resource.", - "properties": [ - { - "name": "url", - "type": "string", - "description": "Resource URL. This is the url of the original network request." - }, - { - "name": "type", - "$ref": "Page.ResourceType", - "description": "Type of this resource." - }, - { - "name": "response", - "$ref": "Response", - "optional": true, - "description": "Cached response data." - }, - { - "name": "bodySize", - "type": "number", - "description": "Cached response body size." - } - ] - }, - { - "id": "Initiator", - "type": "object", - "description": "Information about the request initiator.", - "properties": [ - { - "name": "type", - "type": "string", - "enum": [ - "parser", - "script", - "preload", - "other" - ], - "description": "Type of this initiator." - }, - { - "name": "stack", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "Initiator JavaScript stack trace, set for Script only." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "Initiator URL, set for Parser type or for Script type (when script is importing module)." - }, - { - "name": "lineNumber", - "type": "number", - "optional": true, - "description": "Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based)." - } - ] - }, - { - "id": "Cookie", - "type": "object", - "description": "Cookie object", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Cookie name." - }, - { - "name": "value", - "type": "string", - "description": "Cookie value." - }, - { - "name": "domain", - "type": "string", - "description": "Cookie domain." - }, - { - "name": "path", - "type": "string", - "description": "Cookie path." - }, - { - "name": "expires", - "type": "number", - "description": "Cookie expiration date as the number of seconds since the UNIX epoch." - }, - { - "name": "size", - "type": "integer", - "description": "Cookie size." - }, - { - "name": "httpOnly", - "type": "boolean", - "description": "True if cookie is http-only." - }, - { - "name": "secure", - "type": "boolean", - "description": "True if cookie is secure." - }, - { - "name": "session", - "type": "boolean", - "description": "True in case of session cookie." - }, - { - "name": "sameSite", - "$ref": "CookieSameSite", - "optional": true, - "description": "Cookie SameSite type." - } - ] - }, - { - "id": "CookieParam", - "type": "object", - "description": "Cookie parameter object", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Cookie name." - }, - { - "name": "value", - "type": "string", - "description": "Cookie value." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie." - }, - { - "name": "domain", - "type": "string", - "optional": true, - "description": "Cookie domain." - }, - { - "name": "path", - "type": "string", - "optional": true, - "description": "Cookie path." - }, - { - "name": "secure", - "type": "boolean", - "optional": true, - "description": "True if cookie is secure." - }, - { - "name": "httpOnly", - "type": "boolean", - "optional": true, - "description": "True if cookie is http-only." - }, - { - "name": "sameSite", - "$ref": "CookieSameSite", - "optional": true, - "description": "Cookie SameSite type." - }, - { - "name": "expires", - "$ref": "TimeSinceEpoch", - "optional": true, - "description": "Cookie expiration date, session cookie if not set" - } - ] - }, - { - "id": "AuthChallenge", - "type": "object", - "description": "Authorization challenge for HTTP status code 401 or 407.", - "properties": [ - { - "name": "source", - "type": "string", - "optional": true, - "enum": [ - "Server", - "Proxy" - ], - "description": "Source of the authentication challenge." - }, - { - "name": "origin", - "type": "string", - "description": "Origin of the challenger." - }, - { - "name": "scheme", - "type": "string", - "description": "The authentication scheme used, such as basic or digest" - }, - { - "name": "realm", - "type": "string", - "description": "The realm of the challenge. May be empty." - } - ], - "experimental": true - }, - { - "id": "AuthChallengeResponse", - "type": "object", - "description": "Response to an AuthChallenge.", - "properties": [ - { - "name": "response", - "type": "string", - "enum": [ - "Default", - "CancelAuth", - "ProvideCredentials" - ], - "description": "The decision on what to do in response to the authorization challenge. Default means deferring to the default behavior of the net stack, which will likely either the Cancel authentication or display a popup dialog box." - }, - { - "name": "username", - "type": "string", - "optional": true, - "description": "The username to provide, possibly empty. Should only be set if response is ProvideCredentials." - }, - { - "name": "password", - "type": "string", - "optional": true, - "description": "The password to provide, possibly empty. Should only be set if response is ProvideCredentials." - } - ], - "experimental": true - }, - { - "id": "InterceptionStage", - "type": "string", - "description": "Stages of the interception to begin intercepting. Request will intercept before the request is sent. Response will intercept after the response is received.", - "enum": [ - "Request", - "HeadersReceived" - ], - "experimental": true - }, - { - "id": "RequestPattern", - "type": "object", - "description": "Request pattern for interception.", - "properties": [ - { - "name": "urlPattern", - "type": "string", - "optional": true, - "description": "Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to \"*\"." - }, - { - "name": "resourceType", - "$ref": "Page.ResourceType", - "optional": true, - "description": "If set, only requests for matching resource types will be intercepted." - }, - { - "name": "interceptionStage", - "$ref": "InterceptionStage", - "optional": true, - "description": "Stage at wich to begin intercepting requests. Default is Request." - } - ], - "experimental": true - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables network tracking, network events will now be delivered to the client.", - "parameters": [ - { - "name": "maxTotalBufferSize", - "type": "integer", - "optional": true, - "experimental": true, - "description": "Buffer size in bytes to use when preserving network payloads (XHRs, etc)." - }, - { - "name": "maxResourceBufferSize", - "type": "integer", - "optional": true, - "experimental": true, - "description": "Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc)." - } - ] - }, - { - "name": "disable", - "description": "Disables network tracking, prevents network events from being sent to the client." - }, - { - "name": "setUserAgentOverride", - "description": "Allows overriding user agent with the given string.", - "parameters": [ - { - "name": "userAgent", - "type": "string", - "description": "User agent to use." - } - ] - }, - { - "name": "searchInResponseBody", - "description": "Searches for given string in response content.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Identifier of the network response to search." - }, - { - "name": "query", - "type": "string", - "description": "String to search for." - }, - { - "name": "caseSensitive", - "type": "boolean", - "optional": true, - "description": "If true, search is case sensitive." - }, - { - "name": "isRegex", - "type": "boolean", - "optional": true, - "description": "If true, treats string parameter as regex." - } - ], - "returns": [ - { - "name": "result", - "type": "array", - "items": { - "$ref": "Debugger.SearchMatch" - }, - "description": "List of search matches." - } - ], - "experimental": true - }, - { - "name": "setExtraHTTPHeaders", - "description": "Specifies whether to always send extra HTTP headers with the requests from this page.", - "parameters": [ - { - "name": "headers", - "$ref": "Headers", - "description": "Map with extra HTTP headers." - } - ] - }, - { - "name": "getResponseBody", - "description": "Returns content served for the given request.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Identifier of the network request to get content for." - } - ], - "returns": [ - { - "name": "body", - "type": "string", - "description": "Response body." - }, - { - "name": "base64Encoded", - "type": "boolean", - "description": "True, if content was sent as base64." - } - ] - }, - { - "name": "setBlockedURLs", - "description": "Blocks URLs from loading.", - "parameters": [ - { - "name": "urls", - "type": "array", - "items": { - "type": "string" - }, - "description": "URL patterns to block. Wildcards ('*') are allowed." - } - ], - "experimental": true - }, - { - "name": "replayXHR", - "description": "This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Identifier of XHR to replay." - } - ], - "experimental": true - }, - { - "name": "canClearBrowserCache", - "description": "Tells whether clearing browser cache is supported.", - "returns": [ - { - "name": "result", - "type": "boolean", - "description": "True if browser cache can be cleared." - } - ], - "deprecated": true - }, - { - "name": "clearBrowserCache", - "description": "Clears browser cache." - }, - { - "name": "canClearBrowserCookies", - "description": "Tells whether clearing browser cookies is supported.", - "returns": [ - { - "name": "result", - "type": "boolean", - "description": "True if browser cookies can be cleared." - } - ], - "deprecated": true - }, - { - "name": "clearBrowserCookies", - "description": "Clears browser cookies." - }, - { - "name": "getCookies", - "parameters": [ - { - "name": "urls", - "type": "array", - "items": { - "type": "string" - }, - "optional": true, - "description": "The list of URLs for which applicable cookies will be fetched" - } - ], - "returns": [ - { - "name": "cookies", - "type": "array", - "items": { - "$ref": "Cookie" - }, - "description": "Array of cookie objects." - } - ], - "description": "Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the cookies field." - }, - { - "name": "getAllCookies", - "returns": [ - { - "name": "cookies", - "type": "array", - "items": { - "$ref": "Cookie" - }, - "description": "Array of cookie objects." - } - ], - "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies field." - }, - { - "name": "deleteCookies", - "parameters": [ - { - "name": "name", - "type": "string", - "description": "Name of the cookies to remove." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "If specified, deletes all the cookies with the given name where domain and path match provided URL." - }, - { - "name": "domain", - "type": "string", - "optional": true, - "description": "If specified, deletes only cookies with the exact domain." - }, - { - "name": "path", - "type": "string", - "optional": true, - "description": "If specified, deletes only cookies with the exact path." - } - ], - "description": "Deletes browser cookies with matching name and url or domain/path pair." - }, - { - "name": "setCookie", - "parameters": [ - { - "name": "name", - "type": "string", - "description": "Cookie name." - }, - { - "name": "value", - "type": "string", - "description": "Cookie value." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie." - }, - { - "name": "domain", - "type": "string", - "optional": true, - "description": "Cookie domain." - }, - { - "name": "path", - "type": "string", - "optional": true, - "description": "Cookie path." - }, - { - "name": "secure", - "type": "boolean", - "optional": true, - "description": "True if cookie is secure." - }, - { - "name": "httpOnly", - "type": "boolean", - "optional": true, - "description": "True if cookie is http-only." - }, - { - "name": "sameSite", - "$ref": "CookieSameSite", - "optional": true, - "description": "Cookie SameSite type." - }, - { - "name": "expires", - "$ref": "TimeSinceEpoch", - "optional": true, - "description": "Cookie expiration date, session cookie if not set" - } - ], - "returns": [ - { - "name": "success", - "type": "boolean", - "description": "True if successfully set cookie." - } - ], - "description": "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist." - }, - { - "name": "setCookies", - "parameters": [ - { - "name": "cookies", - "type": "array", - "items": { - "$ref": "CookieParam" - }, - "description": "Cookies to be set." - } - ], - "description": "Sets given cookies." - }, - { - "name": "canEmulateNetworkConditions", - "description": "Tells whether emulation of network conditions is supported.", - "returns": [ - { - "name": "result", - "type": "boolean", - "description": "True if emulation of network conditions is supported." - } - ], - "deprecated": true - }, - { - "name": "emulateNetworkConditions", - "description": "Activates emulation of network conditions.", - "parameters": [ - { - "name": "offline", - "type": "boolean", - "description": "True to emulate internet disconnection." - }, - { - "name": "latency", - "type": "number", - "description": "Minimum latency from request sent to response headers received (ms)." - }, - { - "name": "downloadThroughput", - "type": "number", - "description": "Maximal aggregated download throughput (bytes/sec). -1 disables download throttling." - }, - { - "name": "uploadThroughput", - "type": "number", - "description": "Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling." - }, - { - "name": "connectionType", - "$ref": "ConnectionType", - "optional": true, - "description": "Connection type if known." - } - ] - }, - { - "name": "setCacheDisabled", - "parameters": [ - { - "name": "cacheDisabled", - "type": "boolean", - "description": "Cache disabled state." - } - ], - "description": "Toggles ignoring cache for each request. If true, cache will not be used." - }, - { - "name": "setBypassServiceWorker", - "parameters": [ - { - "name": "bypass", - "type": "boolean", - "description": "Bypass service worker and load from network." - } - ], - "experimental": true, - "description": "Toggles ignoring of service worker for each request." - }, - { - "name": "setDataSizeLimitsForTest", - "parameters": [ - { - "name": "maxTotalSize", - "type": "integer", - "description": "Maximum total buffer size." - }, - { - "name": "maxResourceSize", - "type": "integer", - "description": "Maximum per-resource size." - } - ], - "description": "For testing.", - "experimental": true - }, - { - "name": "getCertificate", - "description": "Returns the DER-encoded certificate.", - "parameters": [ - { - "name": "origin", - "type": "string", - "description": "Origin to get certificate for." - } - ], - "returns": [ - { - "name": "tableNames", - "type": "array", - "items": { - "type": "string" - } - } - ], - "experimental": true - }, - { - "name": "setRequestInterception", - "description": "Sets the requests to intercept that match a the provided patterns and optionally resource types.", - "parameters": [ - { - "name": "patterns", - "type": "array", - "items": { - "$ref": "RequestPattern" - }, - "description": "Requests matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call." - } - ], - "experimental": true - }, - { - "name": "continueInterceptedRequest", - "description": "Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId.", - "parameters": [ - { - "name": "interceptionId", - "$ref": "InterceptionId" - }, - { - "name": "errorReason", - "$ref": "ErrorReason", - "optional": true, - "description": "If set this causes the request to fail with the given reason. Passing Aborted for requests marked with isNavigationRequest also cancels the navigation. Must not be set in response to an authChallenge." - }, - { - "name": "rawResponse", - "type": "string", - "optional": true, - "description": "If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge." - }, - { - "name": "method", - "type": "string", - "optional": true, - "description": "If set this allows the request method to be overridden. Must not be set in response to an authChallenge." - }, - { - "name": "postData", - "type": "string", - "optional": true, - "description": "If set this allows postData to be set. Must not be set in response to an authChallenge." - }, - { - "name": "headers", - "$ref": "Headers", - "optional": true, - "description": "If set this allows the request headers to be changed. Must not be set in response to an authChallenge." - }, - { - "name": "authChallengeResponse", - "$ref": "AuthChallengeResponse", - "optional": true, - "description": "Response to a requestIntercepted with an authChallenge. Must not be set otherwise." - } - ], - "experimental": true - }, - { - "name": "getResponseBodyForInterception", - "description": "Returns content served for the given currently intercepted request.", - "parameters": [ - { - "name": "interceptionId", - "$ref": "InterceptionId", - "description": "Identifier for the intercepted request to get body for." - } - ], - "returns": [ - { - "name": "body", - "type": "string", - "description": "Response body." - }, - { - "name": "base64Encoded", - "type": "boolean", - "description": "True, if content was sent as base64." - } - ], - "experimental": true - } - ], - "events": [ - { - "name": "resourceChangedPriority", - "description": "Fired when resource loading priority is changed", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "newPriority", - "$ref": "ResourcePriority", - "description": "New priority" - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - } - ], - "experimental": true - }, - { - "name": "requestWillBeSent", - "description": "Fired when page is about to send HTTP request.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "loaderId", - "$ref": "LoaderId", - "description": "Loader identifier. Empty string if the request is fetched from worker." - }, - { - "name": "documentURL", - "type": "string", - "description": "URL of the document this request is loaded for." - }, - { - "name": "request", - "$ref": "Request", - "description": "Request data." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "wallTime", - "$ref": "TimeSinceEpoch", - "description": "Timestamp." - }, - { - "name": "initiator", - "$ref": "Initiator", - "description": "Request initiator." - }, - { - "name": "redirectResponse", - "optional": true, - "$ref": "Response", - "description": "Redirect response data." - }, - { - "name": "type", - "$ref": "Page.ResourceType", - "optional": true, - "description": "Type of this resource." - }, - { - "name": "frameId", - "optional": true, - "$ref": "Page.FrameId", - "description": "Frame identifier." - } - ] - }, - { - "name": "requestServedFromCache", - "description": "Fired if request ended up loading from cache.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - } - ] - }, - { - "name": "responseReceived", - "description": "Fired when HTTP response is available.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "loaderId", - "$ref": "LoaderId", - "description": "Loader identifier. Empty string if the request is fetched from worker." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "type", - "$ref": "Page.ResourceType", - "description": "Resource type." - }, - { - "name": "response", - "$ref": "Response", - "description": "Response data." - }, - { - "name": "frameId", - "optional": true, - "$ref": "Page.FrameId", - "description": "Frame identifier." - } - ] - }, - { - "name": "dataReceived", - "description": "Fired when data chunk was received over the network.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "dataLength", - "type": "integer", - "description": "Data chunk length." - }, - { - "name": "encodedDataLength", - "type": "integer", - "description": "Actual bytes received (might be less than dataLength for compressed encodings)." - } - ] - }, - { - "name": "loadingFinished", - "description": "Fired when HTTP request has finished loading.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "encodedDataLength", - "type": "number", - "description": "Total number of bytes received for this request." - } - ] - }, - { - "name": "loadingFailed", - "description": "Fired when HTTP request has failed to load.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "type", - "$ref": "Page.ResourceType", - "description": "Resource type." - }, - { - "name": "errorText", - "type": "string", - "description": "User friendly error message." - }, - { - "name": "canceled", - "type": "boolean", - "optional": true, - "description": "True if loading was canceled." - }, - { - "name": "blockedReason", - "$ref": "BlockedReason", - "optional": true, - "description": "The reason why loading was blocked, if any." - } - ] - }, - { - "name": "webSocketWillSendHandshakeRequest", - "description": "Fired when WebSocket is about to initiate handshake.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "wallTime", - "$ref": "TimeSinceEpoch", - "description": "UTC Timestamp." - }, - { - "name": "request", - "$ref": "WebSocketRequest", - "description": "WebSocket request data." - } - ] - }, - { - "name": "webSocketHandshakeResponseReceived", - "description": "Fired when WebSocket handshake response becomes available.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "response", - "$ref": "WebSocketResponse", - "description": "WebSocket response data." - } - ] - }, - { - "name": "webSocketCreated", - "description": "Fired upon WebSocket creation.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "url", - "type": "string", - "description": "WebSocket request URL." - }, - { - "name": "initiator", - "$ref": "Initiator", - "optional": true, - "description": "Request initiator." - } - ] - }, - { - "name": "webSocketClosed", - "description": "Fired when WebSocket is closed.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - } - ] - }, - { - "name": "webSocketFrameReceived", - "description": "Fired when WebSocket frame is received.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "response", - "$ref": "WebSocketFrame", - "description": "WebSocket response data." - } - ] - }, - { - "name": "webSocketFrameError", - "description": "Fired when WebSocket frame error occurs.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "errorMessage", - "type": "string", - "description": "WebSocket frame error message." - } - ] - }, - { - "name": "webSocketFrameSent", - "description": "Fired when WebSocket frame is sent.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "response", - "$ref": "WebSocketFrame", - "description": "WebSocket response data." - } - ] - }, - { - "name": "eventSourceMessageReceived", - "description": "Fired when EventSource message is received.", - "parameters": [ - { - "name": "requestId", - "$ref": "RequestId", - "description": "Request identifier." - }, - { - "name": "timestamp", - "$ref": "MonotonicTime", - "description": "Timestamp." - }, - { - "name": "eventName", - "type": "string", - "description": "Message type." - }, - { - "name": "eventId", - "type": "string", - "description": "Message identifier." - }, - { - "name": "data", - "type": "string", - "description": "Message content." - } - ] - }, - { - "name": "requestIntercepted", - "description": "Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked.", - "parameters": [ - { - "name": "interceptionId", - "$ref": "InterceptionId", - "description": "Each request the page makes will have a unique id, however if any redirects are encountered while processing that fetch, they will be reported with the same id as the original fetch. Likewise if HTTP authentication is needed then the same fetch id will be used." - }, - { - "name": "request", - "$ref": "Request" - }, - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "The id of the frame that initiated the request." - }, - { - "name": "resourceType", - "$ref": "Page.ResourceType", - "description": "How the requested resource will be used." - }, - { - "name": "isNavigationRequest", - "type": "boolean", - "description": "Whether this is a navigation request, which can abort the navigation completely." - }, - { - "name": "redirectUrl", - "optional": true, - "type": "string", - "description": "Redirect location, only sent if a redirect was intercepted." - }, - { - "name": "authChallenge", - "$ref": "AuthChallenge", - "optional": true, - "description": "Details of the Authorization Challenge encountered. If this is set then continueInterceptedRequest must contain an authChallengeResponse." - }, - { - "name": "responseErrorReason", - "$ref": "ErrorReason", - "optional": true, - "description": "Response error if intercepted at response stage or if redirect occurred while intercepting request." - }, - { - "name": "responseStatusCode", - "type": "integer", - "optional": true, - "description": "Response code if intercepted at response stage or if redirect occurred while intercepting request or auth retry occurred." - }, - { - "name": "responseHeaders", - "$ref": "Headers", - "optional": true, - "description": "Response headers if intercepted at the response stage or if redirect occurred while intercepting request or auth retry occurred." - } - ], - "experimental": true - } - ] - }, - { - "domain": "Database", - "experimental": true, - "types": [ - { - "id": "DatabaseId", - "type": "string", - "description": "Unique identifier of Database object." - }, - { - "id": "Database", - "type": "object", - "description": "Database object.", - "properties": [ - { - "name": "id", - "$ref": "DatabaseId", - "description": "Database ID." - }, - { - "name": "domain", - "type": "string", - "description": "Database domain." - }, - { - "name": "name", - "type": "string", - "description": "Database name." - }, - { - "name": "version", - "type": "string", - "description": "Database version." - } - ] - }, - { - "id": "Error", - "type": "object", - "description": "Database error.", - "properties": [ - { - "name": "message", - "type": "string", - "description": "Error message." - }, - { - "name": "code", - "type": "integer", - "description": "Error code." - } - ] - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables database tracking, database events will now be delivered to the client." - }, - { - "name": "disable", - "description": "Disables database tracking, prevents database events from being sent to the client." - }, - { - "name": "getDatabaseTableNames", - "parameters": [ - { - "name": "databaseId", - "$ref": "DatabaseId" - } - ], - "returns": [ - { - "name": "tableNames", - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - { - "name": "executeSQL", - "parameters": [ - { - "name": "databaseId", - "$ref": "DatabaseId" - }, - { - "name": "query", - "type": "string" - } - ], - "returns": [ - { - "name": "columnNames", - "type": "array", - "optional": true, - "items": { - "type": "string" - } - }, - { - "name": "values", - "type": "array", - "optional": true, - "items": { - "type": "any" - } - }, - { - "name": "sqlError", - "$ref": "Error", - "optional": true - } - ] - } - ], - "events": [ - { - "name": "addDatabase", - "parameters": [ - { - "name": "database", - "$ref": "Database" - } - ] - } - ] - }, - { - "domain": "IndexedDB", - "dependencies": [ - "Runtime" - ], - "experimental": true, - "types": [ - { - "id": "DatabaseWithObjectStores", - "type": "object", - "description": "Database with an array of object stores.", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Database name." - }, - { - "name": "version", - "type": "integer", - "description": "Database version." - }, - { - "name": "objectStores", - "type": "array", - "items": { - "$ref": "ObjectStore" - }, - "description": "Object stores in this database." - } - ] - }, - { - "id": "ObjectStore", - "type": "object", - "description": "Object store.", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Object store name." - }, - { - "name": "keyPath", - "$ref": "KeyPath", - "description": "Object store key path." - }, - { - "name": "autoIncrement", - "type": "boolean", - "description": "If true, object store has auto increment flag set." - }, - { - "name": "indexes", - "type": "array", - "items": { - "$ref": "ObjectStoreIndex" - }, - "description": "Indexes in this object store." - } - ] - }, - { - "id": "ObjectStoreIndex", - "type": "object", - "description": "Object store index.", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Index name." - }, - { - "name": "keyPath", - "$ref": "KeyPath", - "description": "Index key path." - }, - { - "name": "unique", - "type": "boolean", - "description": "If true, index is unique." - }, - { - "name": "multiEntry", - "type": "boolean", - "description": "If true, index allows multiple entries for a key." - } - ] - }, - { - "id": "Key", - "type": "object", - "description": "Key.", - "properties": [ - { - "name": "type", - "type": "string", - "enum": [ - "number", - "string", - "date", - "array" - ], - "description": "Key type." - }, - { - "name": "number", - "type": "number", - "optional": true, - "description": "Number value." - }, - { - "name": "string", - "type": "string", - "optional": true, - "description": "String value." - }, - { - "name": "date", - "type": "number", - "optional": true, - "description": "Date value." - }, - { - "name": "array", - "type": "array", - "optional": true, - "items": { - "$ref": "Key" - }, - "description": "Array value." - } - ] - }, - { - "id": "KeyRange", - "type": "object", - "description": "Key range.", - "properties": [ - { - "name": "lower", - "$ref": "Key", - "optional": true, - "description": "Lower bound." - }, - { - "name": "upper", - "$ref": "Key", - "optional": true, - "description": "Upper bound." - }, - { - "name": "lowerOpen", - "type": "boolean", - "description": "If true lower bound is open." - }, - { - "name": "upperOpen", - "type": "boolean", - "description": "If true upper bound is open." - } - ] - }, - { - "id": "DataEntry", - "type": "object", - "description": "Data entry.", - "properties": [ - { - "name": "key", - "$ref": "Runtime.RemoteObject", - "description": "Key object." - }, - { - "name": "primaryKey", - "$ref": "Runtime.RemoteObject", - "description": "Primary key object." - }, - { - "name": "value", - "$ref": "Runtime.RemoteObject", - "description": "Value object." - } - ] - }, - { - "id": "KeyPath", - "type": "object", - "description": "Key path.", - "properties": [ - { - "name": "type", - "type": "string", - "enum": [ - "null", - "string", - "array" - ], - "description": "Key path type." - }, - { - "name": "string", - "type": "string", - "optional": true, - "description": "String value." - }, - { - "name": "array", - "type": "array", - "optional": true, - "items": { - "type": "string" - }, - "description": "Array value." - } - ] - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables events from backend." - }, - { - "name": "disable", - "description": "Disables events from backend." - }, - { - "name": "requestDatabaseNames", - "parameters": [ - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin." - } - ], - "returns": [ - { - "name": "databaseNames", - "type": "array", - "items": { - "type": "string" - }, - "description": "Database names for origin." - } - ], - "description": "Requests database names for given security origin." - }, - { - "name": "requestDatabase", - "parameters": [ - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin." - }, - { - "name": "databaseName", - "type": "string", - "description": "Database name." - } - ], - "returns": [ - { - "name": "databaseWithObjectStores", - "$ref": "DatabaseWithObjectStores", - "description": "Database with an array of object stores." - } - ], - "description": "Requests database with given name in given frame." - }, - { - "name": "requestData", - "parameters": [ - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin." - }, - { - "name": "databaseName", - "type": "string", - "description": "Database name." - }, - { - "name": "objectStoreName", - "type": "string", - "description": "Object store name." - }, - { - "name": "indexName", - "type": "string", - "description": "Index name, empty string for object store data requests." - }, - { - "name": "skipCount", - "type": "integer", - "description": "Number of records to skip." - }, - { - "name": "pageSize", - "type": "integer", - "description": "Number of records to fetch." - }, - { - "name": "keyRange", - "$ref": "KeyRange", - "optional": true, - "description": "Key range." - } - ], - "returns": [ - { - "name": "objectStoreDataEntries", - "type": "array", - "items": { - "$ref": "DataEntry" - }, - "description": "Array of object store data entries." - }, - { - "name": "hasMore", - "type": "boolean", - "description": "If true, there are more entries to fetch in the given range." - } - ], - "description": "Requests data from object store or index." - }, - { - "name": "clearObjectStore", - "parameters": [ - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin." - }, - { - "name": "databaseName", - "type": "string", - "description": "Database name." - }, - { - "name": "objectStoreName", - "type": "string", - "description": "Object store name." - } - ], - "returns": [], - "description": "Clears all entries from an object store." - }, - { - "name": "deleteDatabase", - "parameters": [ - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin." - }, - { - "name": "databaseName", - "type": "string", - "description": "Database name." - } - ], - "returns": [], - "description": "Deletes a database." - } - ] - }, - { - "domain": "CacheStorage", - "experimental": true, - "types": [ - { - "id": "CacheId", - "type": "string", - "description": "Unique identifier of the Cache object." - }, - { - "id": "DataEntry", - "type": "object", - "description": "Data entry.", - "properties": [ - { - "name": "requestURL", - "type": "string", - "description": "Request URL." - }, - { - "name": "requestMethod", - "type": "string", - "description": "Request method." - }, - { - "name": "requestHeaders", - "type": "array", - "items": { - "$ref": "Header" - }, - "description": "Request headers" - }, - { - "name": "responseTime", - "type": "number", - "description": "Number of seconds since epoch." - }, - { - "name": "responseStatus", - "type": "integer", - "description": "HTTP response status code." - }, - { - "name": "responseStatusText", - "type": "string", - "description": "HTTP response status text." - }, - { - "name": "responseHeaders", - "type": "array", - "items": { - "$ref": "Header" - }, - "description": "Response headers" - } - ] - }, - { - "id": "Cache", - "type": "object", - "description": "Cache identifier.", - "properties": [ - { - "name": "cacheId", - "$ref": "CacheId", - "description": "An opaque unique id of the cache." - }, - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin of the cache." - }, - { - "name": "cacheName", - "type": "string", - "description": "The name of the cache." - } - ] - }, - { - "id": "Header", - "type": "object", - "properties": [ - { - "name": "name", - "type": "string" - }, - { - "name": "value", "type": "string" } ] - }, - { - "id": "CachedResponse", - "type": "object", - "description": "Cached response", - "properties": [ - { - "name": "body", - "type": "string", - "description": "Entry content, base64-encoded." - } - ] - } - ], - "commands": [ - { - "name": "requestCacheNames", - "parameters": [ - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin." - } - ], - "returns": [ - { - "name": "caches", - "type": "array", - "items": { - "$ref": "Cache" - }, - "description": "Caches for the security origin." - } - ], - "description": "Requests cache names." - }, - { - "name": "requestEntries", - "parameters": [ - { - "name": "cacheId", - "$ref": "CacheId", - "description": "ID of cache to get entries from." - }, - { - "name": "skipCount", - "type": "integer", - "description": "Number of records to skip." - }, - { - "name": "pageSize", - "type": "integer", - "description": "Number of records to fetch." - } - ], - "returns": [ - { - "name": "cacheDataEntries", - "type": "array", - "items": { - "$ref": "DataEntry" - }, - "description": "Array of object store data entries." - }, - { - "name": "hasMore", - "type": "boolean", - "description": "If true, there are more entries to fetch in the given range." - } - ], - "description": "Requests data from cache." - }, - { - "name": "deleteCache", - "parameters": [ - { - "name": "cacheId", - "$ref": "CacheId", - "description": "Id of cache for deletion." - } - ], - "description": "Deletes a cache." - }, - { - "name": "deleteEntry", - "parameters": [ - { - "name": "cacheId", - "$ref": "CacheId", - "description": "Id of cache where the entry will be deleted." - }, - { - "name": "request", - "type": "string", - "description": "URL spec of the request." - } - ], - "description": "Deletes a cache entry." - }, - { - "name": "requestCachedResponse", - "parameters": [ - { - "name": "cacheId", - "$ref": "CacheId", - "description": "Id of cache that contains the enty." - }, - { - "name": "requestURL", - "type": "string", - "description": "URL spec of the request." - } - ], - "returns": [ - { - "name": "response", - "$ref": "CachedResponse", - "description": "Response read from the cache." - } - ], - "description": "Fetches cache entry." - } - ] - }, - { - "domain": "DOMStorage", - "experimental": true, - "description": "Query and modify DOM storage.", - "types": [ - { - "id": "StorageId", - "type": "object", - "description": "DOM Storage identifier.", - "properties": [ - { - "name": "securityOrigin", - "type": "string", - "description": "Security origin for the storage." - }, - { - "name": "isLocalStorage", - "type": "boolean", - "description": "Whether the storage is local storage (not session storage)." - } - ] - }, - { - "id": "Item", - "type": "array", - "description": "DOM Storage item.", - "items": { - "type": "string" - } - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables storage tracking, storage events will now be delivered to the client." - }, - { - "name": "disable", - "description": "Disables storage tracking, prevents storage events from being sent to the client." - }, - { - "name": "clear", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - } - ] - }, - { - "name": "getDOMStorageItems", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - } - ], - "returns": [ - { - "name": "entries", - "type": "array", - "items": { - "$ref": "Item" - } - } - ] - }, - { - "name": "setDOMStorageItem", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - }, - { - "name": "key", - "type": "string" - }, - { - "name": "value", - "type": "string" - } - ] - }, - { - "name": "removeDOMStorageItem", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - }, - { - "name": "key", - "type": "string" - } - ] - } - ], - "events": [ - { - "name": "domStorageItemsCleared", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - } - ] - }, - { - "name": "domStorageItemRemoved", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - }, - { - "name": "key", - "type": "string" - } - ] - }, - { - "name": "domStorageItemAdded", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - }, - { - "name": "key", - "type": "string" - }, - { - "name": "newValue", - "type": "string" - } - ] - }, - { - "name": "domStorageItemUpdated", - "parameters": [ - { - "name": "storageId", - "$ref": "StorageId" - }, - { - "name": "key", - "type": "string" - }, - { - "name": "oldValue", - "type": "string" - }, - { - "name": "newValue", - "type": "string" - } - ] - } - ] - }, - { - "domain": "ApplicationCache", - "experimental": true, - "types": [ - { - "id": "ApplicationCacheResource", - "type": "object", - "description": "Detailed application cache resource information.", - "properties": [ - { - "name": "url", - "type": "string", - "description": "Resource url." - }, - { - "name": "size", - "type": "integer", - "description": "Resource size." - }, - { - "name": "type", - "type": "string", - "description": "Resource type." - } - ] - }, - { - "id": "ApplicationCache", - "type": "object", - "description": "Detailed application cache information.", - "properties": [ - { - "name": "manifestURL", - "type": "string", - "description": "Manifest URL." - }, - { - "name": "size", - "type": "number", - "description": "Application cache size." - }, - { - "name": "creationTime", - "type": "number", - "description": "Application cache creation time." - }, - { - "name": "updateTime", - "type": "number", - "description": "Application cache update time." - }, - { - "name": "resources", - "type": "array", - "items": { - "$ref": "ApplicationCacheResource" - }, - "description": "Application cache resources." - } - ] - }, - { - "id": "FrameWithManifest", - "type": "object", - "description": "Frame identifier - manifest URL pair.", - "properties": [ - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "Frame identifier." - }, - { - "name": "manifestURL", - "type": "string", - "description": "Manifest URL." - }, - { - "name": "status", - "type": "integer", - "description": "Application cache status." - } - ] - } - ], - "commands": [ - { - "name": "getFramesWithManifests", - "returns": [ - { - "name": "frameIds", - "type": "array", - "items": { - "$ref": "FrameWithManifest" - }, - "description": "Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache." - } - ], - "description": "Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache." - }, - { - "name": "enable", - "description": "Enables application cache domain notifications." - }, - { - "name": "getManifestForFrame", - "parameters": [ - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "Identifier of the frame containing document whose manifest is retrieved." - } - ], - "returns": [ - { - "name": "manifestURL", - "type": "string", - "description": "Manifest URL for document in the given frame." - } - ], - "description": "Returns manifest URL for document in the given frame." - }, - { - "name": "getApplicationCacheForFrame", - "parameters": [ - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "Identifier of the frame containing document whose application cache is retrieved." - } - ], - "returns": [ - { - "name": "applicationCache", - "$ref": "ApplicationCache", - "description": "Relevant application cache data for the document in given frame." - } - ], - "description": "Returns relevant application cache data for the document in given frame." - } - ], - "events": [ - { - "name": "applicationCacheStatusUpdated", - "parameters": [ - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "Identifier of the frame containing document whose application cache updated status." - }, - { - "name": "manifestURL", - "type": "string", - "description": "Manifest URL." - }, - { - "name": "status", - "type": "integer", - "description": "Updated application cache status." - } - ] - }, - { - "name": "networkStateUpdated", - "parameters": [ - { - "name": "isNowOnline", - "type": "boolean" - } - ] - } - ] - }, - { - "domain": "DOM", - "description": "This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id. This id can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client.Note that iframe owner elements will return corresponding document elements as their child nodes.", - "dependencies": [ - "Runtime" - ], - "types": [ - { - "id": "NodeId", - "type": "integer", - "description": "Unique DOM node identifier." - }, - { - "id": "BackendNodeId", - "type": "integer", - "description": "Unique DOM node identifier used to reference a node that may not have been pushed to the front-end." - }, - { - "id": "BackendNode", - "type": "object", - "properties": [ - { - "name": "nodeType", - "type": "integer", - "description": "Node's nodeType." - }, - { - "name": "nodeName", - "type": "string", - "description": "Node's nodeName." - }, - { - "name": "backendNodeId", - "$ref": "BackendNodeId" - } - ], - "description": "Backend node with a friendly name." - }, - { - "id": "PseudoType", - "type": "string", - "enum": [ - "first-line", - "first-letter", - "before", - "after", - "backdrop", - "selection", - "first-line-inherited", - "scrollbar", - "scrollbar-thumb", - "scrollbar-button", - "scrollbar-track", - "scrollbar-track-piece", - "scrollbar-corner", - "resizer", - "input-list-button" - ], - "description": "Pseudo element type." - }, - { - "id": "ShadowRootType", - "type": "string", - "enum": [ - "user-agent", - "open", - "closed" - ], - "description": "Shadow root type." - }, - { - "id": "Node", - "type": "object", - "properties": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Node identifier that is passed into the rest of the DOM messages as the nodeId. Backend will only push node with given id once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client." - }, - { - "name": "parentId", - "$ref": "NodeId", - "optional": true, - "description": "The id of the parent node if any." - }, - { - "name": "backendNodeId", - "$ref": "BackendNodeId", - "description": "The BackendNodeId for this node." - }, - { - "name": "nodeType", - "type": "integer", - "description": "Node's nodeType." - }, - { - "name": "nodeName", - "type": "string", - "description": "Node's nodeName." - }, - { - "name": "localName", - "type": "string", - "description": "Node's localName." - }, - { - "name": "nodeValue", - "type": "string", - "description": "Node's nodeValue." - }, - { - "name": "childNodeCount", - "type": "integer", - "optional": true, - "description": "Child count for Container nodes." - }, - { - "name": "children", - "type": "array", - "optional": true, - "items": { - "$ref": "Node" - }, - "description": "Child nodes of this node when requested with children." - }, - { - "name": "attributes", - "type": "array", - "optional": true, - "items": { - "type": "string" - }, - "description": "Attributes of the Element node in the form of flat array [name1, value1, name2, value2]." - }, - { - "name": "documentURL", - "type": "string", - "optional": true, - "description": "Document URL that Document or FrameOwner node points to." - }, - { - "name": "baseURL", - "type": "string", - "optional": true, - "description": "Base URL that Document or FrameOwner node uses for URL completion." - }, - { - "name": "publicId", - "type": "string", - "optional": true, - "description": "DocumentType's publicId." - }, - { - "name": "systemId", - "type": "string", - "optional": true, - "description": "DocumentType's systemId." - }, - { - "name": "internalSubset", - "type": "string", - "optional": true, - "description": "DocumentType's internalSubset." - }, - { - "name": "xmlVersion", - "type": "string", - "optional": true, - "description": "Document's XML version in case of XML documents." - }, - { - "name": "name", - "type": "string", - "optional": true, - "description": "Attr's name." - }, - { - "name": "value", - "type": "string", - "optional": true, - "description": "Attr's value." - }, - { - "name": "pseudoType", - "$ref": "PseudoType", - "optional": true, - "description": "Pseudo element type for this node." - }, - { - "name": "shadowRootType", - "$ref": "ShadowRootType", - "optional": true, - "description": "Shadow root type." - }, - { - "name": "frameId", - "$ref": "Page.FrameId", - "optional": true, - "description": "Frame ID for frame owner elements." - }, - { - "name": "contentDocument", - "$ref": "Node", - "optional": true, - "description": "Content document for frame owner elements." - }, - { - "name": "shadowRoots", - "type": "array", - "optional": true, - "items": { - "$ref": "Node" - }, - "description": "Shadow root list for given element host." - }, - { - "name": "templateContent", - "$ref": "Node", - "optional": true, - "description": "Content document fragment for template elements." - }, - { - "name": "pseudoElements", - "type": "array", - "items": { - "$ref": "Node" - }, - "optional": true, - "description": "Pseudo elements associated with this node." - }, - { - "name": "importedDocument", - "$ref": "Node", - "optional": true, - "description": "Import document for the HTMLImport links." - }, - { - "name": "distributedNodes", - "type": "array", - "items": { - "$ref": "BackendNode" - }, - "optional": true, - "description": "Distributed nodes for given insertion point." - }, - { - "name": "isSVG", - "type": "boolean", - "optional": true, - "description": "Whether the node is SVG." - } - ], - "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type." - }, - { - "id": "RGBA", - "type": "object", - "properties": [ - { - "name": "r", - "type": "integer", - "description": "The red component, in the [0-255] range." - }, - { - "name": "g", - "type": "integer", - "description": "The green component, in the [0-255] range." - }, - { - "name": "b", - "type": "integer", - "description": "The blue component, in the [0-255] range." - }, - { - "name": "a", - "type": "number", - "optional": true, - "description": "The alpha component, in the [0-1] range (default: 1)." - } - ], - "description": "A structure holding an RGBA color." - }, - { - "id": "Quad", - "type": "array", - "items": { - "type": "number" - }, - "minItems": 8, - "maxItems": 8, - "description": "An array of quad vertices, x immediately followed by y for each point, points clock-wise." - }, - { - "id": "BoxModel", - "type": "object", - "properties": [ - { - "name": "content", - "$ref": "Quad", - "description": "Content box" - }, - { - "name": "padding", - "$ref": "Quad", - "description": "Padding box" - }, - { - "name": "border", - "$ref": "Quad", - "description": "Border box" - }, - { - "name": "margin", - "$ref": "Quad", - "description": "Margin box" - }, - { - "name": "width", - "type": "integer", - "description": "Node width" - }, - { - "name": "height", - "type": "integer", - "description": "Node height" - }, - { - "name": "shapeOutside", - "$ref": "ShapeOutsideInfo", - "optional": true, - "description": "Shape outside coordinates" - } - ], - "description": "Box model." - }, - { - "id": "ShapeOutsideInfo", - "type": "object", - "properties": [ - { - "name": "bounds", - "$ref": "Quad", - "description": "Shape bounds" - }, - { - "name": "shape", - "type": "array", - "items": { - "type": "any" - }, - "description": "Shape coordinate details" - }, - { - "name": "marginShape", - "type": "array", - "items": { - "type": "any" - }, - "description": "Margin shape bounds" - } - ], - "description": "CSS Shape Outside details." - }, - { - "id": "Rect", - "type": "object", - "properties": [ - { - "name": "x", - "type": "number", - "description": "X coordinate" - }, - { - "name": "y", - "type": "number", - "description": "Y coordinate" - }, - { - "name": "width", - "type": "number", - "description": "Rectangle width" - }, - { - "name": "height", - "type": "number", - "description": "Rectangle height" - } - ], - "description": "Rectangle." - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables DOM agent for the given page." - }, - { - "name": "disable", - "description": "Disables DOM agent for the given page." - }, - { - "name": "getDocument", - "parameters": [ - { - "name": "depth", - "type": "integer", - "optional": true, - "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0." - }, - { - "name": "pierce", - "type": "boolean", - "optional": true, - "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false)." - } - ], - "returns": [ - { - "name": "root", - "$ref": "Node", - "description": "Resulting node." - } - ], - "description": "Returns the root DOM node (and optionally the subtree) to the caller." - }, - { - "name": "getFlattenedDocument", - "parameters": [ - { - "name": "depth", - "type": "integer", - "optional": true, - "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0." - }, - { - "name": "pierce", - "type": "boolean", - "optional": true, - "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false)." - } - ], - "returns": [ - { - "name": "nodes", - "type": "array", - "items": { - "$ref": "Node" - }, - "description": "Resulting node." - } - ], - "description": "Returns the root DOM node (and optionally the subtree) to the caller." - }, - { - "name": "collectClassNamesFromSubtree", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to collect class names." - } - ], - "returns": [ - { - "name": "classNames", - "type": "array", - "items": { - "type": "string" - }, - "description": "Class name list." - } - ], - "description": "Collects class names for the node with given id and all of it's child nodes.", - "experimental": true - }, - { - "name": "requestChildNodes", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to get children for." - }, - { - "name": "depth", - "type": "integer", - "optional": true, - "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0." - }, - { - "name": "pierce", - "type": "boolean", - "optional": true, - "description": "Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false)." - } - ], - "description": "Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth." - }, - { - "name": "querySelector", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to query upon." - }, - { - "name": "selector", - "type": "string", - "description": "Selector string." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Query selector result." - } - ], - "description": "Executes querySelector on a given node." - }, - { - "name": "querySelectorAll", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to query upon." - }, - { - "name": "selector", - "type": "string", - "description": "Selector string." - } - ], - "returns": [ - { - "name": "nodeIds", - "type": "array", - "items": { - "$ref": "NodeId" - }, - "description": "Query selector result." - } - ], - "description": "Executes querySelectorAll on a given node." - }, - { - "name": "setNodeName", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to set name for." - }, - { - "name": "name", - "type": "string", - "description": "New node's name." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "New node's id." - } - ], - "description": "Sets node name for a node with given id." - }, - { - "name": "setNodeValue", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to set value for." - }, - { - "name": "value", - "type": "string", - "description": "New node's value." - } - ], - "description": "Sets node value for a node with given id." - }, - { - "name": "removeNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to remove." - } - ], - "description": "Removes node with given id." - }, - { - "name": "setAttributeValue", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the element to set attribute for." - }, - { - "name": "name", - "type": "string", - "description": "Attribute name." - }, - { - "name": "value", - "type": "string", - "description": "Attribute value." - } - ], - "description": "Sets attribute for an element with given id." - }, - { - "name": "setAttributesAsText", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the element to set attributes for." - }, - { - "name": "text", - "type": "string", - "description": "Text with a number of attributes. Will parse this text using HTML parser." - }, - { - "name": "name", - "type": "string", - "optional": true, - "description": "Attribute name to replace with new attributes derived from text in case text parsed successfully." - } - ], - "description": "Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs." - }, - { - "name": "removeAttribute", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the element to remove attribute from." - }, - { - "name": "name", - "type": "string", - "description": "Name of the attribute to remove." - } - ], - "description": "Removes attribute with given name from an element with given id." - }, - { - "name": "getOuterHTML", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "optional": true, - "description": "Identifier of the node." - }, - { - "name": "backendNodeId", - "$ref": "BackendNodeId", - "optional": true, - "description": "Identifier of the backend node." - }, - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "optional": true, - "description": "JavaScript object id of the node wrapper." - } - ], - "returns": [ - { - "name": "outerHTML", - "type": "string", - "description": "Outer HTML markup." - } - ], - "description": "Returns node's HTML markup." - }, - { - "name": "setOuterHTML", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to set markup for." - }, - { - "name": "outerHTML", - "type": "string", - "description": "Outer HTML markup to set." - } - ], - "description": "Sets node HTML markup, returns new node id." - }, - { - "name": "performSearch", - "parameters": [ - { - "name": "query", - "type": "string", - "description": "Plain text or query selector or XPath search query." - }, - { - "name": "includeUserAgentShadowDOM", - "type": "boolean", - "optional": true, - "description": "True to search in user agent shadow DOM." - } - ], - "returns": [ - { - "name": "searchId", - "type": "string", - "description": "Unique search session identifier." - }, - { - "name": "resultCount", - "type": "integer", - "description": "Number of search results." - } - ], - "description": "Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.", - "experimental": true - }, - { - "name": "getSearchResults", - "parameters": [ - { - "name": "searchId", - "type": "string", - "description": "Unique search session identifier." - }, - { - "name": "fromIndex", - "type": "integer", - "description": "Start index of the search result to be returned." - }, - { - "name": "toIndex", - "type": "integer", - "description": "End index of the search result to be returned." - } - ], - "returns": [ - { - "name": "nodeIds", - "type": "array", - "items": { - "$ref": "NodeId" - }, - "description": "Ids of the search result nodes." - } - ], - "description": "Returns search results from given fromIndex to given toIndex from the search with the given identifier.", - "experimental": true - }, - { - "name": "discardSearchResults", - "parameters": [ - { - "name": "searchId", - "type": "string", - "description": "Unique search session identifier." - } - ], - "description": "Discards search results from the session with the given id. getSearchResults should no longer be called for that search.", - "experimental": true - }, - { - "name": "requestNode", - "parameters": [ - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "description": "JavaScript object id to convert into node." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Node id for given object." - } - ], - "description": "Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications." - }, - { - "name": "highlightRect", - "description": "Highlights given rectangle.", - "redirect": "Overlay" - }, - { - "name": "highlightNode", - "description": "Highlights DOM node.", - "redirect": "Overlay" - }, - { - "name": "hideHighlight", - "description": "Hides any highlight.", - "redirect": "Overlay" - }, - { - "name": "pushNodeByPathToFrontend", - "parameters": [ - { - "name": "path", - "type": "string", - "description": "Path to node in the proprietary format." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node for given path." - } - ], - "description": "Requests that the node is sent to the caller given its path. // FIXME, use XPath", - "experimental": true - }, - { - "name": "pushNodesByBackendIdsToFrontend", - "parameters": [ - { - "name": "backendNodeIds", - "type": "array", - "items": { - "$ref": "BackendNodeId" - }, - "description": "The array of backend node ids." - } - ], - "returns": [ - { - "name": "nodeIds", - "type": "array", - "items": { - "$ref": "NodeId" - }, - "description": "The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds." - } - ], - "description": "Requests that a batch of nodes is sent to the caller given their backend node ids.", - "experimental": true - }, - { - "name": "setInspectedNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "DOM node id to be accessible by means of $x command line API." - } - ], - "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).", - "experimental": true - }, - { - "name": "resolveNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "optional": true, - "description": "Id of the node to resolve." - }, - { - "name": "backendNodeId", - "$ref": "DOM.BackendNodeId", - "optional": true, - "description": "Backend identifier of the node to resolve." - }, - { - "name": "objectGroup", - "type": "string", - "optional": true, - "description": "Symbolic group name that can be used to release multiple objects." - } - ], - "returns": [ - { - "name": "object", - "$ref": "Runtime.RemoteObject", - "description": "JavaScript object wrapper for given node." - } - ], - "description": "Resolves the JavaScript node object for a given NodeId or BackendNodeId." - }, - { - "name": "getAttributes", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to retrieve attibutes for." - } - ], - "returns": [ - { - "name": "attributes", - "type": "array", - "items": { - "type": "string" - }, - "description": "An interleaved array of node attribute names and values." - } - ], - "description": "Returns attributes for the specified node." - }, - { - "name": "copyTo", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to copy." - }, - { - "name": "targetNodeId", - "$ref": "NodeId", - "description": "Id of the element to drop the copy into." - }, - { - "name": "insertBeforeNodeId", - "$ref": "NodeId", - "optional": true, - "description": "Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId)." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node clone." - } - ], - "description": "Creates a deep copy of the specified node and places it into the target container before the given anchor.", - "experimental": true - }, - { - "name": "moveTo", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node to move." - }, - { - "name": "targetNodeId", - "$ref": "NodeId", - "description": "Id of the element to drop the moved node into." - }, - { - "name": "insertBeforeNodeId", - "$ref": "NodeId", - "optional": true, - "description": "Drop node before this one (if absent, the moved node becomes the last child of targetNodeId)." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "New id of the moved node." - } - ], - "description": "Moves node into the new container, places it before the given anchor." - }, - { - "name": "undo", - "description": "Undoes the last performed action.", - "experimental": true - }, - { - "name": "redo", - "description": "Re-does the last undone action.", - "experimental": true - }, - { - "name": "markUndoableState", - "description": "Marks last undoable state.", - "experimental": true - }, - { - "name": "focus", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "optional": true, - "description": "Identifier of the node." - }, - { - "name": "backendNodeId", - "$ref": "BackendNodeId", - "optional": true, - "description": "Identifier of the backend node." - }, - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "optional": true, - "description": "JavaScript object id of the node wrapper." - } - ], - "description": "Focuses the given element." - }, - { - "name": "setFileInputFiles", - "parameters": [ - { - "name": "files", - "type": "array", - "items": { - "type": "string" - }, - "description": "Array of file paths to set." - }, - { - "name": "nodeId", - "$ref": "NodeId", - "optional": true, - "description": "Identifier of the node." - }, - { - "name": "backendNodeId", - "$ref": "BackendNodeId", - "optional": true, - "description": "Identifier of the backend node." - }, - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "optional": true, - "description": "JavaScript object id of the node wrapper." - } - ], - "description": "Sets files for the given file input element." - }, - { - "name": "getBoxModel", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "optional": true, - "description": "Identifier of the node." - }, - { - "name": "backendNodeId", - "$ref": "BackendNodeId", - "optional": true, - "description": "Identifier of the backend node." - }, - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "optional": true, - "description": "JavaScript object id of the node wrapper." - } - ], - "returns": [ - { - "name": "model", - "$ref": "BoxModel", - "description": "Box model for the node." - } - ], - "description": "Returns boxes for the given node." - }, - { - "name": "getNodeForLocation", - "parameters": [ - { - "name": "x", - "type": "integer", - "description": "X coordinate." - }, - { - "name": "y", - "type": "integer", - "description": "Y coordinate." - }, - { - "name": "includeUserAgentShadowDOM", - "type": "boolean", - "optional": true, - "description": "False to skip to the nearest non-UA shadow root ancestor (default: false)." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node at given coordinates." - } - ], - "description": "Returns node id at given location.", - "experimental": true - }, - { - "name": "getRelayoutBoundary", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node." - } - ], - "returns": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Relayout boundary node id for the given node." - } - ], - "description": "Returns the id of the nearest ancestor that is a relayout boundary.", - "experimental": true - }, - { - "name": "describeNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "optional": true, - "description": "Identifier of the node." - }, - { - "name": "backendNodeId", - "$ref": "BackendNodeId", - "optional": true, - "description": "Identifier of the backend node." - }, - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "optional": true, - "description": "JavaScript object id of the node wrapper." - }, - { - "name": "depth", - "type": "integer", - "optional": true, - "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0." - }, - { - "name": "pierce", - "type": "boolean", - "optional": true, - "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false)." - } - ], - "returns": [ - { - "name": "node", - "$ref": "Node", - "description": "Node description." - } - ], - "description": "Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation." - } - ], - "events": [ - { - "name": "documentUpdated", - "description": "Fired when Document has been totally updated. Node ids are no longer valid." - }, - { - "name": "setChildNodes", - "parameters": [ - { - "name": "parentId", - "$ref": "NodeId", - "description": "Parent node id to populate with children." - }, - { - "name": "nodes", - "type": "array", - "items": { - "$ref": "Node" - }, - "description": "Child nodes array." - } - ], - "description": "Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids." - }, - { - "name": "attributeModified", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node that has changed." - }, - { - "name": "name", - "type": "string", - "description": "Attribute name." - }, - { - "name": "value", - "type": "string", - "description": "Attribute value." - } - ], - "description": "Fired when Element's attribute is modified." - }, - { - "name": "attributeRemoved", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node that has changed." - }, - { - "name": "name", - "type": "string", - "description": "A ttribute name." - } - ], - "description": "Fired when Element's attribute is removed." - }, - { - "name": "inlineStyleInvalidated", - "parameters": [ - { - "name": "nodeIds", - "type": "array", - "items": { - "$ref": "NodeId" - }, - "description": "Ids of the nodes for which the inline styles have been invalidated." - } - ], - "description": "Fired when Element's inline style is modified via a CSS property modification.", - "experimental": true - }, - { - "name": "characterDataModified", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node that has changed." - }, - { - "name": "characterData", - "type": "string", - "description": "New text value." - } - ], - "description": "Mirrors DOMCharacterDataModified event." - }, - { - "name": "childNodeCountUpdated", - "parameters": [ - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node that has changed." - }, - { - "name": "childNodeCount", - "type": "integer", - "description": "New node count." - } - ], - "description": "Fired when Container's child node count has changed." - }, - { - "name": "childNodeInserted", - "parameters": [ - { - "name": "parentNodeId", - "$ref": "NodeId", - "description": "Id of the node that has changed." - }, - { - "name": "previousNodeId", - "$ref": "NodeId", - "description": "If of the previous siblint." - }, - { - "name": "node", - "$ref": "Node", - "description": "Inserted node data." - } - ], - "description": "Mirrors DOMNodeInserted event." - }, - { - "name": "childNodeRemoved", - "parameters": [ - { - "name": "parentNodeId", - "$ref": "NodeId", - "description": "Parent id." - }, - { - "name": "nodeId", - "$ref": "NodeId", - "description": "Id of the node that has been removed." - } - ], - "description": "Mirrors DOMNodeRemoved event." - }, - { - "name": "shadowRootPushed", - "parameters": [ - { - "name": "hostId", - "$ref": "NodeId", - "description": "Host element id." - }, - { - "name": "root", - "$ref": "Node", - "description": "Shadow root." - } - ], - "description": "Called when shadow root is pushed into the element.", - "experimental": true - }, - { - "name": "shadowRootPopped", - "parameters": [ - { - "name": "hostId", - "$ref": "NodeId", - "description": "Host element id." - }, - { - "name": "rootId", - "$ref": "NodeId", - "description": "Shadow root id." - } - ], - "description": "Called when shadow root is popped from the element.", - "experimental": true - }, - { - "name": "pseudoElementAdded", - "parameters": [ - { - "name": "parentId", - "$ref": "NodeId", - "description": "Pseudo element's parent element id." - }, - { - "name": "pseudoElement", - "$ref": "Node", - "description": "The added pseudo element." - } - ], - "description": "Called when a pseudo element is added to an element.", - "experimental": true - }, - { - "name": "pseudoElementRemoved", - "parameters": [ - { - "name": "parentId", - "$ref": "NodeId", - "description": "Pseudo element's parent element id." - }, - { - "name": "pseudoElementId", - "$ref": "NodeId", - "description": "The removed pseudo element id." - } - ], - "description": "Called when a pseudo element is removed from an element.", - "experimental": true - }, - { - "name": "distributedNodesUpdated", - "parameters": [ - { - "name": "insertionPointId", - "$ref": "NodeId", - "description": "Insertion point where distrubuted nodes were updated." - }, - { - "name": "distributedNodes", - "type": "array", - "items": { - "$ref": "BackendNode" - }, - "description": "Distributed nodes for given insertion point." - } - ], - "description": "Called when distrubution is changed.", - "experimental": true - } - ] - }, - { - "domain": "CSS", - "experimental": true, - "description": "This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated id used in subsequent operations on the related object. Each object type has a specific id structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). A client can also keep track of stylesheets via the styleSheetAdded/styleSheetRemoved events and subsequently load the required stylesheet contents using the getStyleSheet[Text]() methods.", - "dependencies": [ - "DOM" - ], - "types": [ - { - "id": "StyleSheetId", - "type": "string" - }, - { - "id": "StyleSheetOrigin", - "type": "string", - "enum": [ - "injected", - "user-agent", - "inspector", - "regular" - ], - "description": "Stylesheet type: \"injected\" for stylesheets injected via extension, \"user-agent\" for user-agent stylesheets, \"inspector\" for stylesheets created by the inspector (i.e. those holding the \"via inspector\" rules), \"regular\" for regular stylesheets." - }, - { - "id": "PseudoElementMatches", - "type": "object", - "properties": [ - { - "name": "pseudoType", - "$ref": "DOM.PseudoType", - "description": "Pseudo element type." - }, - { - "name": "matches", - "type": "array", - "items": { - "$ref": "RuleMatch" - }, - "description": "Matches of CSS rules applicable to the pseudo style." - } - ], - "description": "CSS rule collection for a single pseudo style." - }, - { - "id": "InheritedStyleEntry", - "type": "object", - "properties": [ - { - "name": "inlineStyle", - "$ref": "CSSStyle", - "optional": true, - "description": "The ancestor node's inline style, if any, in the style inheritance chain." - }, - { - "name": "matchedCSSRules", - "type": "array", - "items": { - "$ref": "RuleMatch" - }, - "description": "Matches of CSS rules matching the ancestor node in the style inheritance chain." - } - ], - "description": "Inherited CSS rule collection from ancestor node." - }, - { - "id": "RuleMatch", - "type": "object", - "properties": [ - { - "name": "rule", - "$ref": "CSSRule", - "description": "CSS rule in the match." - }, - { - "name": "matchingSelectors", - "type": "array", - "items": { - "type": "integer" - }, - "description": "Matching selector indices in the rule's selectorList selectors (0-based)." - } - ], - "description": "Match data for a CSS rule." - }, - { - "id": "Value", - "type": "object", - "properties": [ - { - "name": "text", - "type": "string", - "description": "Value text." - }, - { - "name": "range", - "$ref": "SourceRange", - "optional": true, - "description": "Value range in the underlying resource (if available)." - } - ], - "description": "Data for a simple selector (these are delimited by commas in a selector list)." - }, - { - "id": "SelectorList", - "type": "object", - "properties": [ - { - "name": "selectors", - "type": "array", - "items": { - "$ref": "Value" - }, - "description": "Selectors in the list." - }, - { - "name": "text", - "type": "string", - "description": "Rule selector text." - } - ], - "description": "Selector list data." - }, - { - "id": "CSSStyleSheetHeader", - "type": "object", - "properties": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "description": "The stylesheet identifier." - }, - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "Owner frame identifier." - }, - { - "name": "sourceURL", - "type": "string", - "description": "Stylesheet resource URL." - }, - { - "name": "sourceMapURL", - "type": "string", - "optional": true, - "description": "URL of source map associated with the stylesheet (if any)." - }, - { - "name": "origin", - "$ref": "StyleSheetOrigin", - "description": "Stylesheet origin." - }, - { - "name": "title", - "type": "string", - "description": "Stylesheet title." - }, - { - "name": "ownerNode", - "$ref": "DOM.BackendNodeId", - "optional": true, - "description": "The backend id for the owner node of the stylesheet." - }, - { - "name": "disabled", - "type": "boolean", - "description": "Denotes whether the stylesheet is disabled." - }, - { - "name": "hasSourceURL", - "type": "boolean", - "optional": true, - "description": "Whether the sourceURL field value comes from the sourceURL comment." - }, - { - "name": "isInline", - "type": "boolean", - "description": "Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags." - }, - { - "name": "startLine", - "type": "number", - "description": "Line offset of the stylesheet within the resource (zero based)." - }, - { - "name": "startColumn", - "type": "number", - "description": "Column offset of the stylesheet within the resource (zero based)." - }, - { - "name": "length", - "type": "number", - "description": "Size of the content (in characters)." - } - ], - "description": "CSS stylesheet metainformation." - }, - { - "id": "CSSRule", - "type": "object", - "properties": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "optional": true, - "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from." - }, - { - "name": "selectorList", - "$ref": "SelectorList", - "description": "Rule selector data." - }, - { - "name": "origin", - "$ref": "StyleSheetOrigin", - "description": "Parent stylesheet's origin." - }, - { - "name": "style", - "$ref": "CSSStyle", - "description": "Associated style declaration." - }, - { - "name": "media", - "type": "array", - "items": { - "$ref": "CSSMedia" - }, - "optional": true, - "description": "Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards." - } - ], - "description": "CSS rule representation." - }, - { - "id": "RuleUsage", - "type": "object", - "properties": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from." - }, - { - "name": "startOffset", - "type": "number", - "description": "Offset of the start of the rule (including selector) from the beginning of the stylesheet." - }, - { - "name": "endOffset", - "type": "number", - "description": "Offset of the end of the rule body from the beginning of the stylesheet." - }, - { - "name": "used", - "type": "boolean", - "description": "Indicates whether the rule was actually used by some element in the page." - } - ], - "description": "CSS coverage information." - }, - { - "id": "SourceRange", - "type": "object", - "properties": [ - { - "name": "startLine", - "type": "integer", - "description": "Start line of range." - }, - { - "name": "startColumn", - "type": "integer", - "description": "Start column of range (inclusive)." - }, - { - "name": "endLine", - "type": "integer", - "description": "End line of range" - }, - { - "name": "endColumn", - "type": "integer", - "description": "End column of range (exclusive)." - } - ], - "description": "Text range within a resource. All numbers are zero-based." - }, - { - "id": "ShorthandEntry", - "type": "object", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Shorthand name." - }, - { - "name": "value", - "type": "string", - "description": "Shorthand value." - }, - { - "name": "important", - "type": "boolean", - "optional": true, - "description": "Whether the property has \"!important\" annotation (implies false if absent)." - } - ] - }, - { - "id": "CSSComputedStyleProperty", - "type": "object", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Computed style property name." - }, - { - "name": "value", - "type": "string", - "description": "Computed style property value." - } - ] - }, - { - "id": "CSSStyle", - "type": "object", - "properties": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "optional": true, - "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from." - }, - { - "name": "cssProperties", - "type": "array", - "items": { - "$ref": "CSSProperty" - }, - "description": "CSS properties in the style." - }, - { - "name": "shorthandEntries", - "type": "array", - "items": { - "$ref": "ShorthandEntry" - }, - "description": "Computed values for all shorthands found in the style." - }, - { - "name": "cssText", - "type": "string", - "optional": true, - "description": "Style declaration text (if available)." - }, - { - "name": "range", - "$ref": "SourceRange", - "optional": true, - "description": "Style declaration range in the enclosing stylesheet (if available)." - } - ], - "description": "CSS style representation." - }, - { - "id": "CSSProperty", - "type": "object", - "properties": [ - { - "name": "name", - "type": "string", - "description": "The property name." - }, - { - "name": "value", - "type": "string", - "description": "The property value." - }, - { - "name": "important", - "type": "boolean", - "optional": true, - "description": "Whether the property has \"!important\" annotation (implies false if absent)." - }, - { - "name": "implicit", - "type": "boolean", - "optional": true, - "description": "Whether the property is implicit (implies false if absent)." - }, - { - "name": "text", - "type": "string", - "optional": true, - "description": "The full property text as specified in the style." - }, - { - "name": "parsedOk", - "type": "boolean", - "optional": true, - "description": "Whether the property is understood by the browser (implies true if absent)." - }, - { - "name": "disabled", - "type": "boolean", - "optional": true, - "description": "Whether the property is disabled by the user (present for source-based properties only)." - }, - { - "name": "range", - "$ref": "SourceRange", - "optional": true, - "description": "The entire property range in the enclosing style declaration (if available)." - } - ], - "description": "CSS property declaration data." - }, - { - "id": "CSSMedia", - "type": "object", - "properties": [ - { - "name": "text", - "type": "string", - "description": "Media query text." - }, - { - "name": "source", - "type": "string", - "enum": [ - "mediaRule", - "importRule", - "linkedSheet", - "inlineSheet" - ], - "description": "Source of the media query: \"mediaRule\" if specified by a @media rule, \"importRule\" if specified by an @import rule, \"linkedSheet\" if specified by a \"media\" attribute in a linked stylesheet's LINK tag, \"inlineSheet\" if specified by a \"media\" attribute in an inline stylesheet's STYLE tag." - }, - { - "name": "sourceURL", - "type": "string", - "optional": true, - "description": "URL of the document containing the media query description." - }, - { - "name": "range", - "$ref": "SourceRange", - "optional": true, - "description": "The associated rule (@media or @import) header range in the enclosing stylesheet (if available)." - }, - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "optional": true, - "description": "Identifier of the stylesheet containing this object (if exists)." - }, - { - "name": "mediaList", - "type": "array", - "items": { - "$ref": "MediaQuery" - }, - "optional": true, - "description": "Array of media queries." - } - ], - "description": "CSS media rule descriptor." - }, - { - "id": "MediaQuery", - "type": "object", - "properties": [ - { - "name": "expressions", - "type": "array", - "items": { - "$ref": "MediaQueryExpression" - }, - "description": "Array of media query expressions." - }, - { - "name": "active", - "type": "boolean", - "description": "Whether the media query condition is satisfied." - } - ], - "description": "Media query descriptor." - }, - { - "id": "MediaQueryExpression", - "type": "object", - "properties": [ - { - "name": "value", - "type": "number", - "description": "Media query expression value." - }, - { - "name": "unit", - "type": "string", - "description": "Media query expression units." - }, - { - "name": "feature", - "type": "string", - "description": "Media query expression feature." - }, - { - "name": "valueRange", - "$ref": "SourceRange", - "optional": true, - "description": "The associated range of the value text in the enclosing stylesheet (if available)." - }, - { - "name": "computedLength", - "type": "number", - "optional": true, - "description": "Computed length of media query expression (if applicable)." - } - ], - "description": "Media query expression descriptor." - }, - { - "id": "PlatformFontUsage", - "type": "object", - "properties": [ - { - "name": "familyName", - "type": "string", - "description": "Font's family name reported by platform." - }, - { - "name": "isCustomFont", - "type": "boolean", - "description": "Indicates if the font was downloaded or resolved locally." - }, - { - "name": "glyphCount", - "type": "number", - "description": "Amount of glyphs that were rendered with this font." - } - ], - "description": "Information about amount of glyphs that were rendered with given font." - }, - { - "id": "CSSKeyframesRule", - "type": "object", - "properties": [ - { - "name": "animationName", - "$ref": "Value", - "description": "Animation name." - }, - { - "name": "keyframes", - "type": "array", - "items": { - "$ref": "CSSKeyframeRule" - }, - "description": "List of keyframes." - } - ], - "description": "CSS keyframes rule representation." - }, - { - "id": "CSSKeyframeRule", - "type": "object", - "properties": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "optional": true, - "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from." - }, - { - "name": "origin", - "$ref": "StyleSheetOrigin", - "description": "Parent stylesheet's origin." - }, - { - "name": "keyText", - "$ref": "Value", - "description": "Associated key text." - }, - { - "name": "style", - "$ref": "CSSStyle", - "description": "Associated style declaration." - } - ], - "description": "CSS keyframe rule representation." - }, - { - "id": "StyleDeclarationEdit", - "type": "object", - "properties": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "description": "The css style sheet identifier." - }, - { - "name": "range", - "$ref": "SourceRange", - "description": "The range of the style text in the enclosing stylesheet." - }, - { - "name": "text", - "type": "string", - "description": "New style text." - } - ], - "description": "A descriptor of operation to mutate style declaration text." - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received." - }, - { - "name": "disable", - "description": "Disables the CSS agent for the given page." - }, - { - "name": "getMatchedStylesForNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId" - } - ], - "returns": [ - { - "name": "inlineStyle", - "$ref": "CSSStyle", - "optional": true, - "description": "Inline style for the specified DOM node." - }, - { - "name": "attributesStyle", - "$ref": "CSSStyle", - "optional": true, - "description": "Attribute-defined element style (e.g. resulting from \"width=20 height=100%\")." - }, - { - "name": "matchedCSSRules", - "type": "array", - "items": { - "$ref": "RuleMatch" - }, - "optional": true, - "description": "CSS rules matching this node, from all applicable stylesheets." - }, - { - "name": "pseudoElements", - "type": "array", - "items": { - "$ref": "PseudoElementMatches" - }, - "optional": true, - "description": "Pseudo style matches for this node." - }, - { - "name": "inherited", - "type": "array", - "items": { - "$ref": "InheritedStyleEntry" - }, - "optional": true, - "description": "A chain of inherited styles (from the immediate node parent up to the DOM tree root)." - }, - { - "name": "cssKeyframesRules", - "type": "array", - "items": { - "$ref": "CSSKeyframesRule" - }, - "optional": true, - "description": "A list of CSS keyframed animations matching this node." - } - ], - "description": "Returns requested styles for a DOM node identified by nodeId." - }, - { - "name": "getInlineStylesForNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId" - } - ], - "returns": [ - { - "name": "inlineStyle", - "$ref": "CSSStyle", - "optional": true, - "description": "Inline style for the specified DOM node." - }, - { - "name": "attributesStyle", - "$ref": "CSSStyle", - "optional": true, - "description": "Attribute-defined element style (e.g. resulting from \"width=20 height=100%\")." - } - ], - "description": "Returns the styles defined inline (explicitly in the \"style\" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId." - }, - { - "name": "getComputedStyleForNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId" - } - ], - "returns": [ - { - "name": "computedStyle", - "type": "array", - "items": { - "$ref": "CSSComputedStyleProperty" - }, - "description": "Computed style for the specified DOM node." - } - ], - "description": "Returns the computed style for a DOM node identified by nodeId." - }, - { - "name": "getPlatformFontsForNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId" - } - ], - "returns": [ - { - "name": "fonts", - "type": "array", - "items": { - "$ref": "PlatformFontUsage" - }, - "description": "Usage statistics for every employed platform font." - } - ], - "description": "Requests information about platform fonts which we used to render child TextNodes in the given node." - }, - { - "name": "getStyleSheetText", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId" - } - ], - "returns": [ - { - "name": "text", - "type": "string", - "description": "The stylesheet text." - } - ], - "description": "Returns the current textual content and the URL for a stylesheet." - }, - { - "name": "collectClassNames", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId" - } - ], - "returns": [ - { - "name": "classNames", - "type": "array", - "items": { - "type": "string" - }, - "description": "Class name list." - } - ], - "description": "Returns all class names from specified stylesheet." - }, - { - "name": "setStyleSheetText", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId" - }, - { - "name": "text", - "type": "string" - } - ], - "returns": [ - { - "name": "sourceMapURL", - "type": "string", - "optional": true, - "description": "URL of source map associated with script (if any)." - } - ], - "description": "Sets the new stylesheet text." - }, - { - "name": "setRuleSelector", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId" - }, - { - "name": "range", - "$ref": "SourceRange" - }, - { - "name": "selector", - "type": "string" - } - ], - "returns": [ - { - "name": "selectorList", - "$ref": "SelectorList", - "description": "The resulting selector list after modification." - } - ], - "description": "Modifies the rule selector." - }, - { - "name": "setKeyframeKey", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId" - }, - { - "name": "range", - "$ref": "SourceRange" - }, - { - "name": "keyText", - "type": "string" - } - ], - "returns": [ - { - "name": "keyText", - "$ref": "Value", - "description": "The resulting key text after modification." - } - ], - "description": "Modifies the keyframe rule key text." - }, - { - "name": "setStyleTexts", - "parameters": [ - { - "name": "edits", - "type": "array", - "items": { - "$ref": "StyleDeclarationEdit" - } - } - ], - "returns": [ - { - "name": "styles", - "type": "array", - "items": { - "$ref": "CSSStyle" - }, - "description": "The resulting styles after modification." - } - ], - "description": "Applies specified style edits one after another in the given order." - }, - { - "name": "setMediaText", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId" - }, - { - "name": "range", - "$ref": "SourceRange" - }, - { - "name": "text", - "type": "string" - } - ], - "returns": [ - { - "name": "media", - "$ref": "CSSMedia", - "description": "The resulting CSS media rule after modification." - } - ], - "description": "Modifies the rule selector." - }, - { - "name": "createStyleSheet", - "parameters": [ - { - "name": "frameId", - "$ref": "Page.FrameId", - "description": "Identifier of the frame where \"via-inspector\" stylesheet should be created." - } - ], - "returns": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "description": "Identifier of the created \"via-inspector\" stylesheet." - } - ], - "description": "Creates a new special \"via-inspector\" stylesheet in the frame with given frameId." - }, - { - "name": "addRule", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "description": "The css style sheet identifier where a new rule should be inserted." - }, - { - "name": "ruleText", - "type": "string", - "description": "The text of a new rule." - }, - { - "name": "location", - "$ref": "SourceRange", - "description": "Text position of a new rule in the target style sheet." - } - ], - "returns": [ - { - "name": "rule", - "$ref": "CSSRule", - "description": "The newly created rule." - } - ], - "description": "Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location." - }, - { - "name": "forcePseudoState", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "description": "The element id for which to force the pseudo state." - }, - { - "name": "forcedPseudoClasses", - "type": "array", - "items": { - "type": "string", - "enum": [ - "active", - "focus", - "hover", - "visited" - ] - }, - "description": "Element pseudo classes to force when computing the element's style." - } - ], - "description": "Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser." - }, - { - "name": "getMediaQueries", - "returns": [ - { - "name": "medias", - "type": "array", - "items": { - "$ref": "CSSMedia" - } - } - ], - "description": "Returns all media queries parsed by the rendering engine." - }, - { - "name": "setEffectivePropertyValueForNode", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "description": "The element id for which to set property." - }, - { - "name": "propertyName", - "type": "string" - }, - { - "name": "value", - "type": "string" - } - ], - "description": "Find a rule with the given active property for the given node and set the new value for this property" - }, - { - "name": "getBackgroundColors", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "description": "Id of the node to get background colors for." - } - ], - "returns": [ - { - "name": "backgroundColors", - "type": "array", - "items": { - "type": "string" - }, - "description": "The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load).", - "optional": true - }, - { - "name": "computedFontSize", - "type": "string", - "description": "The computed font size for this node, as a CSS computed value string (e.g. '12px').", - "optional": true - }, - { - "name": "computedFontWeight", - "type": "string", - "description": "The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').", - "optional": true - }, - { - "name": "computedBodyFontSize", - "type": "string", - "description": "The computed font size for the document body, as a computed CSS value string (e.g. '16px').", - "optional": true - } - ] - }, - { - "name": "startRuleUsageTracking", - "description": "Enables the selector recording." - }, - { - "name": "takeCoverageDelta", - "description": "Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation)", - "returns": [ - { - "name": "coverage", - "type": "array", - "items": { - "$ref": "RuleUsage" - } - } - ] - }, - { - "name": "stopRuleUsageTracking", - "returns": [ - { - "name": "ruleUsage", - "type": "array", - "items": { - "$ref": "RuleUsage" - } - } - ], - "description": "The list of rules with an indication of whether these were used" - } - ], - "events": [ - { - "name": "mediaQueryResultChanged", - "description": "Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features." - }, - { - "name": "fontsUpdated", - "description": "Fires whenever a web font gets loaded." - }, - { - "name": "styleSheetChanged", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId" - } - ], - "description": "Fired whenever a stylesheet is changed as a result of the client operation." - }, - { - "name": "styleSheetAdded", - "parameters": [ - { - "name": "header", - "$ref": "CSSStyleSheetHeader", - "description": "Added stylesheet metainfo." - } - ], - "description": "Fired whenever an active document stylesheet is added." - }, - { - "name": "styleSheetRemoved", - "parameters": [ - { - "name": "styleSheetId", - "$ref": "StyleSheetId", - "description": "Identifier of the removed stylesheet." - } - ], - "description": "Fired whenever an active document stylesheet is removed." - } - ] - }, - { - "domain": "DOMSnapshot", - "experimental": true, - "description": "This domain facilitates obtaining document snapshots with DOM, layout, and style information.", - "dependencies": [ - "CSS", - "DOM", - "Page" - ], - "types": [ - { - "id": "DOMNode", - "type": "object", - "properties": [ - { - "name": "nodeType", - "type": "integer", - "description": "Node's nodeType." - }, - { - "name": "nodeName", - "type": "string", - "description": "Node's nodeName." - }, - { - "name": "nodeValue", - "type": "string", - "description": "Node's nodeValue." - }, - { - "name": "textValue", - "type": "string", - "optional": true, - "description": "Only set for textarea elements, contains the text value." - }, - { - "name": "inputValue", - "type": "string", - "optional": true, - "description": "Only set for input elements, contains the input's associated text value." - }, - { - "name": "inputChecked", - "type": "boolean", - "optional": true, - "description": "Only set for radio and checkbox input elements, indicates if the element has been checked" - }, - { - "name": "optionSelected", - "type": "boolean", - "optional": true, - "description": "Only set for option elements, indicates if the element has been selected" - }, - { - "name": "backendNodeId", - "$ref": "DOM.BackendNodeId", - "description": "Node's id, corresponds to DOM.Node.backendNodeId." - }, - { - "name": "childNodeIndexes", - "type": "array", - "items": { - "type": "integer" - }, - "optional": true, - "description": "The indexes of the node's child nodes in the domNodes array returned by getSnapshot, if any." - }, - { - "name": "attributes", - "type": "array", - "items": { - "$ref": "NameValue" - }, - "optional": true, - "description": "Attributes of an Element node." - }, - { - "name": "pseudoElementIndexes", - "type": "array", - "items": { - "type": "integer" - }, - "optional": true, - "description": "Indexes of pseudo elements associated with this node in the domNodes array returned by getSnapshot, if any." - }, - { - "name": "layoutNodeIndex", - "type": "integer", - "optional": true, - "description": "The index of the node's related layout tree node in the layoutTreeNodes array returned by getSnapshot, if any." - }, - { - "name": "documentURL", - "type": "string", - "optional": true, - "description": "Document URL that Document or FrameOwner node points to." - }, - { - "name": "baseURL", - "type": "string", - "optional": true, - "description": "Base URL that Document or FrameOwner node uses for URL completion." - }, - { - "name": "contentLanguage", - "type": "string", - "optional": true, - "description": "Only set for documents, contains the document's content language." - }, - { - "name": "documentEncoding", - "type": "string", - "optional": true, - "description": "Only set for documents, contains the document's character set encoding." - }, - { - "name": "publicId", - "type": "string", - "optional": true, - "description": "DocumentType node's publicId." - }, - { - "name": "systemId", - "type": "string", - "optional": true, - "description": "DocumentType node's systemId." - }, - { - "name": "frameId", - "$ref": "Page.FrameId", - "optional": true, - "description": "Frame ID for frame owner elements and also for the document node." - }, - { - "name": "contentDocumentIndex", - "type": "integer", - "optional": true, - "description": "The index of a frame owner element's content document in the domNodes array returned by getSnapshot, if any." - }, - { - "name": "importedDocumentIndex", - "type": "integer", - "optional": true, - "description": "Index of the imported document's node of a link element in the domNodes array returned by getSnapshot, if any." - }, - { - "name": "templateContentIndex", - "type": "integer", - "optional": true, - "description": "Index of the content node of a template element in the domNodes array returned by getSnapshot." - }, - { - "name": "pseudoType", - "$ref": "DOM.PseudoType", - "optional": true, - "description": "Type of a pseudo element node." - }, - { - "name": "isClickable", - "type": "boolean", - "optional": true, - "description": "Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked." - } - ], - "description": "A Node in the DOM tree." - }, - { - "id": "InlineTextBox", - "type": "object", - "properties": [ - { - "name": "boundingBox", - "$ref": "DOM.Rect", - "description": "The absolute position bounding box." - }, - { - "name": "startCharacterIndex", - "type": "integer", - "description": "The starting index in characters, for this post layout textbox substring." - }, - { - "name": "numCharacters", - "type": "integer", - "description": "The number of characters in this post layout textbox substring." - } - ], - "description": "Details of post layout rendered text positions. The exact layout should not be regarded as stable and may change between versions." - }, - { - "id": "LayoutTreeNode", - "type": "object", - "properties": [ - { - "name": "domNodeIndex", - "type": "integer", - "description": "The index of the related DOM node in the domNodes array returned by getSnapshot." - }, - { - "name": "boundingBox", - "$ref": "DOM.Rect", - "description": "The absolute position bounding box." - }, - { - "name": "layoutText", - "type": "string", - "optional": true, - "description": "Contents of the LayoutText, if any." - }, - { - "name": "inlineTextNodes", - "type": "array", - "optional": true, - "items": { - "$ref": "InlineTextBox" - }, - "description": "The post-layout inline text nodes, if any." - }, - { - "name": "styleIndex", - "type": "integer", - "optional": true, - "description": "Index into the computedStyles array returned by getSnapshot." - } - ], - "description": "Details of an element in the DOM tree with a LayoutObject." - }, - { - "id": "ComputedStyle", - "type": "object", - "properties": [ - { - "name": "properties", - "type": "array", - "items": { - "$ref": "NameValue" - }, - "description": "Name/value pairs of computed style properties." - } - ], - "description": "A subset of the full ComputedStyle as defined by the request whitelist." - }, - { - "id": "NameValue", - "type": "object", - "properties": [ - { - "name": "name", - "type": "string", - "description": "Attribute/property name." - }, - { - "name": "value", - "type": "string", - "description": "Attribute/property value." - } - ], - "description": "A name/value pair." - } - ], - "commands": [ - { - "name": "getSnapshot", - "parameters": [ - { - "name": "computedStyleWhitelist", - "type": "array", - "items": { - "type": "string" - }, - "description": "Whitelist of computed styles to return." - } - ], - "returns": [ - { - "name": "domNodes", - "type": "array", - "items": { - "$ref": "DOMNode" - }, - "description": "The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document." - }, - { - "name": "layoutTreeNodes", - "type": "array", - "items": { - "$ref": "LayoutTreeNode" - }, - "description": "The nodes in the layout tree." - }, - { - "name": "computedStyles", - "type": "array", - "items": { - "$ref": "ComputedStyle" - }, - "description": "Whitelisted ComputedStyle properties for each node in the layout tree." - } - ], - "description": "Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. " - } - ] - }, - { - "domain": "IO", - "description": "Input/Output operations for streams produced by DevTools.", - "types": [ - { - "id": "StreamHandle", - "type": "string", - "description": "This is either obtained from another method or specifed as blob:<uuid> where <uuid> is an UUID of a Blob." - } - ], - "commands": [ - { - "name": "read", - "description": "Read a chunk of the stream", - "parameters": [ - { - "name": "handle", - "$ref": "StreamHandle", - "description": "Handle of the stream to read." - }, - { - "name": "offset", - "type": "integer", - "optional": true, - "description": "Seek to the specified offset before reading (if not specificed, proceed with offset following the last read)." - }, - { - "name": "size", - "type": "integer", - "optional": true, - "description": "Maximum number of bytes to read (left upon the agent discretion if not specified)." - } - ], - "returns": [ - { - "name": "base64Encoded", - "type": "boolean", - "optional": true, - "description": "Set if the data is base64-encoded" - }, - { - "name": "data", - "type": "string", - "description": "Data that were read." - }, - { - "name": "eof", - "type": "boolean", - "description": "Set if the end-of-file condition occured while reading." - } - ] - }, - { - "name": "close", - "description": "Close the stream, discard any temporary backing storage.", - "parameters": [ - { - "name": "handle", - "$ref": "StreamHandle", - "description": "Handle of the stream to close." - } - ] - }, - { - "name": "resolveBlob", - "parameters": [ - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "description": "Object id of a Blob object wrapper." - } - ], - "returns": [ - { - "name": "uuid", - "type": "string", - "description": "UUID of the specified Blob." - } - ], - "description": "Return UUID of Blob object specified by a remote object id." - } - ] - }, - { - "domain": "DOMDebugger", - "description": "DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.", - "dependencies": [ - "DOM", - "Debugger" - ], - "types": [ - { - "id": "DOMBreakpointType", - "type": "string", - "enum": [ - "subtree-modified", - "attribute-modified", - "node-removed" - ], - "description": "DOM breakpoint type." - }, - { - "id": "EventListener", - "type": "object", - "description": "Object event listener.", - "properties": [ - { - "name": "type", - "type": "string", - "description": "EventListener's type." - }, - { - "name": "useCapture", - "type": "boolean", - "description": "EventListener's useCapture." - }, - { - "name": "passive", - "type": "boolean", - "description": "EventListener's passive flag." - }, - { - "name": "once", - "type": "boolean", - "description": "EventListener's once flag." - }, - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Script id of the handler code." - }, - { - "name": "lineNumber", - "type": "integer", - "description": "Line number in the script (0-based)." - }, - { - "name": "columnNumber", - "type": "integer", - "description": "Column number in the script (0-based)." - }, - { - "name": "handler", - "$ref": "Runtime.RemoteObject", - "optional": true, - "description": "Event handler function value." - }, - { - "name": "originalHandler", - "$ref": "Runtime.RemoteObject", - "optional": true, - "description": "Event original handler function value." - }, - { - "name": "backendNodeId", - "$ref": "DOM.BackendNodeId", - "optional": true, - "description": "Node the listener is added to (if any)." - } - ] - } - ], - "commands": [ - { - "name": "setDOMBreakpoint", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "description": "Identifier of the node to set breakpoint on." - }, - { - "name": "type", - "$ref": "DOMBreakpointType", - "description": "Type of the operation to stop upon." - } - ], - "description": "Sets breakpoint on particular operation with DOM." - }, - { - "name": "removeDOMBreakpoint", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "description": "Identifier of the node to remove breakpoint from." - }, - { - "name": "type", - "$ref": "DOMBreakpointType", - "description": "Type of the breakpoint to remove." - } - ], - "description": "Removes DOM breakpoint that was set using setDOMBreakpoint." - }, - { - "name": "setEventListenerBreakpoint", - "parameters": [ - { - "name": "eventName", - "type": "string", - "description": "DOM Event name to stop on (any DOM event will do)." - }, - { - "name": "targetName", - "type": "string", - "optional": true, - "description": "EventTarget interface name to stop on. If equal to \"*\" or not provided, will stop on any EventTarget.", - "experimental": true - } - ], - "description": "Sets breakpoint on particular DOM event." - }, - { - "name": "removeEventListenerBreakpoint", - "parameters": [ - { - "name": "eventName", - "type": "string", - "description": "Event name." - }, - { - "name": "targetName", - "type": "string", - "optional": true, - "description": "EventTarget interface name.", - "experimental": true - } - ], - "description": "Removes breakpoint on particular DOM event." - }, - { - "name": "setInstrumentationBreakpoint", - "parameters": [ - { - "name": "eventName", - "type": "string", - "description": "Instrumentation name to stop on." - } - ], - "description": "Sets breakpoint on particular native event.", - "experimental": true - }, - { - "name": "removeInstrumentationBreakpoint", - "parameters": [ - { - "name": "eventName", - "type": "string", - "description": "Instrumentation name to stop on." - } - ], - "description": "Removes breakpoint on particular native event.", - "experimental": true - }, - { - "name": "setXHRBreakpoint", - "parameters": [ - { - "name": "url", - "type": "string", - "description": "Resource URL substring. All XHRs having this substring in the URL will get stopped upon." - } - ], - "description": "Sets breakpoint on XMLHttpRequest." - }, - { - "name": "removeXHRBreakpoint", - "parameters": [ - { - "name": "url", - "type": "string", - "description": "Resource URL substring." - } - ], - "description": "Removes breakpoint from XMLHttpRequest." - }, - { - "name": "getEventListeners", - "parameters": [ - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "description": "Identifier of the object to return listeners for." - }, - { - "name": "depth", - "type": "integer", - "optional": true, - "description": "The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0." - }, - { - "name": "pierce", - "type": "boolean", - "optional": true, - "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Reports listeners for all contexts if pierce is enabled." - } - ], - "returns": [ - { - "name": "listeners", - "type": "array", - "items": { - "$ref": "EventListener" - }, - "description": "Array of relevant listeners." - } - ], - "description": "Returns event listeners of the given object." - } - ] - }, - { - "domain": "Target", - "description": "Supports additional targets discovery and allows to attach to them.", - "types": [ - { - "id": "TargetID", - "type": "string" - }, - { - "id": "SessionID", - "type": "string", - "description": "Unique identifier of attached debugging session." - }, - { - "id": "BrowserContextID", - "type": "string", - "experimental": true - }, - { - "id": "TargetInfo", - "type": "object", - "properties": [ - { - "name": "targetId", - "$ref": "TargetID" - }, - { - "name": "type", - "type": "string" - }, - { - "name": "title", - "type": "string" - }, - { - "name": "url", - "type": "string" - }, - { - "name": "attached", - "type": "boolean", - "description": "Whether the target has an attached client." - }, - { - "name": "openerId", - "optional": true, - "$ref": "TargetID", - "description": "Opener target Id" - } - ] - }, - { - "id": "RemoteLocation", - "type": "object", - "properties": [ - { - "name": "host", - "type": "string" - }, - { - "name": "port", - "type": "integer" - } - ], - "experimental": true - } - ], - "commands": [ - { - "name": "setDiscoverTargets", - "description": "Controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyed events.", - "parameters": [ - { - "name": "discover", - "type": "boolean", - "description": "Whether to discover available targets." - } - ] - }, - { - "name": "setAutoAttach", - "description": "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.", - "parameters": [ - { - "name": "autoAttach", - "type": "boolean", - "description": "Whether to auto-attach to related targets." - }, - { - "name": "waitForDebuggerOnStart", - "type": "boolean", - "description": "Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets." - } - ], - "experimental": true - }, - { - "name": "setAttachToFrames", - "parameters": [ - { - "name": "value", - "type": "boolean", - "description": "Whether to attach to frames." - } - ], - "experimental": true - }, - { - "name": "setRemoteLocations", - "description": "Enables target discovery for the specified locations, when setDiscoverTargets was set to true.", - "parameters": [ - { - "name": "locations", - "type": "array", - "items": { - "$ref": "RemoteLocation" - }, - "description": "List of remote locations." - } - ], - "experimental": true - }, - { - "name": "sendMessageToTarget", - "description": "Sends protocol message over session with given id.", - "parameters": [ - { - "name": "message", - "type": "string" - }, - { - "name": "sessionId", - "$ref": "SessionID", - "optional": true, - "description": "Identifier of the session." - }, - { - "name": "targetId", - "$ref": "TargetID", - "optional": true, - "deprecated": true, - "description": "Deprecated." - } - ] - }, - { - "name": "getTargetInfo", - "description": "Returns information about a target.", - "parameters": [ - { - "name": "targetId", - "$ref": "TargetID" - } - ], - "returns": [ - { - "name": "targetInfo", - "$ref": "TargetInfo" - } - ], - "experimental": true - }, - { - "name": "activateTarget", - "description": "Activates (focuses) the target.", - "parameters": [ - { - "name": "targetId", - "$ref": "TargetID" - } - ] - }, - { - "name": "closeTarget", - "description": "Closes the target. If the target is a page that gets closed too.", - "parameters": [ - { - "name": "targetId", - "$ref": "TargetID" - } - ], - "returns": [ - { - "name": "success", - "type": "boolean" - } - ] - }, - { - "name": "attachToTarget", - "description": "Attaches to the target with given id.", - "parameters": [ - { - "name": "targetId", - "$ref": "TargetID" - } - ], - "returns": [ - { - "name": "sessionId", - "$ref": "SessionID", - "description": "Id assigned to the session." - } - ] - }, - { - "name": "detachFromTarget", - "description": "Detaches session with given id.", - "parameters": [ - { - "name": "sessionId", - "$ref": "SessionID", - "optional": true, - "description": "Session to detach." - }, - { - "name": "targetId", - "$ref": "TargetID", - "optional": true, - "deprecated": true, - "description": "Deprecated." - } - ] - }, - { - "name": "createBrowserContext", - "description": "Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.", - "returns": [ - { - "name": "browserContextId", - "$ref": "BrowserContextID", - "description": "The id of the context created." - } - ], - "experimental": true - }, - { - "name": "disposeBrowserContext", - "description": "Deletes a BrowserContext, will fail of any open page uses it.", - "parameters": [ - { - "name": "browserContextId", - "$ref": "BrowserContextID" - } - ], - "returns": [ - { - "name": "success", - "type": "boolean" - } - ], - "experimental": true - }, - { - "name": "createTarget", - "description": "Creates a new page.", - "parameters": [ - { - "name": "url", - "type": "string", - "description": "The initial URL the page will be navigated to." - }, - { - "name": "width", - "type": "integer", - "description": "Frame width in DIP (headless chrome only).", - "optional": true - }, - { - "name": "height", - "type": "integer", - "description": "Frame height in DIP (headless chrome only).", - "optional": true - }, - { - "name": "browserContextId", - "$ref": "BrowserContextID", - "description": "The browser context to create the page in (headless chrome only).", - "optional": true - }, - { - "name": "enableBeginFrameControl", - "type": "boolean", - "description": "Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).", - "optional": true, - "experimental": true - } - ], - "returns": [ - { - "name": "targetId", - "$ref": "TargetID", - "description": "The id of the page opened." - } - ] - }, - { - "name": "getTargets", - "description": "Retrieves a list of available targets.", - "returns": [ - { - "name": "targetInfos", - "type": "array", - "items": { - "$ref": "TargetInfo" - }, - "description": "The list of targets." - } - ] - } - ], - "events": [ - { - "name": "targetCreated", - "description": "Issued when a possible inspection target is created.", - "parameters": [ - { - "name": "targetInfo", - "$ref": "TargetInfo" - } - ] - }, - { - "name": "targetInfoChanged", - "description": "Issued when some information about a target has changed. This only happens between targetCreated and targetDestroyed.", - "parameters": [ - { - "name": "targetInfo", - "$ref": "TargetInfo" - } - ] - }, - { - "name": "targetDestroyed", - "description": "Issued when a target is destroyed.", - "parameters": [ - { - "name": "targetId", - "$ref": "TargetID" - } - ] - }, - { - "name": "attachedToTarget", - "description": "Issued when attached to target because of auto-attach or attachToTarget command.", - "parameters": [ - { - "name": "sessionId", - "$ref": "SessionID", - "description": "Identifier assigned to the session used to send/receive messages." - }, - { - "name": "targetInfo", - "$ref": "TargetInfo" - }, - { - "name": "waitingForDebugger", - "type": "boolean" - } - ], - "experimental": true - }, - { - "name": "detachedFromTarget", - "description": "Issued when detached from target for any reason (including detachFromTarget command). Can be issued multiple times per target if multiple sessions have been attached to it.", - "parameters": [ - { - "name": "sessionId", - "$ref": "SessionID", - "description": "Detached session identifier." - }, - { - "name": "targetId", - "$ref": "TargetID", - "optional": true, - "deprecated": true, - "description": "Deprecated." - } - ], - "experimental": true - }, - { - "name": "receivedMessageFromTarget", - "description": "Notifies about a new protocol message received from the session (as reported in attachedToTarget event).", - "parameters": [ - { - "name": "sessionId", - "$ref": "SessionID", - "description": "Identifier of a session which sends a message." - }, - { - "name": "message", - "type": "string" - }, - { - "name": "targetId", - "$ref": "TargetID", - "optional": true, - "deprecated": true, - "description": "Deprecated." - } - ] - } - ] - }, - { - "domain": "HeadlessExperimental", - "experimental": true, - "description": "This domain provides experimental commands only supported in headless mode.", - "dependencies": [ - "Page", - "Runtime" - ], - "types": [ - { - "id": "ScreenshotParams", - "type": "object", - "properties": [ - { - "name": "format", - "type": "string", - "optional": true, - "enum": [ - "jpeg", - "png" - ], - "description": "Image compression format (defaults to png)." - }, - { - "name": "quality", - "type": "integer", - "optional": true, - "description": "Compression quality from range [0..100] (jpeg only)." - } - ], - "description": "Encoding options for a screenshot." - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables headless events for the target." - }, - { - "name": "disable", - "description": "Disables headless events for the target." - }, - { - "name": "beginFrame", - "parameters": [ - { - "name": "frameTime", - "$ref": "Runtime.Timestamp", - "optional": true, - "description": "Timestamp of this BeginFrame (milliseconds since epoch). If not set, the current time will be used." - }, - { - "name": "deadline", - "$ref": "Runtime.Timestamp", - "optional": true, - "description": "Deadline of this BeginFrame (milliseconds since epoch). If not set, the deadline will be calculated from the frameTime and interval." - }, - { - "name": "interval", - "type": "number", - "optional": true, - "description": "The interval between BeginFrames that is reported to the compositor, in milliseconds. Defaults to a 60 frames/second interval, i.e. about 16.666 milliseconds." - }, - { - "name": "screenshot", - "$ref": "ScreenshotParams", - "optional": true, - "description": "If set, a screenshot of the frame will be captured and returned in the response. Otherwise, no screenshot will be captured." - } - ], - "returns": [ - { - "name": "hasDamage", - "type": "boolean", - "description": "Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the display." - }, - { - "name": "mainFrameContentUpdated", - "type": "boolean", - "description": "Whether the main frame submitted a new display frame in response to this BeginFrame." - }, - { - "name": "screenshotData", - "type": "string", - "optional": true, - "description": "Base64-encoded image data of the screenshot, if one was requested and successfully taken." - } - ], - "description": "Sends a BeginFrame to 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." - } - ], - "events": [ - { - "name": "needsBeginFramesChanged", - "description": "Issued when the target starts or stops needing BeginFrames.", - "parameters": [ - { - "name": "needsBeginFrames", - "type": "boolean", - "description": "True if BeginFrames are needed, false otherwise." - } - ] - }, - { - "name": "mainFrameReadyForScreenshots", - "description": "Issued when the main frame has first submitted a frame to the browser. May only be fired while a BeginFrame is in flight. Before this event, screenshotting requests may fail." } ] }, @@ -9234,8 +10811,8 @@ "types": [ { "id": "ServiceWorkerRegistration", - "type": "object", "description": "ServiceWorker registration.", + "type": "object", "properties": [ { "name": "registrationId", @@ -9275,8 +10852,8 @@ }, { "id": "ServiceWorkerVersion", - "type": "object", "description": "ServiceWorker version.", + "type": "object", "properties": [ { "name": "versionId", @@ -9300,35 +10877,35 @@ }, { "name": "scriptLastModified", - "type": "number", + "description": "The Last-Modified header value of the main script.", "optional": true, - "description": "The Last-Modified header value of the main script." + "type": "number" }, { "name": "scriptResponseTime", - "type": "number", + "description": "The time at which the response headers of the main script were received from the server.\nFor cached script it is the last time the cache entry was validated.", "optional": true, - "description": "The time at which the response headers of the main script were received from the server. For cached script it is the last time the cache entry was validated." + "type": "number" }, { "name": "controlledClients", - "type": "array", "optional": true, + "type": "array", "items": { "$ref": "Target.TargetID" } }, { "name": "targetId", - "$ref": "Target.TargetID", - "optional": true + "optional": true, + "$ref": "Target.TargetID" } ] }, { "id": "ServiceWorkerErrorMessage", - "type": "object", "description": "ServiceWorker error message.", + "type": "object", "properties": [ { "name": "errorMessage", @@ -9358,78 +10935,6 @@ } ], "commands": [ - { - "name": "enable" - }, - { - "name": "disable" - }, - { - "name": "unregister", - "parameters": [ - { - "name": "scopeURL", - "type": "string" - } - ] - }, - { - "name": "updateRegistration", - "parameters": [ - { - "name": "scopeURL", - "type": "string" - } - ] - }, - { - "name": "startWorker", - "parameters": [ - { - "name": "scopeURL", - "type": "string" - } - ] - }, - { - "name": "skipWaiting", - "parameters": [ - { - "name": "scopeURL", - "type": "string" - } - ] - }, - { - "name": "stopWorker", - "parameters": [ - { - "name": "versionId", - "type": "string" - } - ] - }, - { - "name": "stopAllWorkers" - }, - { - "name": "inspectWorker", - "parameters": [ - { - "name": "versionId", - "type": "string" - } - ] - }, - { - "name": "setForceUpdateOnPageLoad", - "parameters": [ - { - "name": "forceUpdateOnPageLoad", - "type": "boolean" - } - ] - }, { "name": "deliverPushMessage", "parameters": [ @@ -9447,6 +10952,9 @@ } ] }, + { + "name": "disable" + }, { "name": "dispatchSyncEvent", "parameters": [ @@ -9467,9 +10975,87 @@ "type": "boolean" } ] + }, + { + "name": "enable" + }, + { + "name": "inspectWorker", + "parameters": [ + { + "name": "versionId", + "type": "string" + } + ] + }, + { + "name": "setForceUpdateOnPageLoad", + "parameters": [ + { + "name": "forceUpdateOnPageLoad", + "type": "boolean" + } + ] + }, + { + "name": "skipWaiting", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] + }, + { + "name": "startWorker", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] + }, + { + "name": "stopAllWorkers" + }, + { + "name": "stopWorker", + "parameters": [ + { + "name": "versionId", + "type": "string" + } + ] + }, + { + "name": "unregister", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] + }, + { + "name": "updateRegistration", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] } ], "events": [ + { + "name": "workerErrorReported", + "parameters": [ + { + "name": "errorMessage", + "$ref": "ServiceWorkerErrorMessage" + } + ] + }, { "name": "workerRegistrationUpdated", "parameters": [ @@ -9493,1870 +11079,6 @@ } } ] - }, - { - "name": "workerErrorReported", - "parameters": [ - { - "name": "errorMessage", - "$ref": "ServiceWorkerErrorMessage" - } - ] - } - ] - }, - { - "domain": "Input", - "types": [ - { - "id": "TouchPoint", - "type": "object", - "properties": [ - { - "name": "x", - "type": "number", - "description": "X coordinate of the event relative to the main frame's viewport in CSS pixels." - }, - { - "name": "y", - "type": "number", - "description": "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport." - }, - { - "name": "radiusX", - "type": "number", - "optional": true, - "description": "X radius of the touch area (default: 1.0)." - }, - { - "name": "radiusY", - "type": "number", - "optional": true, - "description": "Y radius of the touch area (default: 1.0)." - }, - { - "name": "rotationAngle", - "type": "number", - "optional": true, - "description": "Rotation angle (default: 0.0)." - }, - { - "name": "force", - "type": "number", - "optional": true, - "description": "Force (default: 1.0)." - }, - { - "name": "id", - "type": "number", - "optional": true, - "description": "Identifier used to track touch sources between events, must be unique within an event." - } - ] - }, - { - "id": "GestureSourceType", - "type": "string", - "experimental": true, - "enum": [ - "default", - "touch", - "mouse" - ] - }, - { - "id": "TimeSinceEpoch", - "type": "number", - "description": "UTC time in seconds, counted from January 1, 1970." - } - ], - "commands": [ - { - "name": "setIgnoreInputEvents", - "parameters": [ - { - "name": "ignore", - "type": "boolean", - "description": "Ignores input events processing when set to true." - } - ], - "description": "Ignores input events (useful while auditing page)." - }, - { - "name": "dispatchKeyEvent", - "parameters": [ - { - "name": "type", - "type": "string", - "enum": [ - "keyDown", - "keyUp", - "rawKeyDown", - "char" - ], - "description": "Type of the key event." - }, - { - "name": "modifiers", - "type": "integer", - "optional": true, - "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." - }, - { - "name": "timestamp", - "$ref": "TimeSinceEpoch", - "optional": true, - "description": "Time at which the event occurred." - }, - { - "name": "text", - "type": "string", - "optional": true, - "description": "Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: \"\")" - }, - { - "name": "unmodifiedText", - "type": "string", - "optional": true, - "description": "Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: \"\")." - }, - { - "name": "keyIdentifier", - "type": "string", - "optional": true, - "description": "Unique key identifier (e.g., 'U+0041') (default: \"\")." - }, - { - "name": "code", - "type": "string", - "optional": true, - "description": "Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: \"\")." - }, - { - "name": "key", - "type": "string", - "optional": true, - "description": "Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: \"\")." - }, - { - "name": "windowsVirtualKeyCode", - "type": "integer", - "optional": true, - "description": "Windows virtual key code (default: 0)." - }, - { - "name": "nativeVirtualKeyCode", - "type": "integer", - "optional": true, - "description": "Native virtual key code (default: 0)." - }, - { - "name": "autoRepeat", - "type": "boolean", - "optional": true, - "description": "Whether the event was generated from auto repeat (default: false)." - }, - { - "name": "isKeypad", - "type": "boolean", - "optional": true, - "description": "Whether the event was generated from the keypad (default: false)." - }, - { - "name": "isSystemKey", - "type": "boolean", - "optional": true, - "description": "Whether the event was a system key event (default: false)." - }, - { - "name": "location", - "type": "integer", - "optional": true, - "description": "Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0)." - } - ], - "description": "Dispatches a key event to the page." - }, - { - "name": "dispatchMouseEvent", - "parameters": [ - { - "name": "type", - "type": "string", - "enum": [ - "mousePressed", - "mouseReleased", - "mouseMoved", - "mouseWheel" - ], - "description": "Type of the mouse event." - }, - { - "name": "x", - "type": "number", - "description": "X coordinate of the event relative to the main frame's viewport in CSS pixels." - }, - { - "name": "y", - "type": "number", - "description": "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport." - }, - { - "name": "modifiers", - "type": "integer", - "optional": true, - "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." - }, - { - "name": "timestamp", - "$ref": "TimeSinceEpoch", - "optional": true, - "description": "Time at which the event occurred." - }, - { - "name": "button", - "type": "string", - "enum": [ - "none", - "left", - "middle", - "right" - ], - "optional": true, - "description": "Mouse button (default: \"none\")." - }, - { - "name": "clickCount", - "type": "integer", - "optional": true, - "description": "Number of times the mouse button was clicked (default: 0)." - }, - { - "name": "deltaX", - "type": "number", - "optional": true, - "description": "X delta in CSS pixels for mouse wheel event (default: 0)." - }, - { - "name": "deltaY", - "type": "number", - "optional": true, - "description": "Y delta in CSS pixels for mouse wheel event (default: 0)." - } - ], - "description": "Dispatches a mouse event to the page." - }, - { - "name": "dispatchTouchEvent", - "parameters": [ - { - "name": "type", - "type": "string", - "enum": [ - "touchStart", - "touchEnd", - "touchMove", - "touchCancel" - ], - "description": "Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one." - }, - { - "name": "touchPoints", - "type": "array", - "items": { - "$ref": "TouchPoint" - }, - "description": "Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one." - }, - { - "name": "modifiers", - "type": "integer", - "optional": true, - "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." - }, - { - "name": "timestamp", - "$ref": "TimeSinceEpoch", - "optional": true, - "description": "Time at which the event occurred." - } - ], - "description": "Dispatches a touch event to the page." - }, - { - "name": "emulateTouchFromMouseEvent", - "experimental": true, - "parameters": [ - { - "name": "type", - "type": "string", - "enum": [ - "mousePressed", - "mouseReleased", - "mouseMoved", - "mouseWheel" - ], - "description": "Type of the mouse event." - }, - { - "name": "x", - "type": "integer", - "description": "X coordinate of the mouse pointer in DIP." - }, - { - "name": "y", - "type": "integer", - "description": "Y coordinate of the mouse pointer in DIP." - }, - { - "name": "timestamp", - "$ref": "TimeSinceEpoch", - "description": "Time at which the event occurred." - }, - { - "name": "button", - "type": "string", - "enum": [ - "none", - "left", - "middle", - "right" - ], - "description": "Mouse button." - }, - { - "name": "deltaX", - "type": "number", - "optional": true, - "description": "X delta in DIP for mouse wheel event (default: 0)." - }, - { - "name": "deltaY", - "type": "number", - "optional": true, - "description": "Y delta in DIP for mouse wheel event (default: 0)." - }, - { - "name": "modifiers", - "type": "integer", - "optional": true, - "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." - }, - { - "name": "clickCount", - "type": "integer", - "optional": true, - "description": "Number of times the mouse button was clicked (default: 0)." - } - ], - "description": "Emulates touch event from the mouse event parameters." - }, - { - "name": "synthesizePinchGesture", - "parameters": [ - { - "name": "x", - "type": "number", - "description": "X coordinate of the start of the gesture in CSS pixels." - }, - { - "name": "y", - "type": "number", - "description": "Y coordinate of the start of the gesture in CSS pixels." - }, - { - "name": "scaleFactor", - "type": "number", - "description": "Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out)." - }, - { - "name": "relativeSpeed", - "type": "integer", - "optional": true, - "description": "Relative pointer speed in pixels per second (default: 800)." - }, - { - "name": "gestureSourceType", - "$ref": "GestureSourceType", - "optional": true, - "description": "Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type)." - } - ], - "description": "Synthesizes a pinch gesture over a time period by issuing appropriate touch events.", - "experimental": true - }, - { - "name": "synthesizeScrollGesture", - "parameters": [ - { - "name": "x", - "type": "number", - "description": "X coordinate of the start of the gesture in CSS pixels." - }, - { - "name": "y", - "type": "number", - "description": "Y coordinate of the start of the gesture in CSS pixels." - }, - { - "name": "xDistance", - "type": "number", - "optional": true, - "description": "The distance to scroll along the X axis (positive to scroll left)." - }, - { - "name": "yDistance", - "type": "number", - "optional": true, - "description": "The distance to scroll along the Y axis (positive to scroll up)." - }, - { - "name": "xOverscroll", - "type": "number", - "optional": true, - "description": "The number of additional pixels to scroll back along the X axis, in addition to the given distance." - }, - { - "name": "yOverscroll", - "type": "number", - "optional": true, - "description": "The number of additional pixels to scroll back along the Y axis, in addition to the given distance." - }, - { - "name": "preventFling", - "type": "boolean", - "optional": true, - "description": "Prevent fling (default: true)." - }, - { - "name": "speed", - "type": "integer", - "optional": true, - "description": "Swipe speed in pixels per second (default: 800)." - }, - { - "name": "gestureSourceType", - "$ref": "GestureSourceType", - "optional": true, - "description": "Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type)." - }, - { - "name": "repeatCount", - "type": "integer", - "optional": true, - "description": "The number of times to repeat the gesture (default: 0)." - }, - { - "name": "repeatDelayMs", - "type": "integer", - "optional": true, - "description": "The number of milliseconds delay between each repeat. (default: 250)." - }, - { - "name": "interactionMarkerName", - "type": "string", - "optional": true, - "description": "The name of the interaction markers to generate, if not empty (default: \"\")." - } - ], - "description": "Synthesizes a scroll gesture over a time period by issuing appropriate touch events.", - "experimental": true - }, - { - "name": "synthesizeTapGesture", - "parameters": [ - { - "name": "x", - "type": "number", - "description": "X coordinate of the start of the gesture in CSS pixels." - }, - { - "name": "y", - "type": "number", - "description": "Y coordinate of the start of the gesture in CSS pixels." - }, - { - "name": "duration", - "type": "integer", - "optional": true, - "description": "Duration between touchdown and touchup events in ms (default: 50)." - }, - { - "name": "tapCount", - "type": "integer", - "optional": true, - "description": "Number of times to perform the tap (e.g. 2 for double tap, default: 1)." - }, - { - "name": "gestureSourceType", - "$ref": "GestureSourceType", - "optional": true, - "description": "Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type)." - } - ], - "description": "Synthesizes a tap gesture over a time period by issuing appropriate touch events.", - "experimental": true - } - ], - "events": [] - }, - { - "domain": "LayerTree", - "experimental": true, - "dependencies": [ - "DOM" - ], - "types": [ - { - "id": "LayerId", - "type": "string", - "description": "Unique Layer identifier." - }, - { - "id": "SnapshotId", - "type": "string", - "description": "Unique snapshot identifier." - }, - { - "id": "ScrollRect", - "type": "object", - "description": "Rectangle where scrolling happens on the main thread.", - "properties": [ - { - "name": "rect", - "$ref": "DOM.Rect", - "description": "Rectangle itself." - }, - { - "name": "type", - "type": "string", - "enum": [ - "RepaintsOnScroll", - "TouchEventHandler", - "WheelEventHandler" - ], - "description": "Reason for rectangle to force scrolling on the main thread" - } - ] - }, - { - "id": "StickyPositionConstraint", - "type": "object", - "description": "Sticky position constraints.", - "properties": [ - { - "name": "stickyBoxRect", - "$ref": "DOM.Rect", - "description": "Layout rectangle of the sticky element before being shifted" - }, - { - "name": "containingBlockRect", - "$ref": "DOM.Rect", - "description": "Layout rectangle of the containing block of the sticky element" - }, - { - "name": "nearestLayerShiftingStickyBox", - "$ref": "LayerId", - "optional": true, - "description": "The nearest sticky layer that shifts the sticky box" - }, - { - "name": "nearestLayerShiftingContainingBlock", - "$ref": "LayerId", - "optional": true, - "description": "The nearest sticky layer that shifts the containing block" - } - ] - }, - { - "id": "PictureTile", - "type": "object", - "description": "Serialized fragment of layer picture along with its offset within the layer.", - "properties": [ - { - "name": "x", - "type": "number", - "description": "Offset from owning layer left boundary" - }, - { - "name": "y", - "type": "number", - "description": "Offset from owning layer top boundary" - }, - { - "name": "picture", - "type": "string", - "description": "Base64-encoded snapshot data." - } - ] - }, - { - "id": "Layer", - "type": "object", - "description": "Information about a compositing layer.", - "properties": [ - { - "name": "layerId", - "$ref": "LayerId", - "description": "The unique id for this layer." - }, - { - "name": "parentLayerId", - "$ref": "LayerId", - "optional": true, - "description": "The id of parent (not present for root)." - }, - { - "name": "backendNodeId", - "$ref": "DOM.BackendNodeId", - "optional": true, - "description": "The backend id for the node associated with this layer." - }, - { - "name": "offsetX", - "type": "number", - "description": "Offset from parent layer, X coordinate." - }, - { - "name": "offsetY", - "type": "number", - "description": "Offset from parent layer, Y coordinate." - }, - { - "name": "width", - "type": "number", - "description": "Layer width." - }, - { - "name": "height", - "type": "number", - "description": "Layer height." - }, - { - "name": "transform", - "type": "array", - "items": { - "type": "number" - }, - "minItems": 16, - "maxItems": 16, - "optional": true, - "description": "Transformation matrix for layer, default is identity matrix" - }, - { - "name": "anchorX", - "type": "number", - "optional": true, - "description": "Transform anchor point X, absent if no transform specified" - }, - { - "name": "anchorY", - "type": "number", - "optional": true, - "description": "Transform anchor point Y, absent if no transform specified" - }, - { - "name": "anchorZ", - "type": "number", - "optional": true, - "description": "Transform anchor point Z, absent if no transform specified" - }, - { - "name": "paintCount", - "type": "integer", - "description": "Indicates how many time this layer has painted." - }, - { - "name": "drawsContent", - "type": "boolean", - "description": "Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only." - }, - { - "name": "invisible", - "type": "boolean", - "optional": true, - "description": "Set if layer is not visible." - }, - { - "name": "scrollRects", - "type": "array", - "items": { - "$ref": "ScrollRect" - }, - "optional": true, - "description": "Rectangles scrolling on main thread only." - }, - { - "name": "stickyPositionConstraint", - "$ref": "StickyPositionConstraint", - "optional": true, - "description": "Sticky position constraint information" - } - ] - }, - { - "id": "PaintProfile", - "type": "array", - "description": "Array of timings, one per paint step.", - "items": { - "type": "number", - "description": "A time in seconds since the end of previous step (for the first step, time since painting started)" - } - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables compositing tree inspection." - }, - { - "name": "disable", - "description": "Disables compositing tree inspection." - }, - { - "name": "compositingReasons", - "parameters": [ - { - "name": "layerId", - "$ref": "LayerId", - "description": "The id of the layer for which we want to get the reasons it was composited." - } - ], - "description": "Provides the reasons why the given layer was composited.", - "returns": [ - { - "name": "compositingReasons", - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of strings specifying reasons for the given layer to become composited." - } - ] - }, - { - "name": "makeSnapshot", - "parameters": [ - { - "name": "layerId", - "$ref": "LayerId", - "description": "The id of the layer." - } - ], - "description": "Returns the layer snapshot identifier.", - "returns": [ - { - "name": "snapshotId", - "$ref": "SnapshotId", - "description": "The id of the layer snapshot." - } - ] - }, - { - "name": "loadSnapshot", - "parameters": [ - { - "name": "tiles", - "type": "array", - "items": { - "$ref": "PictureTile" - }, - "minItems": 1, - "description": "An array of tiles composing the snapshot." - } - ], - "description": "Returns the snapshot identifier.", - "returns": [ - { - "name": "snapshotId", - "$ref": "SnapshotId", - "description": "The id of the snapshot." - } - ] - }, - { - "name": "releaseSnapshot", - "parameters": [ - { - "name": "snapshotId", - "$ref": "SnapshotId", - "description": "The id of the layer snapshot." - } - ], - "description": "Releases layer snapshot captured by the back-end." - }, - { - "name": "profileSnapshot", - "parameters": [ - { - "name": "snapshotId", - "$ref": "SnapshotId", - "description": "The id of the layer snapshot." - }, - { - "name": "minRepeatCount", - "type": "integer", - "optional": true, - "description": "The maximum number of times to replay the snapshot (1, if not specified)." - }, - { - "name": "minDuration", - "type": "number", - "optional": true, - "description": "The minimum duration (in seconds) to replay the snapshot." - }, - { - "name": "clipRect", - "$ref": "DOM.Rect", - "optional": true, - "description": "The clip rectangle to apply when replaying the snapshot." - } - ], - "returns": [ - { - "name": "timings", - "type": "array", - "items": { - "$ref": "PaintProfile" - }, - "description": "The array of paint profiles, one per run." - } - ] - }, - { - "name": "replaySnapshot", - "parameters": [ - { - "name": "snapshotId", - "$ref": "SnapshotId", - "description": "The id of the layer snapshot." - }, - { - "name": "fromStep", - "type": "integer", - "optional": true, - "description": "The first step to replay from (replay from the very start if not specified)." - }, - { - "name": "toStep", - "type": "integer", - "optional": true, - "description": "The last step to replay to (replay till the end if not specified)." - }, - { - "name": "scale", - "type": "number", - "optional": true, - "description": "The scale to apply while replaying (defaults to 1)." - } - ], - "description": "Replays the layer snapshot and returns the resulting bitmap.", - "returns": [ - { - "name": "dataURL", - "type": "string", - "description": "A data: URL for resulting image." - } - ] - }, - { - "name": "snapshotCommandLog", - "parameters": [ - { - "name": "snapshotId", - "$ref": "SnapshotId", - "description": "The id of the layer snapshot." - } - ], - "description": "Replays the layer snapshot and returns canvas log.", - "returns": [ - { - "name": "commandLog", - "type": "array", - "items": { - "type": "object" - }, - "description": "The array of canvas function calls." - } - ] - } - ], - "events": [ - { - "name": "layerTreeDidChange", - "parameters": [ - { - "name": "layers", - "type": "array", - "items": { - "$ref": "Layer" - }, - "optional": true, - "description": "Layer tree, absent if not in the comspositing mode." - } - ] - }, - { - "name": "layerPainted", - "parameters": [ - { - "name": "layerId", - "$ref": "LayerId", - "description": "The id of the painted layer." - }, - { - "name": "clip", - "$ref": "DOM.Rect", - "description": "Clip rectangle." - } - ] - } - ] - }, - { - "domain": "DeviceOrientation", - "experimental": true, - "commands": [ - { - "name": "setDeviceOrientationOverride", - "description": "Overrides the Device Orientation.", - "parameters": [ - { - "name": "alpha", - "type": "number", - "description": "Mock alpha" - }, - { - "name": "beta", - "type": "number", - "description": "Mock beta" - }, - { - "name": "gamma", - "type": "number", - "description": "Mock gamma" - } - ] - }, - { - "name": "clearDeviceOrientationOverride", - "description": "Clears the overridden Device Orientation." - } - ] - }, - { - "domain": "Tracing", - "dependencies": [ - "IO" - ], - "experimental": true, - "types": [ - { - "id": "MemoryDumpConfig", - "type": "object", - "description": "Configuration for memory dump. Used only when \"memory-infra\" category is enabled." - }, - { - "id": "TraceConfig", - "type": "object", - "properties": [ - { - "name": "recordMode", - "type": "string", - "optional": true, - "enum": [ - "recordUntilFull", - "recordContinuously", - "recordAsMuchAsPossible", - "echoToConsole" - ], - "description": "Controls how the trace buffer stores data." - }, - { - "name": "enableSampling", - "type": "boolean", - "optional": true, - "description": "Turns on JavaScript stack sampling." - }, - { - "name": "enableSystrace", - "type": "boolean", - "optional": true, - "description": "Turns on system tracing." - }, - { - "name": "enableArgumentFilter", - "type": "boolean", - "optional": true, - "description": "Turns on argument filter." - }, - { - "name": "includedCategories", - "type": "array", - "items": { - "type": "string" - }, - "optional": true, - "description": "Included category filters." - }, - { - "name": "excludedCategories", - "type": "array", - "items": { - "type": "string" - }, - "optional": true, - "description": "Excluded category filters." - }, - { - "name": "syntheticDelays", - "type": "array", - "items": { - "type": "string" - }, - "optional": true, - "description": "Configuration to synthesize the delays in tracing." - }, - { - "name": "memoryDumpConfig", - "$ref": "MemoryDumpConfig", - "optional": true, - "description": "Configuration for memory dump triggers. Used only when \"memory-infra\" category is enabled." - } - ] - } - ], - "commands": [ - { - "name": "start", - "description": "Start trace events collection.", - "parameters": [ - { - "name": "categories", - "type": "string", - "optional": true, - "deprecated": true, - "description": "Category/tag filter" - }, - { - "name": "options", - "type": "string", - "optional": true, - "deprecated": true, - "description": "Tracing options" - }, - { - "name": "bufferUsageReportingInterval", - "type": "number", - "optional": true, - "description": "If set, the agent will issue bufferUsage events at this interval, specified in milliseconds" - }, - { - "name": "transferMode", - "type": "string", - "enum": [ - "ReportEvents", - "ReturnAsStream" - ], - "optional": true, - "description": "Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents)." - }, - { - "name": "traceConfig", - "$ref": "TraceConfig", - "optional": true, - "description": "" - } - ] - }, - { - "name": "end", - "description": "Stop trace events collection." - }, - { - "name": "getCategories", - "description": "Gets supported tracing categories.", - "returns": [ - { - "name": "categories", - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of supported tracing categories." - } - ] - }, - { - "name": "requestMemoryDump", - "description": "Request a global memory dump.", - "returns": [ - { - "name": "dumpGuid", - "type": "string", - "description": "GUID of the resulting global memory dump." - }, - { - "name": "success", - "type": "boolean", - "description": "True iff the global memory dump succeeded." - } - ] - }, - { - "name": "recordClockSyncMarker", - "description": "Record a clock sync marker in the trace.", - "parameters": [ - { - "name": "syncId", - "type": "string", - "description": "The ID of this clock sync marker" - } - ] - } - ], - "events": [ - { - "name": "dataCollected", - "parameters": [ - { - "name": "value", - "type": "array", - "items": { - "type": "object" - } - } - ], - "description": "Contains an bucket of collected trace events. When tracing is stopped collected events will be send as a sequence of dataCollected events followed by tracingComplete event." - }, - { - "name": "tracingComplete", - "description": "Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.", - "parameters": [ - { - "name": "stream", - "$ref": "IO.StreamHandle", - "optional": true, - "description": "A handle of the stream that holds resulting trace data." - } - ] - }, - { - "name": "bufferUsage", - "parameters": [ - { - "name": "percentFull", - "type": "number", - "optional": true, - "description": "A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size." - }, - { - "name": "eventCount", - "type": "number", - "optional": true, - "description": "An approximate number of events in the trace log." - }, - { - "name": "value", - "type": "number", - "optional": true, - "description": "A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size." - } - ] - } - ] - }, - { - "domain": "Animation", - "experimental": true, - "dependencies": [ - "Runtime", - "DOM" - ], - "types": [ - { - "id": "Animation", - "type": "object", - "properties": [ - { - "name": "id", - "type": "string", - "description": "Animation's id." - }, - { - "name": "name", - "type": "string", - "description": "Animation's name." - }, - { - "name": "pausedState", - "type": "boolean", - "description": "Animation's internal paused state." - }, - { - "name": "playState", - "type": "string", - "description": "Animation's play state." - }, - { - "name": "playbackRate", - "type": "number", - "description": "Animation's playback rate." - }, - { - "name": "startTime", - "type": "number", - "description": "Animation's start time." - }, - { - "name": "currentTime", - "type": "number", - "description": "Animation's current time." - }, - { - "name": "type", - "type": "string", - "enum": [ - "CSSTransition", - "CSSAnimation", - "WebAnimation" - ], - "description": "Animation type of Animation." - }, - { - "name": "source", - "$ref": "AnimationEffect", - "optional": true, - "description": "Animation's source animation node." - }, - { - "name": "cssId", - "type": "string", - "optional": true, - "description": "A unique ID for Animation representing the sources that triggered this CSS animation/transition." - } - ], - "description": "Animation instance." - }, - { - "id": "AnimationEffect", - "type": "object", - "properties": [ - { - "name": "delay", - "type": "number", - "description": "AnimationEffect's delay." - }, - { - "name": "endDelay", - "type": "number", - "description": "AnimationEffect's end delay." - }, - { - "name": "iterationStart", - "type": "number", - "description": "AnimationEffect's iteration start." - }, - { - "name": "iterations", - "type": "number", - "description": "AnimationEffect's iterations." - }, - { - "name": "duration", - "type": "number", - "description": "AnimationEffect's iteration duration." - }, - { - "name": "direction", - "type": "string", - "description": "AnimationEffect's playback direction." - }, - { - "name": "fill", - "type": "string", - "description": "AnimationEffect's fill mode." - }, - { - "name": "backendNodeId", - "$ref": "DOM.BackendNodeId", - "optional": true, - "description": "AnimationEffect's target node." - }, - { - "name": "keyframesRule", - "$ref": "KeyframesRule", - "optional": true, - "description": "AnimationEffect's keyframes." - }, - { - "name": "easing", - "type": "string", - "description": "AnimationEffect's timing function." - } - ], - "description": "AnimationEffect instance" - }, - { - "id": "KeyframesRule", - "type": "object", - "properties": [ - { - "name": "name", - "type": "string", - "optional": true, - "description": "CSS keyframed animation's name." - }, - { - "name": "keyframes", - "type": "array", - "items": { - "$ref": "KeyframeStyle" - }, - "description": "List of animation keyframes." - } - ], - "description": "Keyframes Rule" - }, - { - "id": "KeyframeStyle", - "type": "object", - "properties": [ - { - "name": "offset", - "type": "string", - "description": "Keyframe's time offset." - }, - { - "name": "easing", - "type": "string", - "description": "AnimationEffect's timing function." - } - ], - "description": "Keyframe Style" - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables animation domain notifications." - }, - { - "name": "disable", - "description": "Disables animation domain notifications." - }, - { - "name": "getPlaybackRate", - "returns": [ - { - "name": "playbackRate", - "type": "number", - "description": "Playback rate for animations on page." - } - ], - "description": "Gets the playback rate of the document timeline." - }, - { - "name": "setPlaybackRate", - "parameters": [ - { - "name": "playbackRate", - "type": "number", - "description": "Playback rate for animations on page" - } - ], - "description": "Sets the playback rate of the document timeline." - }, - { - "name": "getCurrentTime", - "parameters": [ - { - "name": "id", - "type": "string", - "description": "Id of animation." - } - ], - "returns": [ - { - "name": "currentTime", - "type": "number", - "description": "Current time of the page." - } - ], - "description": "Returns the current time of the an animation." - }, - { - "name": "setPaused", - "parameters": [ - { - "name": "animations", - "type": "array", - "items": { - "type": "string" - }, - "description": "Animations to set the pause state of." - }, - { - "name": "paused", - "type": "boolean", - "description": "Paused state to set to." - } - ], - "description": "Sets the paused state of a set of animations." - }, - { - "name": "setTiming", - "parameters": [ - { - "name": "animationId", - "type": "string", - "description": "Animation id." - }, - { - "name": "duration", - "type": "number", - "description": "Duration of the animation." - }, - { - "name": "delay", - "type": "number", - "description": "Delay of the animation." - } - ], - "description": "Sets the timing of an animation node." - }, - { - "name": "seekAnimations", - "parameters": [ - { - "name": "animations", - "type": "array", - "items": { - "type": "string" - }, - "description": "List of animation ids to seek." - }, - { - "name": "currentTime", - "type": "number", - "description": "Set the current time of each animation." - } - ], - "description": "Seek a set of animations to a particular time within each animation." - }, - { - "name": "releaseAnimations", - "parameters": [ - { - "name": "animations", - "type": "array", - "items": { - "type": "string" - }, - "description": "List of animation ids to seek." - } - ], - "description": "Releases a set of animations to no longer be manipulated." - }, - { - "name": "resolveAnimation", - "parameters": [ - { - "name": "animationId", - "type": "string", - "description": "Animation id." - } - ], - "returns": [ - { - "name": "remoteObject", - "$ref": "Runtime.RemoteObject", - "description": "Corresponding remote object." - } - ], - "description": "Gets the remote object of the Animation." - } - ], - "events": [ - { - "name": "animationCreated", - "parameters": [ - { - "name": "id", - "type": "string", - "description": "Id of the animation that was created." - } - ], - "description": "Event for each animation that has been created." - }, - { - "name": "animationStarted", - "parameters": [ - { - "name": "animation", - "$ref": "Animation", - "description": "Animation that was started." - } - ], - "description": "Event for animation that has been started." - }, - { - "name": "animationCanceled", - "parameters": [ - { - "name": "id", - "type": "string", - "description": "Id of the animation that was cancelled." - } - ], - "description": "Event for when an animation has been cancelled." - } - ] - }, - { - "domain": "Accessibility", - "experimental": true, - "dependencies": [ - "DOM" - ], - "types": [ - { - "id": "AXNodeId", - "type": "string", - "description": "Unique accessibility node identifier." - }, - { - "id": "AXValueType", - "type": "string", - "enum": [ - "boolean", - "tristate", - "booleanOrUndefined", - "idref", - "idrefList", - "integer", - "node", - "nodeList", - "number", - "string", - "computedString", - "token", - "tokenList", - "domRelation", - "role", - "internalRole", - "valueUndefined" - ], - "description": "Enum of possible property types." - }, - { - "id": "AXValueSourceType", - "type": "string", - "enum": [ - "attribute", - "implicit", - "style", - "contents", - "placeholder", - "relatedElement" - ], - "description": "Enum of possible property sources." - }, - { - "id": "AXValueNativeSourceType", - "type": "string", - "enum": [ - "figcaption", - "label", - "labelfor", - "labelwrapped", - "legend", - "tablecaption", - "title", - "other" - ], - "description": "Enum of possible native property sources (as a subtype of a particular AXValueSourceType)." - }, - { - "id": "AXValueSource", - "type": "object", - "properties": [ - { - "name": "type", - "$ref": "AXValueSourceType", - "description": "What type of source this is." - }, - { - "name": "value", - "$ref": "AXValue", - "description": "The value of this property source.", - "optional": true - }, - { - "name": "attribute", - "type": "string", - "description": "The name of the relevant attribute, if any.", - "optional": true - }, - { - "name": "attributeValue", - "$ref": "AXValue", - "description": "The value of the relevant attribute, if any.", - "optional": true - }, - { - "name": "superseded", - "type": "boolean", - "description": "Whether this source is superseded by a higher priority source.", - "optional": true - }, - { - "name": "nativeSource", - "$ref": "AXValueNativeSourceType", - "description": "The native markup source for this value, e.g. a element.", - "optional": true - }, - { - "name": "nativeSourceValue", - "$ref": "AXValue", - "description": "The value, such as a node or node list, of the native source.", - "optional": true - }, - { - "name": "invalid", - "type": "boolean", - "description": "Whether the value for this property is invalid.", - "optional": true - }, - { - "name": "invalidReason", - "type": "string", - "description": "Reason for the value being invalid, if it is.", - "optional": true - } - ], - "description": "A single source for a computed AX property." - }, - { - "id": "AXRelatedNode", - "type": "object", - "properties": [ - { - "name": "backendDOMNodeId", - "$ref": "DOM.BackendNodeId", - "description": "The BackendNodeId of the related DOM node." - }, - { - "name": "idref", - "type": "string", - "description": "The IDRef value provided, if any.", - "optional": true - }, - { - "name": "text", - "type": "string", - "description": "The text alternative of this node in the current context.", - "optional": true - } - ] - }, - { - "id": "AXProperty", - "type": "object", - "properties": [ - { - "name": "name", - "$ref": "AXPropertyName", - "description": "The name of this property." - }, - { - "name": "value", - "$ref": "AXValue", - "description": "The value of this property." - } - ] - }, - { - "id": "AXValue", - "type": "object", - "properties": [ - { - "name": "type", - "$ref": "AXValueType", - "description": "The type of this value." - }, - { - "name": "value", - "type": "any", - "description": "The computed value of this property.", - "optional": true - }, - { - "name": "relatedNodes", - "type": "array", - "items": { - "$ref": "AXRelatedNode" - }, - "description": "One or more related nodes, if applicable.", - "optional": true - }, - { - "name": "sources", - "type": "array", - "items": { - "$ref": "AXValueSource" - }, - "description": "The sources which contributed to the computation of this property.", - "optional": true - } - ], - "description": "A single computed AX property." - }, - { - "id": "AXPropertyName", - "type": "string", - "enum": [ - "busy", - "disabled", - "hidden", - "hiddenRoot", - "invalid", - "keyshortcuts", - "roledescription", - "live", - "atomic", - "relevant", - "root", - "autocomplete", - "haspopup", - "level", - "multiselectable", - "orientation", - "multiline", - "readonly", - "required", - "valuemin", - "valuemax", - "valuetext", - "checked", - "expanded", - "modal", - "pressed", - "selected", - "activedescendant", - "controls", - "describedby", - "details", - "errormessage", - "flowto", - "labelledby", - "owns" - ], - "description": "Values of AXProperty name: from 'busy' to 'roledescription' - states which apply to every AX node, from 'live' to 'root' - attributes which apply to nodes in live regions, from 'autocomplete' to 'valuetext' - attributes which apply to widgets, from 'checked' to 'selected' - states which apply to widgets, from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling." - }, - { - "id": "AXNode", - "type": "object", - "properties": [ - { - "name": "nodeId", - "$ref": "AXNodeId", - "description": "Unique identifier for this node." - }, - { - "name": "ignored", - "type": "boolean", - "description": "Whether this node is ignored for accessibility" - }, - { - "name": "ignoredReasons", - "type": "array", - "items": { - "$ref": "AXProperty" - }, - "description": "Collection of reasons why this node is hidden.", - "optional": true - }, - { - "name": "role", - "$ref": "AXValue", - "description": "This Node's role, whether explicit or implicit.", - "optional": true - }, - { - "name": "name", - "$ref": "AXValue", - "description": "The accessible name for this Node.", - "optional": true - }, - { - "name": "description", - "$ref": "AXValue", - "description": "The accessible description for this Node.", - "optional": true - }, - { - "name": "value", - "$ref": "AXValue", - "description": "The value for this Node.", - "optional": true - }, - { - "name": "properties", - "type": "array", - "items": { - "$ref": "AXProperty" - }, - "description": "All other properties", - "optional": true - }, - { - "name": "childIds", - "type": "array", - "items": { - "$ref": "AXNodeId" - }, - "description": "IDs for each of this node's child nodes.", - "optional": true - }, - { - "name": "backendDOMNodeId", - "$ref": "DOM.BackendNodeId", - "description": "The backend ID for the associated DOM node, if any.", - "optional": true - } - ], - "description": "A node in the accessibility tree." - } - ], - "commands": [ - { - "name": "getPartialAXTree", - "parameters": [ - { - "name": "nodeId", - "$ref": "DOM.NodeId", - "description": "ID of node to get the partial accessibility tree for." - }, - { - "name": "fetchRelatives", - "type": "boolean", - "description": "Whether to fetch this nodes ancestors, siblings and children. Defaults to true.", - "optional": true - } - ], - "returns": [ - { - "name": "nodes", - "type": "array", - "items": { - "$ref": "AXNode" - }, - "description": "The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested." - } - ], - "description": "Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.", - "experimental": true } ] }, @@ -11366,6 +11088,7 @@ "types": [ { "id": "StorageType", + "description": "Enum of possible storage types.", "type": "string", "enum": [ "appcache", @@ -11379,23 +11102,22 @@ "cache_storage", "all", "other" - ], - "description": "Enum of possible storage types." + ] }, { "id": "UsageForType", - "type": "object", "description": "Usage for a storage type.", + "type": "object", "properties": [ { "name": "storageType", - "$ref": "StorageType", - "description": "Name of storage type." + "description": "Name of storage type.", + "$ref": "StorageType" }, { "name": "usage", - "type": "number", - "description": "Storage usage (bytes)." + "description": "Storage usage (bytes).", + "type": "number" } ] } @@ -11403,324 +11125,156 @@ "commands": [ { "name": "clearDataForOrigin", + "description": "Clears storage for origin.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Security origin." + "description": "Security origin.", + "type": "string" }, { "name": "storageTypes", - "type": "string", - "description": "Comma separated origin names." + "description": "Comma separated origin names.", + "type": "string" } - ], - "description": "Clears storage for origin." + ] }, { "name": "getUsageAndQuota", + "description": "Returns usage and quota in bytes.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Security origin." + "description": "Security origin.", + "type": "string" } ], "returns": [ { "name": "usage", - "type": "number", - "description": "Storage usage (bytes)." + "description": "Storage usage (bytes).", + "type": "number" }, { "name": "quota", - "type": "number", - "description": "Storage quota (bytes)." + "description": "Storage quota (bytes).", + "type": "number" }, { "name": "usageBreakdown", + "description": "Storage usage per type (bytes).", "type": "array", "items": { "$ref": "UsageForType" - }, - "description": "Storage usage per type (bytes)." + } } - ], - "description": "Returns usage and quota in bytes." + ] }, { "name": "trackCacheStorageForOrigin", + "description": "Registers origin to be notified when an update occurs to its cache storage list.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Security origin." + "description": "Security origin.", + "type": "string" } - ], - "description": "Registers origin to be notified when an update occurs to its cache storage list." - }, - { - "name": "untrackCacheStorageForOrigin", - "parameters": [ - { - "name": "origin", - "type": "string", - "description": "Security origin." - } - ], - "description": "Unregisters origin from receiving notifications for cache storage." + ] }, { "name": "trackIndexedDBForOrigin", + "description": "Registers origin to be notified when an update occurs to its IndexedDB.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Security origin." + "description": "Security origin.", + "type": "string" } - ], - "description": "Registers origin to be notified when an update occurs to its IndexedDB." + ] + }, + { + "name": "untrackCacheStorageForOrigin", + "description": "Unregisters origin from receiving notifications for cache storage.", + "parameters": [ + { + "name": "origin", + "description": "Security origin.", + "type": "string" + } + ] }, { "name": "untrackIndexedDBForOrigin", + "description": "Unregisters origin from receiving notifications for IndexedDB.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Security origin." + "description": "Security origin.", + "type": "string" } - ], - "description": "Unregisters origin from receiving notifications for IndexedDB." + ] } ], "events": [ - { - "name": "cacheStorageListUpdated", - "parameters": [ - { - "name": "origin", - "type": "string", - "description": "Origin to update." - } - ], - "description": "A cache has been added/deleted." - }, { "name": "cacheStorageContentUpdated", + "description": "A cache's contents have been modified.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Origin to update." + "description": "Origin to update.", + "type": "string" }, { "name": "cacheName", - "type": "string", - "description": "Name of cache in origin." + "description": "Name of cache in origin.", + "type": "string" } - ], - "description": "A cache's contents have been modified." + ] }, { - "name": "indexedDBListUpdated", + "name": "cacheStorageListUpdated", + "description": "A cache has been added/deleted.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Origin to update." + "description": "Origin to update.", + "type": "string" } - ], - "description": "The origin's IndexedDB database list has been modified." + ] }, { "name": "indexedDBContentUpdated", + "description": "The origin's IndexedDB object store has been modified.", "parameters": [ { "name": "origin", - "type": "string", - "description": "Origin to update." + "description": "Origin to update.", + "type": "string" }, { "name": "databaseName", - "type": "string", - "description": "Database to update." + "description": "Database to update.", + "type": "string" }, { "name": "objectStoreName", - "type": "string", - "description": "ObjectStore to update." - } - ], - "description": "The origin's IndexedDB object store has been modified." - } - ] - }, - { - "domain": "Log", - "description": "Provides access to log entries.", - "dependencies": [ - "Runtime", - "Network" - ], - "types": [ - { - "id": "LogEntry", - "type": "object", - "description": "Log entry.", - "properties": [ - { - "name": "source", - "type": "string", - "enum": [ - "xml", - "javascript", - "network", - "storage", - "appcache", - "rendering", - "security", - "deprecation", - "worker", - "violation", - "intervention", - "recommendation", - "other" - ], - "description": "Log entry source." - }, - { - "name": "level", - "type": "string", - "enum": [ - "verbose", - "info", - "warning", - "error" - ], - "description": "Log entry severity." - }, - { - "name": "text", - "type": "string", - "description": "Logged text." - }, - { - "name": "timestamp", - "$ref": "Runtime.Timestamp", - "description": "Timestamp when this entry was added." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "URL of the resource if known." - }, - { - "name": "lineNumber", - "type": "integer", - "optional": true, - "description": "Line number in the resource." - }, - { - "name": "stackTrace", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "JavaScript stack trace." - }, - { - "name": "networkRequestId", - "$ref": "Network.RequestId", - "optional": true, - "description": "Identifier of the network request associated with this entry." - }, - { - "name": "workerId", - "type": "string", - "optional": true, - "description": "Identifier of the worker associated with this entry." - }, - { - "name": "args", - "type": "array", - "items": { - "$ref": "Runtime.RemoteObject" - }, - "optional": true, - "description": "Call arguments." + "description": "ObjectStore to update.", + "type": "string" } ] }, { - "id": "ViolationSetting", - "type": "object", - "description": "Violation configuration setting.", - "properties": [ + "name": "indexedDBListUpdated", + "description": "The origin's IndexedDB database list has been modified.", + "parameters": [ { - "name": "name", - "type": "string", - "enum": [ - "longTask", - "longLayout", - "blockedEvent", - "blockedParser", - "discouragedAPIUse", - "handler", - "recurringHandler" - ], - "description": "Violation type." - }, - { - "name": "threshold", - "type": "number", - "description": "Time threshold to trigger upon." + "name": "origin", + "description": "Origin to update.", + "type": "string" } ] } - ], - "commands": [ - { - "name": "enable", - "description": "Enables log domain, sends the entries collected so far to the client by means of the entryAdded notification." - }, - { - "name": "disable", - "description": "Disables log domain, prevents further log entries from being reported to the client." - }, - { - "name": "clear", - "description": "Clears the log." - }, - { - "name": "startViolationsReport", - "parameters": [ - { - "name": "config", - "type": "array", - "items": { - "$ref": "ViolationSetting" - }, - "description": "Configuration for violations." - } - ], - "description": "start violation reporting." - }, - { - "name": "stopViolationsReport", - "description": "Stop violation reporting." - } - ], - "events": [ - { - "name": "entryAdded", - "parameters": [ - { - "name": "entry", - "$ref": "LogEntry", - "description": "The entry." - } - ], - "description": "Issued when new message was logged." - } ] }, { @@ -11730,65 +11284,65 @@ "types": [ { "id": "GPUDevice", + "description": "Describes a single graphics processor (GPU).", "type": "object", "properties": [ { "name": "vendorId", - "type": "number", - "description": "PCI ID of the GPU vendor, if available; 0 otherwise." + "description": "PCI ID of the GPU vendor, if available; 0 otherwise.", + "type": "number" }, { "name": "deviceId", - "type": "number", - "description": "PCI ID of the GPU device, if available; 0 otherwise." + "description": "PCI ID of the GPU device, if available; 0 otherwise.", + "type": "number" }, { "name": "vendorString", - "type": "string", - "description": "String description of the GPU vendor, if the PCI ID is not available." + "description": "String description of the GPU vendor, if the PCI ID is not available.", + "type": "string" }, { "name": "deviceString", - "type": "string", - "description": "String description of the GPU device, if the PCI ID is not available." + "description": "String description of the GPU device, if the PCI ID is not available.", + "type": "string" } - ], - "description": "Describes a single graphics processor (GPU)." + ] }, { "id": "GPUInfo", + "description": "Provides information about the GPU(s) on the system.", "type": "object", "properties": [ { "name": "devices", + "description": "The graphics devices on the system. Element 0 is the primary GPU.", "type": "array", "items": { "$ref": "GPUDevice" - }, - "description": "The graphics devices on the system. Element 0 is the primary GPU." + } }, { "name": "auxAttributes", - "type": "object", + "description": "An optional dictionary of additional GPU related attributes.", "optional": true, - "description": "An optional dictionary of additional GPU related attributes." + "type": "object" }, { "name": "featureStatus", - "type": "object", + "description": "An optional dictionary of graphics features and their status.", "optional": true, - "description": "An optional dictionary of graphics features and their status." + "type": "object" }, { "name": "driverBugWorkarounds", + "description": "An optional array of GPU driver bug workarounds.", "type": "array", "items": { "type": "string" - }, - "description": "An optional array of GPU driver bug workarounds." + } } - ], - "description": "Provides information about the GPU(s) on the system." + ] } ], "commands": [ @@ -11798,23 +11352,428 @@ "returns": [ { "name": "gpu", - "$ref": "GPUInfo", - "description": "Information about the GPUs on the system." + "description": "Information about the GPUs on the system.", + "$ref": "GPUInfo" }, { "name": "modelName", - "type": "string", - "description": "A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported." + "description": "A platform-dependent description of the model of the machine. On Mac OS, this is, for\nexample, 'MacBookPro'. Will be the empty string if not supported.", + "type": "string" }, { "name": "modelVersion", - "type": "string", - "description": "A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported." + "description": "A platform-dependent description of the version of the machine. On Mac OS, this is, for\nexample, '10.1'. Will be the empty string if not supported.", + "type": "string" }, { "name": "commandLine", - "type": "string", - "description": "The command line string used to launch the browser. Will be the empty string if not supported." + "description": "The command line string used to launch the browser. Will be the empty string if not\nsupported.", + "type": "string" + } + ] + } + ] + }, + { + "domain": "Target", + "description": "Supports additional targets discovery and allows to attach to them.", + "types": [ + { + "id": "TargetID", + "type": "string" + }, + { + "id": "SessionID", + "description": "Unique identifier of attached debugging session.", + "type": "string" + }, + { + "id": "BrowserContextID", + "experimental": true, + "type": "string" + }, + { + "id": "TargetInfo", + "type": "object", + "properties": [ + { + "name": "targetId", + "$ref": "TargetID" + }, + { + "name": "type", + "type": "string" + }, + { + "name": "title", + "type": "string" + }, + { + "name": "url", + "type": "string" + }, + { + "name": "attached", + "description": "Whether the target has an attached client.", + "type": "boolean" + }, + { + "name": "openerId", + "description": "Opener target Id", + "optional": true, + "$ref": "TargetID" + } + ] + }, + { + "id": "RemoteLocation", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "host", + "type": "string" + }, + { + "name": "port", + "type": "integer" + } + ] + } + ], + "commands": [ + { + "name": "activateTarget", + "description": "Activates (focuses) the target.", + "parameters": [ + { + "name": "targetId", + "$ref": "TargetID" + } + ] + }, + { + "name": "attachToTarget", + "description": "Attaches to the target with given id.", + "parameters": [ + { + "name": "targetId", + "$ref": "TargetID" + } + ], + "returns": [ + { + "name": "sessionId", + "description": "Id assigned to the session.", + "$ref": "SessionID" + } + ] + }, + { + "name": "closeTarget", + "description": "Closes the target. If the target is a page that gets closed too.", + "parameters": [ + { + "name": "targetId", + "$ref": "TargetID" + } + ], + "returns": [ + { + "name": "success", + "type": "boolean" + } + ] + }, + { + "name": "createBrowserContext", + "description": "Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than\none.", + "experimental": true, + "returns": [ + { + "name": "browserContextId", + "description": "The id of the context created.", + "$ref": "BrowserContextID" + } + ] + }, + { + "name": "createTarget", + "description": "Creates a new page.", + "parameters": [ + { + "name": "url", + "description": "The initial URL the page will be navigated to.", + "type": "string" + }, + { + "name": "width", + "description": "Frame width in DIP (headless chrome only).", + "optional": true, + "type": "integer" + }, + { + "name": "height", + "description": "Frame height in DIP (headless chrome only).", + "optional": true, + "type": "integer" + }, + { + "name": "browserContextId", + "description": "The browser context to create the page in (headless chrome only).", + "optional": true, + "$ref": "BrowserContextID" + }, + { + "name": "enableBeginFrameControl", + "description": "Whether BeginFrames for this target will be controlled via DevTools (headless chrome only,\nnot supported on MacOS yet, false by default).", + "experimental": true, + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "targetId", + "description": "The id of the page opened.", + "$ref": "TargetID" + } + ] + }, + { + "name": "detachFromTarget", + "description": "Detaches session with given id.", + "parameters": [ + { + "name": "sessionId", + "description": "Session to detach.", + "optional": true, + "$ref": "SessionID" + }, + { + "name": "targetId", + "description": "Deprecated.", + "deprecated": true, + "optional": true, + "$ref": "TargetID" + } + ] + }, + { + "name": "disposeBrowserContext", + "description": "Deletes a BrowserContext, will fail of any open page uses it.", + "experimental": true, + "parameters": [ + { + "name": "browserContextId", + "$ref": "BrowserContextID" + } + ], + "returns": [ + { + "name": "success", + "type": "boolean" + } + ] + }, + { + "name": "getTargetInfo", + "description": "Returns information about a target.", + "experimental": true, + "parameters": [ + { + "name": "targetId", + "$ref": "TargetID" + } + ], + "returns": [ + { + "name": "targetInfo", + "$ref": "TargetInfo" + } + ] + }, + { + "name": "getTargets", + "description": "Retrieves a list of available targets.", + "returns": [ + { + "name": "targetInfos", + "description": "The list of targets.", + "type": "array", + "items": { + "$ref": "TargetInfo" + } + } + ] + }, + { + "name": "sendMessageToTarget", + "description": "Sends protocol message over session with given id.", + "parameters": [ + { + "name": "message", + "type": "string" + }, + { + "name": "sessionId", + "description": "Identifier of the session.", + "optional": true, + "$ref": "SessionID" + }, + { + "name": "targetId", + "description": "Deprecated.", + "deprecated": true, + "optional": true, + "$ref": "TargetID" + } + ] + }, + { + "name": "setAttachToFrames", + "experimental": true, + "parameters": [ + { + "name": "value", + "description": "Whether to attach to frames.", + "type": "boolean" + } + ] + }, + { + "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.", + "experimental": true, + "parameters": [ + { + "name": "autoAttach", + "description": "Whether to auto-attach to related targets.", + "type": "boolean" + }, + { + "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.", + "parameters": [ + { + "name": "discover", + "description": "Whether to discover available targets.", + "type": "boolean" + } + ] + }, + { + "name": "setRemoteLocations", + "description": "Enables target discovery for the specified locations, when `setDiscoverTargets` was set to\n`true`.", + "experimental": true, + "parameters": [ + { + "name": "locations", + "description": "List of remote locations.", + "type": "array", + "items": { + "$ref": "RemoteLocation" + } + } + ] + } + ], + "events": [ + { + "name": "attachedToTarget", + "description": "Issued when attached to target because of auto-attach or `attachToTarget` command.", + "experimental": true, + "parameters": [ + { + "name": "sessionId", + "description": "Identifier assigned to the session used to send/receive messages.", + "$ref": "SessionID" + }, + { + "name": "targetInfo", + "$ref": "TargetInfo" + }, + { + "name": "waitingForDebugger", + "type": "boolean" + } + ] + }, + { + "name": "detachedFromTarget", + "description": "Issued when detached from target for any reason (including `detachFromTarget` command). Can be\nissued multiple times per target if multiple sessions have been attached to it.", + "experimental": true, + "parameters": [ + { + "name": "sessionId", + "description": "Detached session identifier.", + "$ref": "SessionID" + }, + { + "name": "targetId", + "description": "Deprecated.", + "deprecated": true, + "optional": true, + "$ref": "TargetID" + } + ] + }, + { + "name": "receivedMessageFromTarget", + "description": "Notifies about a new protocol message received from the session (as reported in\n`attachedToTarget` event).", + "parameters": [ + { + "name": "sessionId", + "description": "Identifier of a session which sends a message.", + "$ref": "SessionID" + }, + { + "name": "message", + "type": "string" + }, + { + "name": "targetId", + "description": "Deprecated.", + "deprecated": true, + "optional": true, + "$ref": "TargetID" + } + ] + }, + { + "name": "targetCreated", + "description": "Issued when a possible inspection target is created.", + "parameters": [ + { + "name": "targetInfo", + "$ref": "TargetInfo" + } + ] + }, + { + "name": "targetDestroyed", + "description": "Issued when a target is destroyed.", + "parameters": [ + { + "name": "targetId", + "$ref": "TargetID" + } + ] + }, + { + "name": "targetInfoChanged", + "description": "Issued when some information about a target has changed. This only happens between\n`targetCreated` and `targetDestroyed`.", + "parameters": [ + { + "name": "targetInfo", + "$ref": "TargetInfo" } ] } @@ -11831,8 +11790,8 @@ "parameters": [ { "name": "port", - "type": "integer", - "description": "Port number to bind." + "description": "Port number to bind.", + "type": "integer" } ] }, @@ -11842,8 +11801,8 @@ "parameters": [ { "name": "port", - "type": "integer", - "description": "Port number to unbind." + "description": "Port number to unbind.", + "type": "integer" } ] } @@ -11855,215 +11814,2016 @@ "parameters": [ { "name": "port", - "type": "integer", - "description": "Port number that was successfully bound." + "description": "Port number that was successfully bound.", + "type": "integer" }, { "name": "connectionId", - "type": "string", - "description": "Connection id to be used." + "description": "Connection id to be used.", + "type": "string" } ] } ] }, { - "domain": "Browser", - "description": "The Browser domain defines methods and events for browser managing.", + "domain": "Tracing", + "experimental": true, + "dependencies": [ + "IO" + ], "types": [ { - "id": "WindowID", - "type": "integer", - "experimental": true + "id": "MemoryDumpConfig", + "description": "Configuration for memory dump. Used only when \"memory-infra\" category is enabled.", + "type": "object" }, { - "id": "WindowState", - "type": "string", - "enum": [ - "normal", - "minimized", - "maximized", - "fullscreen" - ], - "description": "The state of the browser window.", - "experimental": true - }, - { - "id": "Bounds", + "id": "TraceConfig", "type": "object", - "description": "Browser window bounds information", "properties": [ { - "name": "left", - "type": "integer", + "name": "recordMode", + "description": "Controls how the trace buffer stores data.", "optional": true, - "description": "The offset from the left edge of the screen to the window in pixels." + "type": "string", + "enum": [ + "recordUntilFull", + "recordContinuously", + "recordAsMuchAsPossible", + "echoToConsole" + ] }, { - "name": "top", - "type": "integer", + "name": "enableSampling", + "description": "Turns on JavaScript stack sampling.", "optional": true, - "description": "The offset from the top edge of the screen to the window in pixels." + "type": "boolean" }, { - "name": "width", - "type": "integer", + "name": "enableSystrace", + "description": "Turns on system tracing.", "optional": true, - "description": "The window width in pixels." + "type": "boolean" }, { - "name": "height", - "type": "integer", + "name": "enableArgumentFilter", + "description": "Turns on argument filter.", "optional": true, - "description": "The window height in pixels." + "type": "boolean" }, { - "name": "windowState", - "$ref": "WindowState", + "name": "includedCategories", + "description": "Included category filters.", "optional": true, - "description": "The window state. Default to normal." + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "excludedCategories", + "description": "Excluded category filters.", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "syntheticDelays", + "description": "Configuration to synthesize the delays in tracing.", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "memoryDumpConfig", + "description": "Configuration for memory dump triggers. Used only when \"memory-infra\" category is enabled.", + "optional": true, + "$ref": "MemoryDumpConfig" } - ], - "experimental": true + ] + }, + { + "id": "StreamCompression", + "description": "Compression type to use for traces returned via streams.", + "type": "string", + "enum": [ + "none", + "gzip" + ] } ], "commands": [ { - "name": "close", - "description": "Close browser gracefully." + "name": "end", + "description": "Stop trace events collection." }, { - "name": "getWindowForTarget", - "description": "Get the browser window that contains the devtools target.", - "parameters": [ - { - "name": "targetId", - "$ref": "Target.TargetID", - "description": "Devtools agent host id." - } - ], + "name": "getCategories", + "description": "Gets supported tracing categories.", "returns": [ { - "name": "windowId", - "$ref": "WindowID", - "description": "Browser window id." - }, - { - "name": "bounds", - "$ref": "Bounds", - "description": "Bounds information of the window. When window state is 'minimized', the restored window position and size are returned." - } - ], - "experimental": true - }, - { - "name": "getVersion", - "description": "Returns version information.", - "returns": [ - { - "name": "protocolVersion", - "type": "string", - "description": "Protocol version." - }, - { - "name": "product", - "type": "string", - "description": "Product name." - }, - { - "name": "revision", - "type": "string", - "description": "Product revision." - }, - { - "name": "userAgent", - "type": "string", - "description": "User-Agent." - }, - { - "name": "jsVersion", - "type": "string", - "description": "V8 version." + "name": "categories", + "description": "A list of supported tracing categories.", + "type": "array", + "items": { + "type": "string" + } } ] }, { - "name": "setWindowBounds", - "description": "Set position and/or size of the browser window.", + "name": "recordClockSyncMarker", + "description": "Record a clock sync marker in the trace.", "parameters": [ { - "name": "windowId", - "$ref": "WindowID", - "description": "Browser window id." - }, - { - "name": "bounds", - "$ref": "Bounds", - "description": "New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged." + "name": "syncId", + "description": "The ID of this clock sync marker", + "type": "string" } - ], - "experimental": true + ] }, { - "name": "getWindowBounds", - "description": "Get position and size of the browser window.", - "parameters": [ - { - "name": "windowId", - "$ref": "WindowID", - "description": "Browser window id." - } - ], + "name": "requestMemoryDump", + "description": "Request a global memory dump.", "returns": [ { - "name": "bounds", - "$ref": "Bounds", - "description": "Bounds information of the window. When window state is 'minimized', the restored window position and size are returned." + "name": "dumpGuid", + "description": "GUID of the resulting global memory dump.", + "type": "string" + }, + { + "name": "success", + "description": "True iff the global memory dump succeeded.", + "type": "boolean" } - ], - "experimental": true + ] + }, + { + "name": "start", + "description": "Start trace events collection.", + "parameters": [ + { + "name": "categories", + "description": "Category/tag filter", + "deprecated": true, + "optional": true, + "type": "string" + }, + { + "name": "options", + "description": "Tracing options", + "deprecated": true, + "optional": true, + "type": "string" + }, + { + "name": "bufferUsageReportingInterval", + "description": "If set, the agent will issue bufferUsage events at this interval, specified in milliseconds", + "optional": true, + "type": "number" + }, + { + "name": "transferMode", + "description": "Whether to report trace events as series of dataCollected events or to save trace to a\nstream (defaults to `ReportEvents`).", + "optional": true, + "type": "string", + "enum": [ + "ReportEvents", + "ReturnAsStream" + ] + }, + { + "name": "streamCompression", + "description": "Compression format to use. This only applies when using `ReturnAsStream`\ntransfer mode (defaults to `none`)", + "optional": true, + "$ref": "StreamCompression" + }, + { + "name": "traceConfig", + "optional": true, + "$ref": "TraceConfig" + } + ] + } + ], + "events": [ + { + "name": "bufferUsage", + "parameters": [ + { + "name": "percentFull", + "description": "A number in range [0..1] that indicates the used size of event buffer as a fraction of its\ntotal size.", + "optional": true, + "type": "number" + }, + { + "name": "eventCount", + "description": "An approximate number of events in the trace log.", + "optional": true, + "type": "number" + }, + { + "name": "value", + "description": "A number in range [0..1] that indicates the used size of event buffer as a fraction of its\ntotal size.", + "optional": true, + "type": "number" + } + ] + }, + { + "name": "dataCollected", + "description": "Contains an bucket of collected trace events. When tracing is stopped collected events will be\nsend as a sequence of dataCollected events followed by tracingComplete event.", + "parameters": [ + { + "name": "value", + "type": "array", + "items": { + "type": "object" + } + } + ] + }, + { + "name": "tracingComplete", + "description": "Signals that tracing is stopped and there is no trace buffers pending flush, all data were\ndelivered via dataCollected events.", + "parameters": [ + { + "name": "stream", + "description": "A handle of the stream that holds resulting trace data.", + "optional": true, + "$ref": "IO.StreamHandle" + }, + { + "name": "streamCompression", + "description": "Compression format of returned stream.", + "optional": true, + "$ref": "StreamCompression" + } + ] } ] }, { - "domain": "Schema", - "description": "This domain is deprecated.", + "domain": "Console", + "description": "This domain is deprecated - use Runtime or Log instead.", "deprecated": true, + "dependencies": [ + "Runtime" + ], "types": [ { - "id": "Domain", + "id": "ConsoleMessage", + "description": "Console message.", + "type": "object", + "properties": [ + { + "name": "source", + "description": "Message source.", + "type": "string", + "enum": [ + "xml", + "javascript", + "network", + "console-api", + "storage", + "appcache", + "rendering", + "security", + "other", + "deprecation", + "worker" + ] + }, + { + "name": "level", + "description": "Message severity.", + "type": "string", + "enum": [ + "log", + "warning", + "error", + "debug", + "info" + ] + }, + { + "name": "text", + "description": "Message text.", + "type": "string" + }, + { + "name": "url", + "description": "URL of the message origin.", + "optional": true, + "type": "string" + }, + { + "name": "line", + "description": "Line number in the resource that generated this message (1-based).", + "optional": true, + "type": "integer" + }, + { + "name": "column", + "description": "Column number in the resource that generated this message (1-based).", + "optional": true, + "type": "integer" + } + ] + } + ], + "commands": [ + { + "name": "clearMessages", + "description": "Does nothing." + }, + { + "name": "disable", + "description": "Disables console domain, prevents further console messages from being reported to the client." + }, + { + "name": "enable", + "description": "Enables console domain, sends the messages collected so far to the client by means of the\n`messageAdded` notification." + } + ], + "events": [ + { + "name": "messageAdded", + "description": "Issued when new console message is added.", + "parameters": [ + { + "name": "message", + "description": "Console message that has been added.", + "$ref": "ConsoleMessage" + } + ] + } + ] + }, + { + "domain": "Debugger", + "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing\nbreakpoints, stepping through execution, exploring stack traces, etc.", + "dependencies": [ + "Runtime" + ], + "types": [ + { + "id": "BreakpointId", + "description": "Breakpoint identifier.", + "type": "string" + }, + { + "id": "CallFrameId", + "description": "Call frame identifier.", + "type": "string" + }, + { + "id": "Location", + "description": "Location in the source code.", + "type": "object", + "properties": [ + { + "name": "scriptId", + "description": "Script identifier as reported in the `Debugger.scriptParsed`.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "lineNumber", + "description": "Line number in the script (0-based).", + "type": "integer" + }, + { + "name": "columnNumber", + "description": "Column number in the script (0-based).", + "optional": true, + "type": "integer" + } + ] + }, + { + "id": "ScriptPosition", + "description": "Location in the source code.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "lineNumber", + "type": "integer" + }, + { + "name": "columnNumber", + "type": "integer" + } + ] + }, + { + "id": "CallFrame", + "description": "JavaScript call frame. Array of call frames form the call stack.", + "type": "object", + "properties": [ + { + "name": "callFrameId", + "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused.", + "$ref": "CallFrameId" + }, + { + "name": "functionName", + "description": "Name of the JavaScript function called on this call frame.", + "type": "string" + }, + { + "name": "functionLocation", + "description": "Location in the source code.", + "optional": true, + "$ref": "Location" + }, + { + "name": "location", + "description": "Location in the source code.", + "$ref": "Location" + }, + { + "name": "url", + "description": "JavaScript script name or url.", + "type": "string" + }, + { + "name": "scopeChain", + "description": "Scope chain for this call frame.", + "type": "array", + "items": { + "$ref": "Scope" + } + }, + { + "name": "this", + "description": "`this` object for this call frame.", + "$ref": "Runtime.RemoteObject" + }, + { + "name": "returnValue", + "description": "The value being returned, if the function is at return point.", + "optional": true, + "$ref": "Runtime.RemoteObject" + } + ] + }, + { + "id": "Scope", + "description": "Scope description.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "Scope type.", + "type": "string", + "enum": [ + "global", + "local", + "with", + "closure", + "catch", + "block", + "script", + "eval", + "module" + ] + }, + { + "name": "object", + "description": "Object representing the scope. For `global` and `with` scopes it represents the actual\nobject; for the rest of the scopes, it is artificial transient object enumerating scope\nvariables as its properties.", + "$ref": "Runtime.RemoteObject" + }, + { + "name": "name", + "optional": true, + "type": "string" + }, + { + "name": "startLocation", + "description": "Location in the source code where scope starts", + "optional": true, + "$ref": "Location" + }, + { + "name": "endLocation", + "description": "Location in the source code where scope ends", + "optional": true, + "$ref": "Location" + } + ] + }, + { + "id": "SearchMatch", + "description": "Search match for resource.", + "type": "object", + "properties": [ + { + "name": "lineNumber", + "description": "Line number in resource content.", + "type": "number" + }, + { + "name": "lineContent", + "description": "Line with match content.", + "type": "string" + } + ] + }, + { + "id": "BreakLocation", + "type": "object", + "properties": [ + { + "name": "scriptId", + "description": "Script identifier as reported in the `Debugger.scriptParsed`.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "lineNumber", + "description": "Line number in the script (0-based).", + "type": "integer" + }, + { + "name": "columnNumber", + "description": "Column number in the script (0-based).", + "optional": true, + "type": "integer" + }, + { + "name": "type", + "optional": true, + "type": "string", + "enum": [ + "debuggerStatement", + "call", + "return" + ] + } + ] + } + ], + "commands": [ + { + "name": "continueToLocation", + "description": "Continues execution until specific location is reached.", + "parameters": [ + { + "name": "location", + "description": "Location to continue to.", + "$ref": "Location" + }, + { + "name": "targetCallFrames", + "optional": true, + "type": "string", + "enum": [ + "any", + "current" + ] + } + ] + }, + { + "name": "disable", + "description": "Disables debugger for given page." + }, + { + "name": "enable", + "description": "Enables debugger for the given page. Clients should not assume that the debugging has been\nenabled until the result for this command is received.", + "returns": [ + { + "name": "debuggerId", + "description": "Unique identifier of the debugger.", + "experimental": true, + "$ref": "Runtime.UniqueDebuggerId" + } + ] + }, + { + "name": "evaluateOnCallFrame", + "description": "Evaluates expression on a given call frame.", + "parameters": [ + { + "name": "callFrameId", + "description": "Call frame identifier to evaluate on.", + "$ref": "CallFrameId" + }, + { + "name": "expression", + "description": "Expression to evaluate.", + "type": "string" + }, + { + "name": "objectGroup", + "description": "String object group name to put result into (allows rapid releasing resulting object handles\nusing `releaseObjectGroup`).", + "optional": true, + "type": "string" + }, + { + "name": "includeCommandLineAPI", + "description": "Specifies whether command line API should be available to the evaluated expression, defaults\nto false.", + "optional": true, + "type": "boolean" + }, + { + "name": "silent", + "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.", + "optional": true, + "type": "boolean" + }, + { + "name": "returnByValue", + "description": "Whether the result is expected to be a JSON object that should be sent by value.", + "optional": true, + "type": "boolean" + }, + { + "name": "generatePreview", + "description": "Whether preview should be generated for the result.", + "experimental": true, + "optional": true, + "type": "boolean" + }, + { + "name": "throwOnSideEffect", + "description": "Whether to throw an exception if side effect cannot be ruled out during evaluation.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "result", + "description": "Object wrapper for the evaluation result.", + "$ref": "Runtime.RemoteObject" + }, + { + "name": "exceptionDetails", + "description": "Exception details.", + "optional": true, + "$ref": "Runtime.ExceptionDetails" + } + ] + }, + { + "name": "getPossibleBreakpoints", + "description": "Returns possible locations for breakpoint. scriptId in start and end range locations should be\nthe same.", + "parameters": [ + { + "name": "start", + "description": "Start of range to search possible breakpoint locations in.", + "$ref": "Location" + }, + { + "name": "end", + "description": "End of range to search possible breakpoint locations in (excluding). When not specified, end\nof scripts is used as end of range.", + "optional": true, + "$ref": "Location" + }, + { + "name": "restrictToFunction", + "description": "Only consider locations which are in the same (non-nested) function as start.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "locations", + "description": "List of the possible breakpoint locations.", + "type": "array", + "items": { + "$ref": "BreakLocation" + } + } + ] + }, + { + "name": "getScriptSource", + "description": "Returns source for the script with given id.", + "parameters": [ + { + "name": "scriptId", + "description": "Id of the script to get source for.", + "$ref": "Runtime.ScriptId" + } + ], + "returns": [ + { + "name": "scriptSource", + "description": "Script source.", + "type": "string" + } + ] + }, + { + "name": "getStackTrace", + "description": "Returns stack trace with given `stackTraceId`.", + "experimental": true, + "parameters": [ + { + "name": "stackTraceId", + "$ref": "Runtime.StackTraceId" + } + ], + "returns": [ + { + "name": "stackTrace", + "$ref": "Runtime.StackTrace" + } + ] + }, + { + "name": "pause", + "description": "Stops on the next JavaScript statement." + }, + { + "name": "pauseOnAsyncCall", + "experimental": true, + "parameters": [ + { + "name": "parentStackTraceId", + "description": "Debugger will pause when async call with given stack trace is started.", + "$ref": "Runtime.StackTraceId" + } + ] + }, + { + "name": "removeBreakpoint", + "description": "Removes JavaScript breakpoint.", + "parameters": [ + { + "name": "breakpointId", + "$ref": "BreakpointId" + } + ] + }, + { + "name": "restartFrame", + "description": "Restarts particular call frame from the beginning.", + "parameters": [ + { + "name": "callFrameId", + "description": "Call frame identifier to evaluate on.", + "$ref": "CallFrameId" + } + ], + "returns": [ + { + "name": "callFrames", + "description": "New stack trace.", + "type": "array", + "items": { + "$ref": "CallFrame" + } + }, + { + "name": "asyncStackTrace", + "description": "Async stack trace, if any.", + "optional": true, + "$ref": "Runtime.StackTrace" + }, + { + "name": "asyncStackTraceId", + "description": "Async stack trace, if any.", + "experimental": true, + "optional": true, + "$ref": "Runtime.StackTraceId" + } + ] + }, + { + "name": "resume", + "description": "Resumes JavaScript execution." + }, + { + "name": "scheduleStepIntoAsync", + "description": "This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and\nDebugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled\nbefore next pause. Returns success when async task is actually scheduled, returns error if no\ntask were scheduled or another scheduleStepIntoAsync was called.", + "experimental": true + }, + { + "name": "searchInContent", + "description": "Searches for given string in script content.", + "parameters": [ + { + "name": "scriptId", + "description": "Id of the script to search in.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "query", + "description": "String to search for.", + "type": "string" + }, + { + "name": "caseSensitive", + "description": "If true, search is case sensitive.", + "optional": true, + "type": "boolean" + }, + { + "name": "isRegex", + "description": "If true, treats string parameter as regex.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "result", + "description": "List of search matches.", + "type": "array", + "items": { + "$ref": "SearchMatch" + } + } + ] + }, + { + "name": "setAsyncCallStackDepth", + "description": "Enables or disables async call stacks tracking.", + "parameters": [ + { + "name": "maxDepth", + "description": "Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async\ncall stacks (default).", + "type": "integer" + } + ] + }, + { + "name": "setBlackboxPatterns", + "description": "Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in\nscripts with url matching one of the patterns. VM will try to leave blackboxed script by\nperforming 'step in' several times, finally resorting to 'step out' if unsuccessful.", + "experimental": true, + "parameters": [ + { + "name": "patterns", + "description": "Array of regexps that will be used to check script url for blackbox state.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "setBlackboxedRanges", + "description": "Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted\nscripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.\nPositions array contains positions where blackbox state is changed. First interval isn't\nblackboxed. Array should be sorted.", + "experimental": true, + "parameters": [ + { + "name": "scriptId", + "description": "Id of the script.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "positions", + "type": "array", + "items": { + "$ref": "ScriptPosition" + } + } + ] + }, + { + "name": "setBreakpoint", + "description": "Sets JavaScript breakpoint at a given location.", + "parameters": [ + { + "name": "location", + "description": "Location to set breakpoint in.", + "$ref": "Location" + }, + { + "name": "condition", + "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the\nbreakpoint if this expression evaluates to true.", + "optional": true, + "type": "string" + } + ], + "returns": [ + { + "name": "breakpointId", + "description": "Id of the created breakpoint for further reference.", + "$ref": "BreakpointId" + }, + { + "name": "actualLocation", + "description": "Location this breakpoint resolved into.", + "$ref": "Location" + } + ] + }, + { + "name": "setBreakpointByUrl", + "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this\ncommand is issued, all existing parsed scripts will have breakpoints resolved and returned in\n`locations` property. Further matching script parsing will result in subsequent\n`breakpointResolved` events issued. This logical breakpoint will survive page reloads.", + "parameters": [ + { + "name": "lineNumber", + "description": "Line number to set breakpoint at.", + "type": "integer" + }, + { + "name": "url", + "description": "URL of the resources to set breakpoint on.", + "optional": true, + "type": "string" + }, + { + "name": "urlRegex", + "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or\n`urlRegex` must be specified.", + "optional": true, + "type": "string" + }, + { + "name": "scriptHash", + "description": "Script hash of the resources to set breakpoint on.", + "optional": true, + "type": "string" + }, + { + "name": "columnNumber", + "description": "Offset in the line to set breakpoint at.", + "optional": true, + "type": "integer" + }, + { + "name": "condition", + "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the\nbreakpoint if this expression evaluates to true.", + "optional": true, + "type": "string" + } + ], + "returns": [ + { + "name": "breakpointId", + "description": "Id of the created breakpoint for further reference.", + "$ref": "BreakpointId" + }, + { + "name": "locations", + "description": "List of the locations this breakpoint resolved into upon addition.", + "type": "array", + "items": { + "$ref": "Location" + } + } + ] + }, + { + "name": "setBreakpointsActive", + "description": "Activates / deactivates all breakpoints on the page.", + "parameters": [ + { + "name": "active", + "description": "New value for breakpoints active state.", + "type": "boolean" + } + ] + }, + { + "name": "setPauseOnExceptions", + "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or\nno exceptions. Initial pause on exceptions state is `none`.", + "parameters": [ + { + "name": "state", + "description": "Pause on exceptions mode.", + "type": "string", + "enum": [ + "none", + "uncaught", + "all" + ] + } + ] + }, + { + "name": "setReturnValue", + "description": "Changes return value in top frame. Available only at return break position.", + "experimental": true, + "parameters": [ + { + "name": "newValue", + "description": "New return value.", + "$ref": "Runtime.CallArgument" + } + ] + }, + { + "name": "setScriptSource", + "description": "Edits JavaScript source live.", + "parameters": [ + { + "name": "scriptId", + "description": "Id of the script to edit.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "scriptSource", + "description": "New content of the script.", + "type": "string" + }, + { + "name": "dryRun", + "description": "If true the change will not actually be applied. Dry run may be used to get result\ndescription without actually modifying the code.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "callFrames", + "description": "New stack trace in case editing has happened while VM was stopped.", + "optional": true, + "type": "array", + "items": { + "$ref": "CallFrame" + } + }, + { + "name": "stackChanged", + "description": "Whether current call stack was modified after applying the changes.", + "optional": true, + "type": "boolean" + }, + { + "name": "asyncStackTrace", + "description": "Async stack trace, if any.", + "optional": true, + "$ref": "Runtime.StackTrace" + }, + { + "name": "asyncStackTraceId", + "description": "Async stack trace, if any.", + "experimental": true, + "optional": true, + "$ref": "Runtime.StackTraceId" + }, + { + "name": "exceptionDetails", + "description": "Exception details if any.", + "optional": true, + "$ref": "Runtime.ExceptionDetails" + } + ] + }, + { + "name": "setSkipAllPauses", + "description": "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).", + "parameters": [ + { + "name": "skip", + "description": "New value for skip pauses state.", + "type": "boolean" + } + ] + }, + { + "name": "setVariableValue", + "description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be\nmutated manually.", + "parameters": [ + { + "name": "scopeNumber", + "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'\nscope types are allowed. Other scopes could be manipulated manually.", + "type": "integer" + }, + { + "name": "variableName", + "description": "Variable name.", + "type": "string" + }, + { + "name": "newValue", + "description": "New variable value.", + "$ref": "Runtime.CallArgument" + }, + { + "name": "callFrameId", + "description": "Id of callframe that holds variable.", + "$ref": "CallFrameId" + } + ] + }, + { + "name": "stepInto", + "description": "Steps into the function call.", + "parameters": [ + { + "name": "breakOnAsyncCall", + "description": "Debugger will issue additional Debugger.paused notification if any async task is scheduled\nbefore next pause.", + "experimental": true, + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "stepOut", + "description": "Steps out of the function call." + }, + { + "name": "stepOver", + "description": "Steps over the statement." + } + ], + "events": [ + { + "name": "breakpointResolved", + "description": "Fired when breakpoint is resolved to an actual script and location.", + "parameters": [ + { + "name": "breakpointId", + "description": "Breakpoint unique identifier.", + "$ref": "BreakpointId" + }, + { + "name": "location", + "description": "Actual breakpoint location.", + "$ref": "Location" + } + ] + }, + { + "name": "paused", + "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.", + "parameters": [ + { + "name": "callFrames", + "description": "Call stack the virtual machine stopped on.", + "type": "array", + "items": { + "$ref": "CallFrame" + } + }, + { + "name": "reason", + "description": "Pause reason.", + "type": "string", + "enum": [ + "XHR", + "DOM", + "EventListener", + "exception", + "assert", + "debugCommand", + "promiseRejection", + "OOM", + "other", + "ambiguous" + ] + }, + { + "name": "data", + "description": "Object containing break-specific auxiliary properties.", + "optional": true, + "type": "object" + }, + { + "name": "hitBreakpoints", + "description": "Hit breakpoints IDs", + "optional": true, + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "asyncStackTrace", + "description": "Async stack trace, if any.", + "optional": true, + "$ref": "Runtime.StackTrace" + }, + { + "name": "asyncStackTraceId", + "description": "Async stack trace, if any.", + "experimental": true, + "optional": true, + "$ref": "Runtime.StackTraceId" + }, + { + "name": "asyncCallStackTraceId", + "description": "Just scheduled async call will have this stack trace as parent stack during async execution.\nThis field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag.", + "experimental": true, + "optional": true, + "$ref": "Runtime.StackTraceId" + } + ] + }, + { + "name": "resumed", + "description": "Fired when the virtual machine resumed execution." + }, + { + "name": "scriptFailedToParse", + "description": "Fired when virtual machine fails to parse the script.", + "parameters": [ + { + "name": "scriptId", + "description": "Identifier of the script parsed.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "url", + "description": "URL or name of the script parsed (if any).", + "type": "string" + }, + { + "name": "startLine", + "description": "Line offset of the script within the resource with given URL (for script tags).", + "type": "integer" + }, + { + "name": "startColumn", + "description": "Column offset of the script within the resource with given URL.", + "type": "integer" + }, + { + "name": "endLine", + "description": "Last line of the script.", + "type": "integer" + }, + { + "name": "endColumn", + "description": "Length of the last line of the script.", + "type": "integer" + }, + { + "name": "executionContextId", + "description": "Specifies script creation context.", + "$ref": "Runtime.ExecutionContextId" + }, + { + "name": "hash", + "description": "Content hash of the script.", + "type": "string" + }, + { + "name": "executionContextAuxData", + "description": "Embedder-specific auxiliary data.", + "optional": true, + "type": "object" + }, + { + "name": "sourceMapURL", + "description": "URL of source map associated with script (if any).", + "optional": true, + "type": "string" + }, + { + "name": "hasSourceURL", + "description": "True, if this script has sourceURL.", + "optional": true, + "type": "boolean" + }, + { + "name": "isModule", + "description": "True, if this script is ES6 module.", + "optional": true, + "type": "boolean" + }, + { + "name": "length", + "description": "This script length.", + "optional": true, + "type": "integer" + }, + { + "name": "stackTrace", + "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", + "experimental": true, + "optional": true, + "$ref": "Runtime.StackTrace" + } + ] + }, + { + "name": "scriptParsed", + "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected\nscripts upon enabling debugger.", + "parameters": [ + { + "name": "scriptId", + "description": "Identifier of the script parsed.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "url", + "description": "URL or name of the script parsed (if any).", + "type": "string" + }, + { + "name": "startLine", + "description": "Line offset of the script within the resource with given URL (for script tags).", + "type": "integer" + }, + { + "name": "startColumn", + "description": "Column offset of the script within the resource with given URL.", + "type": "integer" + }, + { + "name": "endLine", + "description": "Last line of the script.", + "type": "integer" + }, + { + "name": "endColumn", + "description": "Length of the last line of the script.", + "type": "integer" + }, + { + "name": "executionContextId", + "description": "Specifies script creation context.", + "$ref": "Runtime.ExecutionContextId" + }, + { + "name": "hash", + "description": "Content hash of the script.", + "type": "string" + }, + { + "name": "executionContextAuxData", + "description": "Embedder-specific auxiliary data.", + "optional": true, + "type": "object" + }, + { + "name": "isLiveEdit", + "description": "True, if this script is generated as a result of the live edit operation.", + "experimental": true, + "optional": true, + "type": "boolean" + }, + { + "name": "sourceMapURL", + "description": "URL of source map associated with script (if any).", + "optional": true, + "type": "string" + }, + { + "name": "hasSourceURL", + "description": "True, if this script has sourceURL.", + "optional": true, + "type": "boolean" + }, + { + "name": "isModule", + "description": "True, if this script is ES6 module.", + "optional": true, + "type": "boolean" + }, + { + "name": "length", + "description": "This script length.", + "optional": true, + "type": "integer" + }, + { + "name": "stackTrace", + "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", + "experimental": true, + "optional": true, + "$ref": "Runtime.StackTrace" + } + ] + } + ] + }, + { + "domain": "HeapProfiler", + "experimental": true, + "dependencies": [ + "Runtime" + ], + "types": [ + { + "id": "HeapSnapshotObjectId", + "description": "Heap snapshot object id.", + "type": "string" + }, + { + "id": "SamplingHeapProfileNode", + "description": "Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.", + "type": "object", + "properties": [ + { + "name": "callFrame", + "description": "Function location.", + "$ref": "Runtime.CallFrame" + }, + { + "name": "selfSize", + "description": "Allocations size in bytes for the node excluding children.", + "type": "number" + }, + { + "name": "children", + "description": "Child nodes.", + "type": "array", + "items": { + "$ref": "SamplingHeapProfileNode" + } + } + ] + }, + { + "id": "SamplingHeapProfile", + "description": "Profile.", + "type": "object", + "properties": [ + { + "name": "head", + "$ref": "SamplingHeapProfileNode" + } + ] + } + ], + "commands": [ + { + "name": "addInspectedHeapObject", + "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details\n$x functions).", + "parameters": [ + { + "name": "heapObjectId", + "description": "Heap snapshot object id to be accessible by means of $x command line API.", + "$ref": "HeapSnapshotObjectId" + } + ] + }, + { + "name": "collectGarbage" + }, + { + "name": "disable" + }, + { + "name": "enable" + }, + { + "name": "getHeapObjectId", + "parameters": [ + { + "name": "objectId", + "description": "Identifier of the object to get heap object id for.", + "$ref": "Runtime.RemoteObjectId" + } + ], + "returns": [ + { + "name": "heapSnapshotObjectId", + "description": "Id of the heap snapshot object corresponding to the passed remote object id.", + "$ref": "HeapSnapshotObjectId" + } + ] + }, + { + "name": "getObjectByHeapObjectId", + "parameters": [ + { + "name": "objectId", + "$ref": "HeapSnapshotObjectId" + }, + { + "name": "objectGroup", + "description": "Symbolic group name that can be used to release multiple objects.", + "optional": true, + "type": "string" + } + ], + "returns": [ + { + "name": "result", + "description": "Evaluation result.", + "$ref": "Runtime.RemoteObject" + } + ] + }, + { + "name": "getSamplingProfile", + "returns": [ + { + "name": "profile", + "description": "Return the sampling profile being collected.", + "$ref": "SamplingHeapProfile" + } + ] + }, + { + "name": "startSampling", + "parameters": [ + { + "name": "samplingInterval", + "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The\ndefault value is 32768 bytes.", + "optional": true, + "type": "number" + } + ] + }, + { + "name": "startTrackingHeapObjects", + "parameters": [ + { + "name": "trackAllocations", + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "stopSampling", + "returns": [ + { + "name": "profile", + "description": "Recorded sampling heap profile.", + "$ref": "SamplingHeapProfile" + } + ] + }, + { + "name": "stopTrackingHeapObjects", + "parameters": [ + { + "name": "reportProgress", + "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken\nwhen the tracking is stopped.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "takeHeapSnapshot", + "parameters": [ + { + "name": "reportProgress", + "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.", + "optional": true, + "type": "boolean" + } + ] + } + ], + "events": [ + { + "name": "addHeapSnapshotChunk", + "parameters": [ + { + "name": "chunk", + "type": "string" + } + ] + }, + { + "name": "heapStatsUpdate", + "description": "If heap objects tracking has been started then backend may send update for one or more fragments", + "parameters": [ + { + "name": "statsUpdate", + "description": "An array of triplets. Each triplet describes a fragment. The first integer is the fragment\nindex, the second integer is a total count of objects for the fragment, the third integer is\na total size of the objects for the fragment.", + "type": "array", + "items": { + "type": "integer" + } + } + ] + }, + { + "name": "lastSeenObjectId", + "description": "If heap objects tracking has been started then backend regularly sends a current value for last\nseen object id and corresponding timestamp. If the were changes in the heap since last event\nthen one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.", + "parameters": [ + { + "name": "lastSeenObjectId", + "type": "integer" + }, + { + "name": "timestamp", + "type": "number" + } + ] + }, + { + "name": "reportHeapSnapshotProgress", + "parameters": [ + { + "name": "done", + "type": "integer" + }, + { + "name": "total", + "type": "integer" + }, + { + "name": "finished", + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "resetProfiles" + } + ] + }, + { + "domain": "Profiler", + "dependencies": [ + "Runtime", + "Debugger" + ], + "types": [ + { + "id": "ProfileNode", + "description": "Profile node. Holds callsite information, execution statistics and child nodes.", + "type": "object", + "properties": [ + { + "name": "id", + "description": "Unique id of the node.", + "type": "integer" + }, + { + "name": "callFrame", + "description": "Function location.", + "$ref": "Runtime.CallFrame" + }, + { + "name": "hitCount", + "description": "Number of samples where this node was on top of the call stack.", + "optional": true, + "type": "integer" + }, + { + "name": "children", + "description": "Child node ids.", + "optional": true, + "type": "array", + "items": { + "type": "integer" + } + }, + { + "name": "deoptReason", + "description": "The reason of being not optimized. The function may be deoptimized or marked as don't\noptimize.", + "optional": true, + "type": "string" + }, + { + "name": "positionTicks", + "description": "An array of source position ticks.", + "optional": true, + "type": "array", + "items": { + "$ref": "PositionTickInfo" + } + } + ] + }, + { + "id": "Profile", + "description": "Profile.", + "type": "object", + "properties": [ + { + "name": "nodes", + "description": "The list of profile nodes. First item is the root node.", + "type": "array", + "items": { + "$ref": "ProfileNode" + } + }, + { + "name": "startTime", + "description": "Profiling start timestamp in microseconds.", + "type": "number" + }, + { + "name": "endTime", + "description": "Profiling end timestamp in microseconds.", + "type": "number" + }, + { + "name": "samples", + "description": "Ids of samples top nodes.", + "optional": true, + "type": "array", + "items": { + "type": "integer" + } + }, + { + "name": "timeDeltas", + "description": "Time intervals between adjacent samples in microseconds. The first delta is relative to the\nprofile startTime.", + "optional": true, + "type": "array", + "items": { + "type": "integer" + } + } + ] + }, + { + "id": "PositionTickInfo", + "description": "Specifies a number of samples attributed to a certain source position.", + "type": "object", + "properties": [ + { + "name": "line", + "description": "Source line number (1-based).", + "type": "integer" + }, + { + "name": "ticks", + "description": "Number of samples attributed to the source line.", + "type": "integer" + } + ] + }, + { + "id": "CoverageRange", + "description": "Coverage data for a source range.", + "type": "object", + "properties": [ + { + "name": "startOffset", + "description": "JavaScript script source offset for the range start.", + "type": "integer" + }, + { + "name": "endOffset", + "description": "JavaScript script source offset for the range end.", + "type": "integer" + }, + { + "name": "count", + "description": "Collected execution count of the source range.", + "type": "integer" + } + ] + }, + { + "id": "FunctionCoverage", + "description": "Coverage data for a JavaScript function.", + "type": "object", + "properties": [ + { + "name": "functionName", + "description": "JavaScript function name.", + "type": "string" + }, + { + "name": "ranges", + "description": "Source ranges inside the function with coverage data.", + "type": "array", + "items": { + "$ref": "CoverageRange" + } + }, + { + "name": "isBlockCoverage", + "description": "Whether coverage data for this function has block granularity.", + "type": "boolean" + } + ] + }, + { + "id": "ScriptCoverage", + "description": "Coverage data for a JavaScript script.", + "type": "object", + "properties": [ + { + "name": "scriptId", + "description": "JavaScript script id.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "url", + "description": "JavaScript script name or url.", + "type": "string" + }, + { + "name": "functions", + "description": "Functions contained in the script that has coverage data.", + "type": "array", + "items": { + "$ref": "FunctionCoverage" + } + } + ] + }, + { + "id": "TypeObject", + "description": "Describes a type collected during runtime.", + "experimental": true, "type": "object", - "description": "Description of the protocol domain.", "properties": [ { "name": "name", - "type": "string", - "description": "Domain name." + "description": "Name of a type collected with type profiling.", + "type": "string" + } + ] + }, + { + "id": "TypeProfileEntry", + "description": "Source offset and types for a parameter or return value.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "offset", + "description": "Source offset of the parameter or end of function for return values.", + "type": "integer" }, { - "name": "version", - "type": "string", - "description": "Domain version." + "name": "types", + "description": "The types for this parameter or return value.", + "type": "array", + "items": { + "$ref": "TypeObject" + } + } + ] + }, + { + "id": "ScriptTypeProfile", + "description": "Type profile data collected during runtime for a JavaScript script.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "scriptId", + "description": "JavaScript script id.", + "$ref": "Runtime.ScriptId" + }, + { + "name": "url", + "description": "JavaScript script name or url.", + "type": "string" + }, + { + "name": "entries", + "description": "Type profile entries for parameters and return values of the functions in the script.", + "type": "array", + "items": { + "$ref": "TypeProfileEntry" + } } ] } ], "commands": [ { - "name": "getDomains", - "description": "Returns supported domains.", - "handlers": [ - "browser", - "renderer" - ], + "name": "disable" + }, + { + "name": "enable" + }, + { + "name": "getBestEffortCoverage", + "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to\ngarbage collection.", "returns": [ { - "name": "domains", + "name": "result", + "description": "Coverage data for the current isolate.", "type": "array", "items": { - "$ref": "Domain" - }, - "description": "List of supported domains." + "$ref": "ScriptCoverage" + } + } + ] + }, + { + "name": "setSamplingInterval", + "description": "Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.", + "parameters": [ + { + "name": "interval", + "description": "New sampling interval in microseconds.", + "type": "integer" + } + ] + }, + { + "name": "start" + }, + { + "name": "startPreciseCoverage", + "description": "Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code\ncoverage may be incomplete. Enabling prevents running optimized code and resets execution\ncounters.", + "parameters": [ + { + "name": "callCount", + "description": "Collect accurate call counts beyond simple 'covered' or 'not covered'.", + "optional": true, + "type": "boolean" + }, + { + "name": "detailed", + "description": "Collect block-based coverage.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "startTypeProfile", + "description": "Enable type profile.", + "experimental": true + }, + { + "name": "stop", + "returns": [ + { + "name": "profile", + "description": "Recorded profile.", + "$ref": "Profile" + } + ] + }, + { + "name": "stopPreciseCoverage", + "description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows\nexecuting optimized code." + }, + { + "name": "stopTypeProfile", + "description": "Disable type profile. Disabling releases type profile data collected so far.", + "experimental": true + }, + { + "name": "takePreciseCoverage", + "description": "Collect coverage data for the current isolate, and resets execution counters. Precise code\ncoverage needs to have started.", + "returns": [ + { + "name": "result", + "description": "Coverage data for the current isolate.", + "type": "array", + "items": { + "$ref": "ScriptCoverage" + } + } + ] + }, + { + "name": "takeTypeProfile", + "description": "Collect type profile.", + "experimental": true, + "returns": [ + { + "name": "result", + "description": "Type profile for all scripts since startTypeProfile() was turned on.", + "type": "array", + "items": { + "$ref": "ScriptTypeProfile" + } + } + ] + } + ], + "events": [ + { + "name": "consoleProfileFinished", + "parameters": [ + { + "name": "id", + "type": "string" + }, + { + "name": "location", + "description": "Location of console.profileEnd().", + "$ref": "Debugger.Location" + }, + { + "name": "profile", + "$ref": "Profile" + }, + { + "name": "title", + "description": "Profile title passed as an argument to console.profile().", + "optional": true, + "type": "string" + } + ] + }, + { + "name": "consoleProfileStarted", + "description": "Sent when new profile recording is started using console.profile() call.", + "parameters": [ + { + "name": "id", + "type": "string" + }, + { + "name": "location", + "description": "Location of console.profile().", + "$ref": "Debugger.Location" + }, + { + "name": "title", + "description": "Profile title passed as an argument to console.profile().", + "optional": true, + "type": "string" } ] } @@ -12071,36 +13831,37 @@ }, { "domain": "Runtime", - "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.", + "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.\nEvaluation results are returned as mirror object that expose object type, string representation\nand unique identifier that can be used for further object reference. Original objects are\nmaintained in memory unless they are either explicitly released or are released along with the\nother objects in their object group.", "types": [ { "id": "ScriptId", - "type": "string", - "description": "Unique script identifier." + "description": "Unique script identifier.", + "type": "string" }, { "id": "RemoteObjectId", - "type": "string", - "description": "Unique object identifier." + "description": "Unique object identifier.", + "type": "string" }, { "id": "UnserializableValue", + "description": "Primitive value which cannot be JSON-stringified.", "type": "string", "enum": [ "Infinity", "NaN", "-Infinity", "-0" - ], - "description": "Primitive value which cannot be JSON-stringified." + ] }, { "id": "RemoteObject", - "type": "object", "description": "Mirror object referencing original JavaScript object.", + "type": "object", "properties": [ { "name": "type", + "description": "Object type.", "type": "string", "enum": [ "object", @@ -12110,13 +13871,13 @@ "number", "boolean", "symbol" - ], - "description": "Object type." + ] }, { "name": "subtype", - "type": "string", + "description": "Object subtype hint. Specified for `object` type values only.", "optional": true, + "type": "string", "enum": [ "array", "null", @@ -12133,58 +13894,57 @@ "proxy", "promise", "typedarray" - ], - "description": "Object subtype hint. Specified for object type values only." + ] }, { "name": "className", - "type": "string", + "description": "Object class (constructor) name. Specified for `object` type values only.", "optional": true, - "description": "Object class (constructor) name. Specified for object type values only." + "type": "string" }, { "name": "value", - "type": "any", + "description": "Remote object value in case of primitive values or JSON values (if it was requested).", "optional": true, - "description": "Remote object value in case of primitive values or JSON values (if it was requested)." + "type": "any" }, { "name": "unserializableValue", - "$ref": "UnserializableValue", + "description": "Primitive value which can not be JSON-stringified does not have `value`, but gets this\nproperty.", "optional": true, - "description": "Primitive value which can not be JSON-stringified does not have value, but gets this property." + "$ref": "UnserializableValue" }, { "name": "description", - "type": "string", + "description": "String representation of the object.", "optional": true, - "description": "String representation of the object." + "type": "string" }, { "name": "objectId", - "$ref": "RemoteObjectId", + "description": "Unique object identifier (for non-primitive values).", "optional": true, - "description": "Unique object identifier (for non-primitive values)." + "$ref": "RemoteObjectId" }, { "name": "preview", - "$ref": "ObjectPreview", + "description": "Preview containing abbreviated property values. Specified for `object` type values only.", + "experimental": true, "optional": true, - "description": "Preview containing abbreviated property values. Specified for object type values only.", - "experimental": true + "$ref": "ObjectPreview" }, { "name": "customPreview", - "$ref": "CustomPreview", + "experimental": true, "optional": true, - "experimental": true + "$ref": "CustomPreview" } ] }, { "id": "CustomPreview", - "type": "object", "experimental": true, + "type": "object", "properties": [ { "name": "header", @@ -12204,19 +13964,20 @@ }, { "name": "configObjectId", - "$ref": "RemoteObjectId", - "optional": true + "optional": true, + "$ref": "RemoteObjectId" } ] }, { "id": "ObjectPreview", - "type": "object", - "experimental": true, "description": "Object containing abbreviated remote object value.", + "experimental": true, + "type": "object", "properties": [ { "name": "type", + "description": "Object type.", "type": "string", "enum": [ "object", @@ -12226,13 +13987,13 @@ "number", "boolean", "symbol" - ], - "description": "Object type." + ] }, { "name": "subtype", - "type": "string", + "description": "Object subtype hint. Specified for `object` type values only.", "optional": true, + "type": "string", "enum": [ "array", "null", @@ -12246,51 +14007,51 @@ "iterator", "generator", "error" - ], - "description": "Object subtype hint. Specified for object type values only." + ] }, { "name": "description", - "type": "string", + "description": "String representation of the object.", "optional": true, - "description": "String representation of the object." + "type": "string" }, { "name": "overflow", - "type": "boolean", - "description": "True iff some of the properties or entries of the original object did not fit." + "description": "True iff some of the properties or entries of the original object did not fit.", + "type": "boolean" }, { "name": "properties", + "description": "List of the properties.", "type": "array", "items": { "$ref": "PropertyPreview" - }, - "description": "List of the properties." + } }, { "name": "entries", + "description": "List of the entries. Specified for `map` and `set` subtype values only.", + "optional": true, "type": "array", "items": { "$ref": "EntryPreview" - }, - "optional": true, - "description": "List of the entries. Specified for map and set subtype values only." + } } ] }, { "id": "PropertyPreview", - "type": "object", "experimental": true, + "type": "object", "properties": [ { "name": "name", - "type": "string", - "description": "Property name." + "description": "Property name.", + "type": "string" }, { "name": "type", + "description": "Object type. Accessor means that the property itself is an accessor property.", "type": "string", "enum": [ "object", @@ -12301,25 +14062,25 @@ "boolean", "symbol", "accessor" - ], - "description": "Object type. Accessor means that the property itself is an accessor property." + ] }, { "name": "value", - "type": "string", + "description": "User-friendly property value string.", "optional": true, - "description": "User-friendly property value string." + "type": "string" }, { "name": "valuePreview", - "$ref": "ObjectPreview", + "description": "Nested value preview.", "optional": true, - "description": "Nested value preview." + "$ref": "ObjectPreview" }, { "name": "subtype", - "type": "string", + "description": "Object subtype hint. Specified for `object` type values only.", "optional": true, + "type": "string", "enum": [ "array", "null", @@ -12333,307 +14094,307 @@ "iterator", "generator", "error" - ], - "description": "Object subtype hint. Specified for object type values only." + ] } ] }, { "id": "EntryPreview", - "type": "object", "experimental": true, + "type": "object", "properties": [ { "name": "key", - "$ref": "ObjectPreview", + "description": "Preview of the key. Specified for map-like collection entries.", "optional": true, - "description": "Preview of the key. Specified for map-like collection entries." + "$ref": "ObjectPreview" }, { "name": "value", - "$ref": "ObjectPreview", - "description": "Preview of the value." + "description": "Preview of the value.", + "$ref": "ObjectPreview" } ] }, { "id": "PropertyDescriptor", - "type": "object", "description": "Object property descriptor.", + "type": "object", "properties": [ { "name": "name", - "type": "string", - "description": "Property name or symbol description." + "description": "Property name or symbol description.", + "type": "string" }, { "name": "value", - "$ref": "RemoteObject", + "description": "The value associated with the property.", "optional": true, - "description": "The value associated with the property." + "$ref": "RemoteObject" }, { "name": "writable", - "type": "boolean", + "description": "True if the value associated with the property may be changed (data descriptors only).", "optional": true, - "description": "True if the value associated with the property may be changed (data descriptors only)." + "type": "boolean" }, { "name": "get", - "$ref": "RemoteObject", + "description": "A function which serves as a getter for the property, or `undefined` if there is no getter\n(accessor descriptors only).", "optional": true, - "description": "A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only)." + "$ref": "RemoteObject" }, { "name": "set", - "$ref": "RemoteObject", + "description": "A function which serves as a setter for the property, or `undefined` if there is no setter\n(accessor descriptors only).", "optional": true, - "description": "A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only)." + "$ref": "RemoteObject" }, { "name": "configurable", - "type": "boolean", - "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." + "description": "True if the type of this property descriptor may be changed and if the property may be\ndeleted from the corresponding object.", + "type": "boolean" }, { "name": "enumerable", - "type": "boolean", - "description": "True if this property shows up during enumeration of the properties on the corresponding object." + "description": "True if this property shows up during enumeration of the properties on the corresponding\nobject.", + "type": "boolean" }, { "name": "wasThrown", - "type": "boolean", + "description": "True if the result was thrown during the evaluation.", "optional": true, - "description": "True if the result was thrown during the evaluation." + "type": "boolean" }, { "name": "isOwn", + "description": "True if the property is owned for the object.", "optional": true, - "type": "boolean", - "description": "True if the property is owned for the object." + "type": "boolean" }, { "name": "symbol", - "$ref": "RemoteObject", + "description": "Property symbol object, if the property is of the `symbol` type.", "optional": true, - "description": "Property symbol object, if the property is of the symbol type." + "$ref": "RemoteObject" } ] }, { "id": "InternalPropertyDescriptor", - "type": "object", "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.", + "type": "object", "properties": [ { "name": "name", - "type": "string", - "description": "Conventional property name." + "description": "Conventional property name.", + "type": "string" }, { "name": "value", - "$ref": "RemoteObject", + "description": "The value associated with the property.", "optional": true, - "description": "The value associated with the property." + "$ref": "RemoteObject" } ] }, { "id": "CallArgument", + "description": "Represents function call argument. Either remote object id `objectId`, primitive `value`,\nunserializable primitive value or neither of (for undefined) them should be specified.", "type": "object", - "description": "Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified.", "properties": [ { "name": "value", - "type": "any", + "description": "Primitive value or serializable javascript object.", "optional": true, - "description": "Primitive value or serializable javascript object." + "type": "any" }, { "name": "unserializableValue", - "$ref": "UnserializableValue", + "description": "Primitive value which can not be JSON-stringified.", "optional": true, - "description": "Primitive value which can not be JSON-stringified." + "$ref": "UnserializableValue" }, { "name": "objectId", - "$ref": "RemoteObjectId", + "description": "Remote object handle.", "optional": true, - "description": "Remote object handle." + "$ref": "RemoteObjectId" } ] }, { "id": "ExecutionContextId", - "type": "integer", - "description": "Id of an execution context." + "description": "Id of an execution context.", + "type": "integer" }, { "id": "ExecutionContextDescription", - "type": "object", "description": "Description of an isolated world.", + "type": "object", "properties": [ { "name": "id", - "$ref": "ExecutionContextId", - "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." + "description": "Unique id of the execution context. It can be used to specify in which execution context\nscript evaluation should be performed.", + "$ref": "ExecutionContextId" }, { "name": "origin", - "type": "string", - "description": "Execution context origin." + "description": "Execution context origin.", + "type": "string" }, { "name": "name", - "type": "string", - "description": "Human readable name describing given context." + "description": "Human readable name describing given context.", + "type": "string" }, { "name": "auxData", - "type": "object", + "description": "Embedder-specific auxiliary data.", "optional": true, - "description": "Embedder-specific auxiliary data." + "type": "object" } ] }, { "id": "ExceptionDetails", + "description": "Detailed information about exception (or error) that was thrown during script compilation or\nexecution.", "type": "object", - "description": "Detailed information about exception (or error) that was thrown during script compilation or execution.", "properties": [ { "name": "exceptionId", - "type": "integer", - "description": "Exception id." + "description": "Exception id.", + "type": "integer" }, { "name": "text", - "type": "string", - "description": "Exception text, which should be used together with exception object when available." + "description": "Exception text, which should be used together with exception object when available.", + "type": "string" }, { "name": "lineNumber", - "type": "integer", - "description": "Line number of the exception location (0-based)." + "description": "Line number of the exception location (0-based).", + "type": "integer" }, { "name": "columnNumber", - "type": "integer", - "description": "Column number of the exception location (0-based)." + "description": "Column number of the exception location (0-based).", + "type": "integer" }, { "name": "scriptId", - "$ref": "ScriptId", + "description": "Script ID of the exception location.", "optional": true, - "description": "Script ID of the exception location." + "$ref": "ScriptId" }, { "name": "url", - "type": "string", + "description": "URL of the exception location, to be used when the script was not reported.", "optional": true, - "description": "URL of the exception location, to be used when the script was not reported." + "type": "string" }, { "name": "stackTrace", - "$ref": "StackTrace", + "description": "JavaScript stack trace if available.", "optional": true, - "description": "JavaScript stack trace if available." + "$ref": "StackTrace" }, { "name": "exception", - "$ref": "RemoteObject", + "description": "Exception object if available.", "optional": true, - "description": "Exception object if available." + "$ref": "RemoteObject" }, { "name": "executionContextId", - "$ref": "ExecutionContextId", + "description": "Identifier of the context where exception happened.", "optional": true, - "description": "Identifier of the context where exception happened." + "$ref": "ExecutionContextId" } ] }, { "id": "Timestamp", - "type": "number", - "description": "Number of milliseconds since epoch." + "description": "Number of milliseconds since epoch.", + "type": "number" }, { "id": "CallFrame", - "type": "object", "description": "Stack entry for runtime errors and assertions.", + "type": "object", "properties": [ { "name": "functionName", - "type": "string", - "description": "JavaScript function name." + "description": "JavaScript function name.", + "type": "string" }, { "name": "scriptId", - "$ref": "ScriptId", - "description": "JavaScript script id." + "description": "JavaScript script id.", + "$ref": "ScriptId" }, { "name": "url", - "type": "string", - "description": "JavaScript script name or url." + "description": "JavaScript script name or url.", + "type": "string" }, { "name": "lineNumber", - "type": "integer", - "description": "JavaScript script line number (0-based)." + "description": "JavaScript script line number (0-based).", + "type": "integer" }, { "name": "columnNumber", - "type": "integer", - "description": "JavaScript script column number (0-based)." + "description": "JavaScript script column number (0-based).", + "type": "integer" } ] }, { "id": "StackTrace", - "type": "object", "description": "Call frames for assertions or error messages.", + "type": "object", "properties": [ { "name": "description", - "type": "string", + "description": "String label of this stack trace. For async traces this may be a name of the function that\ninitiated the async call.", "optional": true, - "description": "String label of this stack trace. For async traces this may be a name of the function that initiated the async call." + "type": "string" }, { "name": "callFrames", + "description": "JavaScript function name.", "type": "array", "items": { "$ref": "CallFrame" - }, - "description": "JavaScript function name." + } }, { "name": "parent", - "$ref": "StackTrace", + "description": "Asynchronous JavaScript stack trace that preceded this stack, if available.", "optional": true, - "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." + "$ref": "StackTrace" }, { "name": "parentId", - "$ref": "StackTraceId", - "optional": true, + "description": "Asynchronous JavaScript stack trace that preceded this stack, if available.", "experimental": true, - "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." + "optional": true, + "$ref": "StackTraceId" } ] }, { "id": "UniqueDebuggerId", - "type": "string", "description": "Unique identifier of current debugger.", - "experimental": true + "experimental": true, + "type": "string" }, { "id": "StackTraceId", + "description": "If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This\nallows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.", + "experimental": true, "type": "object", - "description": "If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages.", "properties": [ { "name": "id", @@ -12641,291 +14402,171 @@ }, { "name": "debuggerId", - "$ref": "UniqueDebuggerId", - "optional": true + "optional": true, + "$ref": "UniqueDebuggerId" } - ], - "experimental": true + ] } ], "commands": [ - { - "name": "evaluate", - "parameters": [ - { - "name": "expression", - "type": "string", - "description": "Expression to evaluate." - }, - { - "name": "objectGroup", - "type": "string", - "optional": true, - "description": "Symbolic group name that can be used to release multiple objects." - }, - { - "name": "includeCommandLineAPI", - "type": "boolean", - "optional": true, - "description": "Determines whether Command Line API should be available during the evaluation." - }, - { - "name": "silent", - "type": "boolean", - "optional": true, - "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state." - }, - { - "name": "contextId", - "$ref": "ExecutionContextId", - "optional": true, - "description": "Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page." - }, - { - "name": "returnByValue", - "type": "boolean", - "optional": true, - "description": "Whether the result is expected to be a JSON object that should be sent by value." - }, - { - "name": "generatePreview", - "type": "boolean", - "optional": true, - "experimental": true, - "description": "Whether preview should be generated for the result." - }, - { - "name": "userGesture", - "type": "boolean", - "optional": true, - "description": "Whether execution should be treated as initiated by user in the UI." - }, - { - "name": "awaitPromise", - "type": "boolean", - "optional": true, - "description": "Whether execution should await for resulting value and return once awaited promise is resolved." - } - ], - "returns": [ - { - "name": "result", - "$ref": "RemoteObject", - "description": "Evaluation result." - }, - { - "name": "exceptionDetails", - "$ref": "ExceptionDetails", - "optional": true, - "description": "Exception details." - } - ], - "description": "Evaluates expression on global object." - }, { "name": "awaitPromise", + "description": "Add handler to promise with given promise object id.", "parameters": [ { "name": "promiseObjectId", - "$ref": "RemoteObjectId", - "description": "Identifier of the promise." + "description": "Identifier of the promise.", + "$ref": "RemoteObjectId" }, { "name": "returnByValue", - "type": "boolean", + "description": "Whether the result is expected to be a JSON object that should be sent by value.", "optional": true, - "description": "Whether the result is expected to be a JSON object that should be sent by value." + "type": "boolean" }, { "name": "generatePreview", - "type": "boolean", + "description": "Whether preview should be generated for the result.", "optional": true, - "description": "Whether preview should be generated for the result." + "type": "boolean" } ], "returns": [ { "name": "result", - "$ref": "RemoteObject", - "description": "Promise result. Will contain rejected value if promise was rejected." + "description": "Promise result. Will contain rejected value if promise was rejected.", + "$ref": "RemoteObject" }, { "name": "exceptionDetails", - "$ref": "ExceptionDetails", + "description": "Exception details if stack strace is available.", "optional": true, - "description": "Exception details if stack strace is available." + "$ref": "ExceptionDetails" } - ], - "description": "Add handler to promise with given promise object id." + ] }, { "name": "callFunctionOn", + "description": "Calls function with given declaration on the given object. Object group of the result is\ninherited from the target object.", "parameters": [ { "name": "functionDeclaration", - "type": "string", - "description": "Declaration of the function to call." + "description": "Declaration of the function to call.", + "type": "string" }, { "name": "objectId", - "$ref": "RemoteObjectId", + "description": "Identifier of the object to call function on. Either objectId or executionContextId should\nbe specified.", "optional": true, - "description": "Identifier of the object to call function on. Either objectId or executionContextId should be specified." + "$ref": "RemoteObjectId" }, { "name": "arguments", + "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target\nobject.", + "optional": true, "type": "array", "items": { - "$ref": "CallArgument", - "description": "Call argument." - }, - "optional": true, - "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." + "$ref": "CallArgument" + } }, { "name": "silent", - "type": "boolean", + "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.", "optional": true, - "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state." + "type": "boolean" }, { "name": "returnByValue", - "type": "boolean", + "description": "Whether the result is expected to be a JSON object which should be sent by value.", "optional": true, - "description": "Whether the result is expected to be a JSON object which should be sent by value." + "type": "boolean" }, { "name": "generatePreview", - "type": "boolean", - "optional": true, + "description": "Whether preview should be generated for the result.", "experimental": true, - "description": "Whether preview should be generated for the result." + "optional": true, + "type": "boolean" }, { "name": "userGesture", - "type": "boolean", + "description": "Whether execution should be treated as initiated by user in the UI.", "optional": true, - "description": "Whether execution should be treated as initiated by user in the UI." + "type": "boolean" }, { "name": "awaitPromise", - "type": "boolean", + "description": "Whether execution should `await` for resulting value and return once awaited promise is\nresolved.", "optional": true, - "description": "Whether execution should await for resulting value and return once awaited promise is resolved." + "type": "boolean" }, { "name": "executionContextId", - "$ref": "ExecutionContextId", + "description": "Specifies execution context which global object will be used to call function on. Either\nexecutionContextId or objectId should be specified.", "optional": true, - "description": "Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified." + "$ref": "ExecutionContextId" }, { "name": "objectGroup", - "type": "string", + "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, - "description": "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." + "type": "string" } ], "returns": [ { "name": "result", - "$ref": "RemoteObject", - "description": "Call result." + "description": "Call result.", + "$ref": "RemoteObject" }, { "name": "exceptionDetails", - "$ref": "ExceptionDetails", + "description": "Exception details.", "optional": true, - "description": "Exception details." + "$ref": "ExceptionDetails" } - ], - "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object." + ] }, { - "name": "getProperties", + "name": "compileScript", + "description": "Compiles expression.", "parameters": [ { - "name": "objectId", - "$ref": "RemoteObjectId", - "description": "Identifier of the object to return properties for." + "name": "expression", + "description": "Expression to compile.", + "type": "string" }, { - "name": "ownProperties", - "optional": true, - "type": "boolean", - "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." + "name": "sourceURL", + "description": "Source url to be set for the script.", + "type": "string" }, { - "name": "accessorPropertiesOnly", - "optional": true, - "type": "boolean", - "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.", - "experimental": true + "name": "persistScript", + "description": "Specifies whether the compiled script should be persisted.", + "type": "boolean" }, { - "name": "generatePreview", - "type": "boolean", + "name": "executionContextId", + "description": "Specifies in which execution context to perform script run. If the parameter is omitted the\nevaluation will be performed in the context of the inspected page.", "optional": true, - "experimental": true, - "description": "Whether preview should be generated for the results." + "$ref": "ExecutionContextId" } ], "returns": [ { - "name": "result", - "type": "array", - "items": { - "$ref": "PropertyDescriptor" - }, - "description": "Object properties." - }, - { - "name": "internalProperties", + "name": "scriptId", + "description": "Id of the script.", "optional": true, - "type": "array", - "items": { - "$ref": "InternalPropertyDescriptor" - }, - "description": "Internal object properties (only of the element itself)." + "$ref": "ScriptId" }, { "name": "exceptionDetails", - "$ref": "ExceptionDetails", + "description": "Exception details.", "optional": true, - "description": "Exception details." + "$ref": "ExceptionDetails" } - ], - "description": "Returns properties of a given object. Object group of the result is inherited from the target object." - }, - { - "name": "releaseObject", - "parameters": [ - { - "name": "objectId", - "$ref": "RemoteObjectId", - "description": "Identifier of the object to release." - } - ], - "description": "Releases remote object with given id." - }, - { - "name": "releaseObjectGroup", - "parameters": [ - { - "name": "objectGroup", - "type": "string", - "description": "Symbolic object group name." - } - ], - "description": "Releases all remote objects that belong to a given group." - }, - { - "name": "runIfWaitingForDebugger", - "description": "Tells inspected instance to run if it was waiting for debugger to attach." - }, - { - "name": "enable", - "description": "Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context." + ] }, { "name": "disable", @@ -12936,147 +14577,147 @@ "description": "Discards collected exceptions and console API calls." }, { - "name": "setCustomObjectFormatterEnabled", - "parameters": [ - { - "name": "enabled", - "type": "boolean" - } - ], - "experimental": true + "name": "enable", + "description": "Enables reporting of execution contexts creation by means of `executionContextCreated` event.\nWhen the reporting gets enabled the event will be sent immediately for each existing execution\ncontext." }, { - "name": "compileScript", + "name": "evaluate", + "description": "Evaluates expression on global object.", "parameters": [ { "name": "expression", - "type": "string", - "description": "Expression to compile." - }, - { - "name": "sourceURL", - "type": "string", - "description": "Source url to be set for the script." - }, - { - "name": "persistScript", - "type": "boolean", - "description": "Specifies whether the compiled script should be persisted." - }, - { - "name": "executionContextId", - "$ref": "ExecutionContextId", - "optional": true, - "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." - } - ], - "returns": [ - { - "name": "scriptId", - "$ref": "ScriptId", - "optional": true, - "description": "Id of the script." - }, - { - "name": "exceptionDetails", - "$ref": "ExceptionDetails", - "optional": true, - "description": "Exception details." - } - ], - "description": "Compiles expression." - }, - { - "name": "runScript", - "parameters": [ - { - "name": "scriptId", - "$ref": "ScriptId", - "description": "Id of the script to run." - }, - { - "name": "executionContextId", - "$ref": "ExecutionContextId", - "optional": true, - "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." + "description": "Expression to evaluate.", + "type": "string" }, { "name": "objectGroup", - "type": "string", + "description": "Symbolic group name that can be used to release multiple objects.", "optional": true, - "description": "Symbolic group name that can be used to release multiple objects." - }, - { - "name": "silent", - "type": "boolean", - "optional": true, - "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state." + "type": "string" }, { "name": "includeCommandLineAPI", - "type": "boolean", + "description": "Determines whether Command Line API should be available during the evaluation.", "optional": true, - "description": "Determines whether Command Line API should be available during the evaluation." + "type": "boolean" + }, + { + "name": "silent", + "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.", + "optional": true, + "type": "boolean" + }, + { + "name": "contextId", + "description": "Specifies in which execution context to perform evaluation. If the parameter is omitted the\nevaluation will be performed in the context of the inspected page.", + "optional": true, + "$ref": "ExecutionContextId" }, { "name": "returnByValue", - "type": "boolean", + "description": "Whether the result is expected to be a JSON object that should be sent by value.", "optional": true, - "description": "Whether the result is expected to be a JSON object which should be sent by value." + "type": "boolean" }, { "name": "generatePreview", - "type": "boolean", + "description": "Whether preview should be generated for the result.", + "experimental": true, "optional": true, - "description": "Whether preview should be generated for the result." + "type": "boolean" + }, + { + "name": "userGesture", + "description": "Whether execution should be treated as initiated by user in the UI.", + "optional": true, + "type": "boolean" }, { "name": "awaitPromise", - "type": "boolean", + "description": "Whether execution should `await` for resulting value and return once awaited promise is\nresolved.", "optional": true, - "description": "Whether execution should await for resulting value and return once awaited promise is resolved." + "type": "boolean" } ], "returns": [ { "name": "result", - "$ref": "RemoteObject", - "description": "Run result." + "description": "Evaluation result.", + "$ref": "RemoteObject" }, { "name": "exceptionDetails", - "$ref": "ExceptionDetails", + "description": "Exception details.", "optional": true, - "description": "Exception details." + "$ref": "ExceptionDetails" } - ], - "description": "Runs script with given id in a given context." + ] }, { - "name": "queryObjects", + "name": "getProperties", + "description": "Returns properties of a given object. Object group of the result is inherited from the target\nobject.", "parameters": [ { - "name": "prototypeObjectId", - "$ref": "RemoteObjectId", - "description": "Identifier of the prototype to return objects for." + "name": "objectId", + "description": "Identifier of the object to return properties for.", + "$ref": "RemoteObjectId" + }, + { + "name": "ownProperties", + "description": "If true, returns properties belonging only to the element itself, not to its prototype\nchain.", + "optional": true, + "type": "boolean" + }, + { + "name": "accessorPropertiesOnly", + "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not\nreturned either.", + "experimental": true, + "optional": true, + "type": "boolean" + }, + { + "name": "generatePreview", + "description": "Whether preview should be generated for the results.", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ { - "name": "objects", - "$ref": "RemoteObject", - "description": "Array with objects." + "name": "result", + "description": "Object properties.", + "type": "array", + "items": { + "$ref": "PropertyDescriptor" + } + }, + { + "name": "internalProperties", + "description": "Internal object properties (only of the element itself).", + "optional": true, + "type": "array", + "items": { + "$ref": "InternalPropertyDescriptor" + } + }, + { + "name": "exceptionDetails", + "description": "Exception details.", + "optional": true, + "$ref": "ExceptionDetails" } ] }, { "name": "globalLexicalScopeNames", + "description": "Returns all let, const and class variables from global scope.", "parameters": [ { "name": "executionContextId", - "$ref": "ExecutionContextId", + "description": "Specifies in which execution context to lookup global scope variables.", "optional": true, - "description": "Specifies in which execution context to lookup global scope variables." + "$ref": "ExecutionContextId" } ], "returns": [ @@ -13087,74 +14728,136 @@ "type": "string" } } - ], - "description": "Returns all let, const and class variables from global scope." - } - ], - "events": [ - { - "name": "executionContextCreated", - "parameters": [ - { - "name": "context", - "$ref": "ExecutionContextDescription", - "description": "A newly created execution context." - } - ], - "description": "Issued when new execution context is created." + ] }, { - "name": "executionContextDestroyed", + "name": "queryObjects", "parameters": [ + { + "name": "prototypeObjectId", + "description": "Identifier of the prototype to return objects for.", + "$ref": "RemoteObjectId" + } + ], + "returns": [ + { + "name": "objects", + "description": "Array with objects.", + "$ref": "RemoteObject" + } + ] + }, + { + "name": "releaseObject", + "description": "Releases remote object with given id.", + "parameters": [ + { + "name": "objectId", + "description": "Identifier of the object to release.", + "$ref": "RemoteObjectId" + } + ] + }, + { + "name": "releaseObjectGroup", + "description": "Releases all remote objects that belong to a given group.", + "parameters": [ + { + "name": "objectGroup", + "description": "Symbolic object group name.", + "type": "string" + } + ] + }, + { + "name": "runIfWaitingForDebugger", + "description": "Tells inspected instance to run if it was waiting for debugger to attach." + }, + { + "name": "runScript", + "description": "Runs script with given id in a given context.", + "parameters": [ + { + "name": "scriptId", + "description": "Id of the script to run.", + "$ref": "ScriptId" + }, { "name": "executionContextId", - "$ref": "ExecutionContextId", - "description": "Id of the destroyed context" + "description": "Specifies in which execution context to perform script run. If the parameter is omitted the\nevaluation will be performed in the context of the inspected page.", + "optional": true, + "$ref": "ExecutionContextId" + }, + { + "name": "objectGroup", + "description": "Symbolic group name that can be used to release multiple objects.", + "optional": true, + "type": "string" + }, + { + "name": "silent", + "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.", + "optional": true, + "type": "boolean" + }, + { + "name": "includeCommandLineAPI", + "description": "Determines whether Command Line API should be available during the evaluation.", + "optional": true, + "type": "boolean" + }, + { + "name": "returnByValue", + "description": "Whether the result is expected to be a JSON object which should be sent by value.", + "optional": true, + "type": "boolean" + }, + { + "name": "generatePreview", + "description": "Whether preview should be generated for the result.", + "optional": true, + "type": "boolean" + }, + { + "name": "awaitPromise", + "description": "Whether execution should `await` for resulting value and return once awaited promise is\nresolved.", + "optional": true, + "type": "boolean" } ], - "description": "Issued when execution context is destroyed." - }, - { - "name": "executionContextsCleared", - "description": "Issued when all executionContexts were cleared in browser" - }, - { - "name": "exceptionThrown", - "description": "Issued when exception was thrown and unhandled.", - "parameters": [ + "returns": [ { - "name": "timestamp", - "$ref": "Timestamp", - "description": "Timestamp of the exception." + "name": "result", + "description": "Run result.", + "$ref": "RemoteObject" }, { "name": "exceptionDetails", + "description": "Exception details.", + "optional": true, "$ref": "ExceptionDetails" } ] }, { - "name": "exceptionRevoked", - "description": "Issued when unhandled exception was revoked.", + "name": "setCustomObjectFormatterEnabled", + "experimental": true, "parameters": [ { - "name": "reason", - "type": "string", - "description": "Reason describing why exception was revoked." - }, - { - "name": "exceptionId", - "type": "integer", - "description": "The id of revoked exception, as reported in exceptionThrown." + "name": "enabled", + "type": "boolean" } ] - }, + } + ], + "events": [ { "name": "consoleAPICalled", "description": "Issued when console API was called.", "parameters": [ { "name": "type", + "description": "Type of the call.", "type": "string", "enum": [ "log", @@ -13175,45 +14878,101 @@ "profileEnd", "count", "timeEnd" - ], - "description": "Type of the call." + ] }, { "name": "args", + "description": "Call arguments.", "type": "array", "items": { "$ref": "RemoteObject" - }, - "description": "Call arguments." + } }, { "name": "executionContextId", - "$ref": "ExecutionContextId", - "description": "Identifier of the context where the call was made." + "description": "Identifier of the context where the call was made.", + "$ref": "ExecutionContextId" }, { "name": "timestamp", - "$ref": "Timestamp", - "description": "Call timestamp." + "description": "Call timestamp.", + "$ref": "Timestamp" }, { "name": "stackTrace", - "$ref": "StackTrace", + "description": "Stack trace captured when the call was made.", "optional": true, - "description": "Stack trace captured when the call was made." + "$ref": "StackTrace" }, { "name": "context", - "type": "string", - "optional": true, + "description": "Console context descriptor for calls on non-default console context (not console.*):\n'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call\non named context.", "experimental": true, - "description": "Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context." + "optional": true, + "type": "string" } ] }, + { + "name": "exceptionRevoked", + "description": "Issued when unhandled exception was revoked.", + "parameters": [ + { + "name": "reason", + "description": "Reason describing why exception was revoked.", + "type": "string" + }, + { + "name": "exceptionId", + "description": "The id of revoked exception, as reported in `exceptionThrown`.", + "type": "integer" + } + ] + }, + { + "name": "exceptionThrown", + "description": "Issued when exception was thrown and unhandled.", + "parameters": [ + { + "name": "timestamp", + "description": "Timestamp of the exception.", + "$ref": "Timestamp" + }, + { + "name": "exceptionDetails", + "$ref": "ExceptionDetails" + } + ] + }, + { + "name": "executionContextCreated", + "description": "Issued when new execution context is created.", + "parameters": [ + { + "name": "context", + "description": "A newly created execution context.", + "$ref": "ExecutionContextDescription" + } + ] + }, + { + "name": "executionContextDestroyed", + "description": "Issued when execution context is destroyed.", + "parameters": [ + { + "name": "executionContextId", + "description": "Id of the destroyed context", + "$ref": "ExecutionContextId" + } + ] + }, + { + "name": "executionContextsCleared", + "description": "Issued when all executionContexts were cleared in browser" + }, { "name": "inspectRequested", - "description": "Issued when object should be inspected (for example, as a result of inspect() command line API call).", + "description": "Issued when object should be inspected (for example, as a result of inspect() command line API\ncall).", "parameters": [ { "name": "object", @@ -13228,1761 +14987,40 @@ ] }, { - "domain": "Debugger", - "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.", - "dependencies": [ - "Runtime" - ], - "types": [ - { - "id": "BreakpointId", - "type": "string", - "description": "Breakpoint identifier." - }, - { - "id": "CallFrameId", - "type": "string", - "description": "Call frame identifier." - }, - { - "id": "Location", - "type": "object", - "properties": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Script identifier as reported in the Debugger.scriptParsed." - }, - { - "name": "lineNumber", - "type": "integer", - "description": "Line number in the script (0-based)." - }, - { - "name": "columnNumber", - "type": "integer", - "optional": true, - "description": "Column number in the script (0-based)." - } - ], - "description": "Location in the source code." - }, - { - "id": "ScriptPosition", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "lineNumber", - "type": "integer" - }, - { - "name": "columnNumber", - "type": "integer" - } - ], - "description": "Location in the source code." - }, - { - "id": "CallFrame", - "type": "object", - "properties": [ - { - "name": "callFrameId", - "$ref": "CallFrameId", - "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." - }, - { - "name": "functionName", - "type": "string", - "description": "Name of the JavaScript function called on this call frame." - }, - { - "name": "functionLocation", - "$ref": "Location", - "optional": true, - "description": "Location in the source code." - }, - { - "name": "location", - "$ref": "Location", - "description": "Location in the source code." - }, - { - "name": "url", - "type": "string", - "description": "JavaScript script name or url." - }, - { - "name": "scopeChain", - "type": "array", - "items": { - "$ref": "Scope" - }, - "description": "Scope chain for this call frame." - }, - { - "name": "this", - "$ref": "Runtime.RemoteObject", - "description": "this object for this call frame." - }, - { - "name": "returnValue", - "$ref": "Runtime.RemoteObject", - "optional": true, - "description": "The value being returned, if the function is at return point." - } - ], - "description": "JavaScript call frame. Array of call frames form the call stack." - }, - { - "id": "Scope", - "type": "object", - "properties": [ - { - "name": "type", - "type": "string", - "enum": [ - "global", - "local", - "with", - "closure", - "catch", - "block", - "script", - "eval", - "module" - ], - "description": "Scope type." - }, - { - "name": "object", - "$ref": "Runtime.RemoteObject", - "description": "Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." - }, - { - "name": "name", - "type": "string", - "optional": true - }, - { - "name": "startLocation", - "$ref": "Location", - "optional": true, - "description": "Location in the source code where scope starts" - }, - { - "name": "endLocation", - "$ref": "Location", - "optional": true, - "description": "Location in the source code where scope ends" - } - ], - "description": "Scope description." - }, - { - "id": "SearchMatch", - "type": "object", - "description": "Search match for resource.", - "properties": [ - { - "name": "lineNumber", - "type": "number", - "description": "Line number in resource content." - }, - { - "name": "lineContent", - "type": "string", - "description": "Line with match content." - } - ] - }, - { - "id": "BreakLocation", - "type": "object", - "properties": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Script identifier as reported in the Debugger.scriptParsed." - }, - { - "name": "lineNumber", - "type": "integer", - "description": "Line number in the script (0-based)." - }, - { - "name": "columnNumber", - "type": "integer", - "optional": true, - "description": "Column number in the script (0-based)." - }, - { - "name": "type", - "type": "string", - "enum": [ - "debuggerStatement", - "call", - "return" - ], - "optional": true - } - ] - } - ], - "commands": [ - { - "name": "enable", - "returns": [ - { - "name": "debuggerId", - "$ref": "Runtime.UniqueDebuggerId", - "experimental": true, - "description": "Unique identifier of the debugger." - } - ], - "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received." - }, - { - "name": "disable", - "description": "Disables debugger for given page." - }, - { - "name": "setBreakpointsActive", - "parameters": [ - { - "name": "active", - "type": "boolean", - "description": "New value for breakpoints active state." - } - ], - "description": "Activates / deactivates all breakpoints on the page." - }, - { - "name": "setSkipAllPauses", - "parameters": [ - { - "name": "skip", - "type": "boolean", - "description": "New value for skip pauses state." - } - ], - "description": "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc)." - }, - { - "name": "setBreakpointByUrl", - "parameters": [ - { - "name": "lineNumber", - "type": "integer", - "description": "Line number to set breakpoint at." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "URL of the resources to set breakpoint on." - }, - { - "name": "urlRegex", - "type": "string", - "optional": true, - "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified." - }, - { - "name": "scriptHash", - "type": "string", - "optional": true, - "description": "Script hash of the resources to set breakpoint on." - }, - { - "name": "columnNumber", - "type": "integer", - "optional": true, - "description": "Offset in the line to set breakpoint at." - }, - { - "name": "condition", - "type": "string", - "optional": true, - "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." - } - ], - "returns": [ - { - "name": "breakpointId", - "$ref": "BreakpointId", - "description": "Id of the created breakpoint for further reference." - }, - { - "name": "locations", - "type": "array", - "items": { - "$ref": "Location" - }, - "description": "List of the locations this breakpoint resolved into upon addition." - } - ], - "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads." - }, - { - "name": "setBreakpoint", - "parameters": [ - { - "name": "location", - "$ref": "Location", - "description": "Location to set breakpoint in." - }, - { - "name": "condition", - "type": "string", - "optional": true, - "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." - } - ], - "returns": [ - { - "name": "breakpointId", - "$ref": "BreakpointId", - "description": "Id of the created breakpoint for further reference." - }, - { - "name": "actualLocation", - "$ref": "Location", - "description": "Location this breakpoint resolved into." - } - ], - "description": "Sets JavaScript breakpoint at a given location." - }, - { - "name": "removeBreakpoint", - "parameters": [ - { - "name": "breakpointId", - "$ref": "BreakpointId" - } - ], - "description": "Removes JavaScript breakpoint." - }, - { - "name": "getPossibleBreakpoints", - "parameters": [ - { - "name": "start", - "$ref": "Location", - "description": "Start of range to search possible breakpoint locations in." - }, - { - "name": "end", - "$ref": "Location", - "optional": true, - "description": "End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range." - }, - { - "name": "restrictToFunction", - "type": "boolean", - "optional": true, - "description": "Only consider locations which are in the same (non-nested) function as start." - } - ], - "returns": [ - { - "name": "locations", - "type": "array", - "items": { - "$ref": "BreakLocation" - }, - "description": "List of the possible breakpoint locations." - } - ], - "description": "Returns possible locations for breakpoint. scriptId in start and end range locations should be the same." - }, - { - "name": "continueToLocation", - "parameters": [ - { - "name": "location", - "$ref": "Location", - "description": "Location to continue to." - }, - { - "name": "targetCallFrames", - "type": "string", - "enum": [ - "any", - "current" - ], - "optional": true - } - ], - "description": "Continues execution until specific location is reached." - }, - { - "name": "pauseOnAsyncCall", - "parameters": [ - { - "name": "parentStackTraceId", - "$ref": "Runtime.StackTraceId", - "description": "Debugger will pause when async call with given stack trace is started." - } - ], - "experimental": true - }, - { - "name": "stepOver", - "description": "Steps over the statement." - }, - { - "name": "stepInto", - "parameters": [ - { - "name": "breakOnAsyncCall", - "type": "boolean", - "optional": true, - "experimental": true, - "description": "Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause." - } - ], - "description": "Steps into the function call." - }, - { - "name": "stepOut", - "description": "Steps out of the function call." - }, - { - "name": "pause", - "description": "Stops on the next JavaScript statement." - }, - { - "name": "scheduleStepIntoAsync", - "description": "This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.", - "experimental": true - }, - { - "name": "resume", - "description": "Resumes JavaScript execution." - }, - { - "name": "getStackTrace", - "parameters": [ - { - "name": "stackTraceId", - "$ref": "Runtime.StackTraceId" - } - ], - "returns": [ - { - "name": "stackTrace", - "$ref": "Runtime.StackTrace" - } - ], - "description": "Returns stack trace with given stackTraceId.", - "experimental": true - }, - { - "name": "searchInContent", - "parameters": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Id of the script to search in." - }, - { - "name": "query", - "type": "string", - "description": "String to search for." - }, - { - "name": "caseSensitive", - "type": "boolean", - "optional": true, - "description": "If true, search is case sensitive." - }, - { - "name": "isRegex", - "type": "boolean", - "optional": true, - "description": "If true, treats string parameter as regex." - } - ], - "returns": [ - { - "name": "result", - "type": "array", - "items": { - "$ref": "SearchMatch" - }, - "description": "List of search matches." - } - ], - "description": "Searches for given string in script content." - }, - { - "name": "setScriptSource", - "parameters": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Id of the script to edit." - }, - { - "name": "scriptSource", - "type": "string", - "description": "New content of the script." - }, - { - "name": "dryRun", - "type": "boolean", - "optional": true, - "description": " If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code." - } - ], - "returns": [ - { - "name": "callFrames", - "type": "array", - "optional": true, - "items": { - "$ref": "CallFrame" - }, - "description": "New stack trace in case editing has happened while VM was stopped." - }, - { - "name": "stackChanged", - "type": "boolean", - "optional": true, - "description": "Whether current call stack was modified after applying the changes." - }, - { - "name": "asyncStackTrace", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "Async stack trace, if any." - }, - { - "name": "asyncStackTraceId", - "$ref": "Runtime.StackTraceId", - "optional": true, - "experimental": true, - "description": "Async stack trace, if any." - }, - { - "name": "exceptionDetails", - "optional": true, - "$ref": "Runtime.ExceptionDetails", - "description": "Exception details if any." - } - ], - "description": "Edits JavaScript source live." - }, - { - "name": "restartFrame", - "parameters": [ - { - "name": "callFrameId", - "$ref": "CallFrameId", - "description": "Call frame identifier to evaluate on." - } - ], - "returns": [ - { - "name": "callFrames", - "type": "array", - "items": { - "$ref": "CallFrame" - }, - "description": "New stack trace." - }, - { - "name": "asyncStackTrace", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "Async stack trace, if any." - }, - { - "name": "asyncStackTraceId", - "$ref": "Runtime.StackTraceId", - "optional": true, - "experimental": true, - "description": "Async stack trace, if any." - } - ], - "description": "Restarts particular call frame from the beginning." - }, - { - "name": "getScriptSource", - "parameters": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Id of the script to get source for." - } - ], - "returns": [ - { - "name": "scriptSource", - "type": "string", - "description": "Script source." - } - ], - "description": "Returns source for the script with given id." - }, - { - "name": "setPauseOnExceptions", - "parameters": [ - { - "name": "state", - "type": "string", - "enum": [ - "none", - "uncaught", - "all" - ], - "description": "Pause on exceptions mode." - } - ], - "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none." - }, - { - "name": "evaluateOnCallFrame", - "parameters": [ - { - "name": "callFrameId", - "$ref": "CallFrameId", - "description": "Call frame identifier to evaluate on." - }, - { - "name": "expression", - "type": "string", - "description": "Expression to evaluate." - }, - { - "name": "objectGroup", - "type": "string", - "optional": true, - "description": "String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup)." - }, - { - "name": "includeCommandLineAPI", - "type": "boolean", - "optional": true, - "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." - }, - { - "name": "silent", - "type": "boolean", - "optional": true, - "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state." - }, - { - "name": "returnByValue", - "type": "boolean", - "optional": true, - "description": "Whether the result is expected to be a JSON object that should be sent by value." - }, - { - "name": "generatePreview", - "type": "boolean", - "optional": true, - "experimental": true, - "description": "Whether preview should be generated for the result." - }, - { - "name": "throwOnSideEffect", - "type": "boolean", - "optional": true, - "description": "Whether to throw an exception if side effect cannot be ruled out during evaluation." - } - ], - "returns": [ - { - "name": "result", - "$ref": "Runtime.RemoteObject", - "description": "Object wrapper for the evaluation result." - }, - { - "name": "exceptionDetails", - "$ref": "Runtime.ExceptionDetails", - "optional": true, - "description": "Exception details." - } - ], - "description": "Evaluates expression on a given call frame." - }, - { - "name": "setVariableValue", - "parameters": [ - { - "name": "scopeNumber", - "type": "integer", - "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually." - }, - { - "name": "variableName", - "type": "string", - "description": "Variable name." - }, - { - "name": "newValue", - "$ref": "Runtime.CallArgument", - "description": "New variable value." - }, - { - "name": "callFrameId", - "$ref": "CallFrameId", - "description": "Id of callframe that holds variable." - } - ], - "description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually." - }, - { - "name": "setReturnValue", - "parameters": [ - { - "name": "newValue", - "$ref": "Runtime.CallArgument", - "description": "New return value." - } - ], - "experimental": true, - "description": "Changes return value in top frame. Available only at return break position." - }, - { - "name": "setAsyncCallStackDepth", - "parameters": [ - { - "name": "maxDepth", - "type": "integer", - "description": "Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default)." - } - ], - "description": "Enables or disables async call stacks tracking." - }, - { - "name": "setBlackboxPatterns", - "parameters": [ - { - "name": "patterns", - "type": "array", - "items": { - "type": "string" - }, - "description": "Array of regexps that will be used to check script url for blackbox state." - } - ], - "experimental": true, - "description": "Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful." - }, - { - "name": "setBlackboxedRanges", - "parameters": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Id of the script." - }, - { - "name": "positions", - "type": "array", - "items": { - "$ref": "ScriptPosition" - } - } - ], - "experimental": true, - "description": "Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted." - } - ], - "events": [ - { - "name": "scriptParsed", - "parameters": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Identifier of the script parsed." - }, - { - "name": "url", - "type": "string", - "description": "URL or name of the script parsed (if any)." - }, - { - "name": "startLine", - "type": "integer", - "description": "Line offset of the script within the resource with given URL (for script tags)." - }, - { - "name": "startColumn", - "type": "integer", - "description": "Column offset of the script within the resource with given URL." - }, - { - "name": "endLine", - "type": "integer", - "description": "Last line of the script." - }, - { - "name": "endColumn", - "type": "integer", - "description": "Length of the last line of the script." - }, - { - "name": "executionContextId", - "$ref": "Runtime.ExecutionContextId", - "description": "Specifies script creation context." - }, - { - "name": "hash", - "type": "string", - "description": "Content hash of the script." - }, - { - "name": "executionContextAuxData", - "type": "object", - "optional": true, - "description": "Embedder-specific auxiliary data." - }, - { - "name": "isLiveEdit", - "type": "boolean", - "optional": true, - "description": "True, if this script is generated as a result of the live edit operation.", - "experimental": true - }, - { - "name": "sourceMapURL", - "type": "string", - "optional": true, - "description": "URL of source map associated with script (if any)." - }, - { - "name": "hasSourceURL", - "type": "boolean", - "optional": true, - "description": "True, if this script has sourceURL." - }, - { - "name": "isModule", - "type": "boolean", - "optional": true, - "description": "True, if this script is ES6 module." - }, - { - "name": "length", - "type": "integer", - "optional": true, - "description": "This script length." - }, - { - "name": "stackTrace", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", - "experimental": true - } - ], - "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger." - }, - { - "name": "scriptFailedToParse", - "parameters": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "Identifier of the script parsed." - }, - { - "name": "url", - "type": "string", - "description": "URL or name of the script parsed (if any)." - }, - { - "name": "startLine", - "type": "integer", - "description": "Line offset of the script within the resource with given URL (for script tags)." - }, - { - "name": "startColumn", - "type": "integer", - "description": "Column offset of the script within the resource with given URL." - }, - { - "name": "endLine", - "type": "integer", - "description": "Last line of the script." - }, - { - "name": "endColumn", - "type": "integer", - "description": "Length of the last line of the script." - }, - { - "name": "executionContextId", - "$ref": "Runtime.ExecutionContextId", - "description": "Specifies script creation context." - }, - { - "name": "hash", - "type": "string", - "description": "Content hash of the script." - }, - { - "name": "executionContextAuxData", - "type": "object", - "optional": true, - "description": "Embedder-specific auxiliary data." - }, - { - "name": "sourceMapURL", - "type": "string", - "optional": true, - "description": "URL of source map associated with script (if any)." - }, - { - "name": "hasSourceURL", - "type": "boolean", - "optional": true, - "description": "True, if this script has sourceURL." - }, - { - "name": "isModule", - "type": "boolean", - "optional": true, - "description": "True, if this script is ES6 module." - }, - { - "name": "length", - "type": "integer", - "optional": true, - "description": "This script length." - }, - { - "name": "stackTrace", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", - "experimental": true - } - ], - "description": "Fired when virtual machine fails to parse the script." - }, - { - "name": "breakpointResolved", - "parameters": [ - { - "name": "breakpointId", - "$ref": "BreakpointId", - "description": "Breakpoint unique identifier." - }, - { - "name": "location", - "$ref": "Location", - "description": "Actual breakpoint location." - } - ], - "description": "Fired when breakpoint is resolved to an actual script and location." - }, - { - "name": "paused", - "parameters": [ - { - "name": "callFrames", - "type": "array", - "items": { - "$ref": "CallFrame" - }, - "description": "Call stack the virtual machine stopped on." - }, - { - "name": "reason", - "type": "string", - "enum": [ - "XHR", - "DOM", - "EventListener", - "exception", - "assert", - "debugCommand", - "promiseRejection", - "OOM", - "other", - "ambiguous" - ], - "description": "Pause reason." - }, - { - "name": "data", - "type": "object", - "optional": true, - "description": "Object containing break-specific auxiliary properties." - }, - { - "name": "hitBreakpoints", - "type": "array", - "optional": true, - "items": { - "type": "string" - }, - "description": "Hit breakpoints IDs" - }, - { - "name": "asyncStackTrace", - "$ref": "Runtime.StackTrace", - "optional": true, - "description": "Async stack trace, if any." - }, - { - "name": "asyncStackTraceId", - "$ref": "Runtime.StackTraceId", - "optional": true, - "experimental": true, - "description": "Async stack trace, if any." - }, - { - "name": "asyncCallStackTraceId", - "$ref": "Runtime.StackTraceId", - "optional": true, - "experimental": true, - "description": "Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag." - } - ], - "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria." - }, - { - "name": "resumed", - "description": "Fired when the virtual machine resumed execution." - } - ] - }, - { - "domain": "Console", - "description": "This domain is deprecated - use Runtime or Log instead.", - "dependencies": [ - "Runtime" - ], + "domain": "Schema", + "description": "This domain is deprecated.", "deprecated": true, "types": [ { - "id": "ConsoleMessage", + "id": "Domain", + "description": "Description of the protocol domain.", "type": "object", - "description": "Console message.", - "properties": [ - { - "name": "source", - "type": "string", - "enum": [ - "xml", - "javascript", - "network", - "console-api", - "storage", - "appcache", - "rendering", - "security", - "other", - "deprecation", - "worker" - ], - "description": "Message source." - }, - { - "name": "level", - "type": "string", - "enum": [ - "log", - "warning", - "error", - "debug", - "info" - ], - "description": "Message severity." - }, - { - "name": "text", - "type": "string", - "description": "Message text." - }, - { - "name": "url", - "type": "string", - "optional": true, - "description": "URL of the message origin." - }, - { - "name": "line", - "type": "integer", - "optional": true, - "description": "Line number in the resource that generated this message (1-based)." - }, - { - "name": "column", - "type": "integer", - "optional": true, - "description": "Column number in the resource that generated this message (1-based)." - } - ] - } - ], - "commands": [ - { - "name": "enable", - "description": "Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification." - }, - { - "name": "disable", - "description": "Disables console domain, prevents further console messages from being reported to the client." - }, - { - "name": "clearMessages", - "description": "Does nothing." - } - ], - "events": [ - { - "name": "messageAdded", - "parameters": [ - { - "name": "message", - "$ref": "ConsoleMessage", - "description": "Console message that has been added." - } - ], - "description": "Issued when new console message is added." - } - ] - }, - { - "domain": "Profiler", - "dependencies": [ - "Runtime", - "Debugger" - ], - "types": [ - { - "id": "ProfileNode", - "type": "object", - "description": "Profile node. Holds callsite information, execution statistics and child nodes.", - "properties": [ - { - "name": "id", - "type": "integer", - "description": "Unique id of the node." - }, - { - "name": "callFrame", - "$ref": "Runtime.CallFrame", - "description": "Function location." - }, - { - "name": "hitCount", - "type": "integer", - "optional": true, - "description": "Number of samples where this node was on top of the call stack." - }, - { - "name": "children", - "type": "array", - "items": { - "type": "integer" - }, - "optional": true, - "description": "Child node ids." - }, - { - "name": "deoptReason", - "type": "string", - "optional": true, - "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize." - }, - { - "name": "positionTicks", - "type": "array", - "items": { - "$ref": "PositionTickInfo" - }, - "optional": true, - "description": "An array of source position ticks." - } - ] - }, - { - "id": "Profile", - "type": "object", - "description": "Profile.", - "properties": [ - { - "name": "nodes", - "type": "array", - "items": { - "$ref": "ProfileNode" - }, - "description": "The list of profile nodes. First item is the root node." - }, - { - "name": "startTime", - "type": "number", - "description": "Profiling start timestamp in microseconds." - }, - { - "name": "endTime", - "type": "number", - "description": "Profiling end timestamp in microseconds." - }, - { - "name": "samples", - "optional": true, - "type": "array", - "items": { - "type": "integer" - }, - "description": "Ids of samples top nodes." - }, - { - "name": "timeDeltas", - "optional": true, - "type": "array", - "items": { - "type": "integer" - }, - "description": "Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime." - } - ] - }, - { - "id": "PositionTickInfo", - "type": "object", - "description": "Specifies a number of samples attributed to a certain source position.", - "properties": [ - { - "name": "line", - "type": "integer", - "description": "Source line number (1-based)." - }, - { - "name": "ticks", - "type": "integer", - "description": "Number of samples attributed to the source line." - } - ] - }, - { - "id": "CoverageRange", - "type": "object", - "description": "Coverage data for a source range.", - "properties": [ - { - "name": "startOffset", - "type": "integer", - "description": "JavaScript script source offset for the range start." - }, - { - "name": "endOffset", - "type": "integer", - "description": "JavaScript script source offset for the range end." - }, - { - "name": "count", - "type": "integer", - "description": "Collected execution count of the source range." - } - ] - }, - { - "id": "FunctionCoverage", - "type": "object", - "description": "Coverage data for a JavaScript function.", - "properties": [ - { - "name": "functionName", - "type": "string", - "description": "JavaScript function name." - }, - { - "name": "ranges", - "type": "array", - "items": { - "$ref": "CoverageRange" - }, - "description": "Source ranges inside the function with coverage data." - }, - { - "name": "isBlockCoverage", - "type": "boolean", - "description": "Whether coverage data for this function has block granularity." - } - ] - }, - { - "id": "ScriptCoverage", - "type": "object", - "description": "Coverage data for a JavaScript script.", - "properties": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "JavaScript script id." - }, - { - "name": "url", - "type": "string", - "description": "JavaScript script name or url." - }, - { - "name": "functions", - "type": "array", - "items": { - "$ref": "FunctionCoverage" - }, - "description": "Functions contained in the script that has coverage data." - } - ] - }, - { - "id": "TypeObject", - "type": "object", - "description": "Describes a type collected during runtime.", "properties": [ { "name": "name", - "type": "string", - "description": "Name of a type collected with type profiling." - } - ], - "experimental": true - }, - { - "id": "TypeProfileEntry", - "type": "object", - "description": "Source offset and types for a parameter or return value.", - "properties": [ - { - "name": "offset", - "type": "integer", - "description": "Source offset of the parameter or end of function for return values." - }, - { - "name": "types", - "type": "array", - "items": { - "$ref": "TypeObject" - }, - "description": "The types for this parameter or return value." - } - ], - "experimental": true - }, - { - "id": "ScriptTypeProfile", - "type": "object", - "description": "Type profile data collected during runtime for a JavaScript script.", - "properties": [ - { - "name": "scriptId", - "$ref": "Runtime.ScriptId", - "description": "JavaScript script id." - }, - { - "name": "url", - "type": "string", - "description": "JavaScript script name or url." - }, - { - "name": "entries", - "type": "array", - "items": { - "$ref": "TypeProfileEntry" - }, - "description": "Type profile entries for parameters and return values of the functions in the script." - } - ], - "experimental": true - } - ], - "commands": [ - { - "name": "enable" - }, - { - "name": "disable" - }, - { - "name": "setSamplingInterval", - "parameters": [ - { - "name": "interval", - "type": "integer", - "description": "New sampling interval in microseconds." - } - ], - "description": "Changes CPU profiler sampling interval. Must be called before CPU profiles recording started." - }, - { - "name": "start" - }, - { - "name": "stop", - "returns": [ - { - "name": "profile", - "$ref": "Profile", - "description": "Recorded profile." - } - ] - }, - { - "name": "startPreciseCoverage", - "parameters": [ - { - "name": "callCount", - "type": "boolean", - "optional": true, - "description": "Collect accurate call counts beyond simple 'covered' or 'not covered'." - }, - { - "name": "detailed", - "type": "boolean", - "optional": true, - "description": "Collect block-based coverage." - } - ], - "description": "Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters." - }, - { - "name": "stopPreciseCoverage", - "description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code." - }, - { - "name": "takePreciseCoverage", - "returns": [ - { - "name": "result", - "type": "array", - "items": { - "$ref": "ScriptCoverage" - }, - "description": "Coverage data for the current isolate." - } - ], - "description": "Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started." - }, - { - "name": "getBestEffortCoverage", - "returns": [ - { - "name": "result", - "type": "array", - "items": { - "$ref": "ScriptCoverage" - }, - "description": "Coverage data for the current isolate." - } - ], - "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection." - }, - { - "name": "startTypeProfile", - "description": "Enable type profile.", - "experimental": true - }, - { - "name": "stopTypeProfile", - "description": "Disable type profile. Disabling releases type profile data collected so far.", - "experimental": true - }, - { - "name": "takeTypeProfile", - "returns": [ - { - "name": "result", - "type": "array", - "items": { - "$ref": "ScriptTypeProfile" - }, - "description": "Type profile for all scripts since startTypeProfile() was turned on." - } - ], - "description": "Collect type profile.", - "experimental": true - } - ], - "events": [ - { - "name": "consoleProfileStarted", - "parameters": [ - { - "name": "id", + "description": "Domain name.", "type": "string" }, { - "name": "location", - "$ref": "Debugger.Location", - "description": "Location of console.profile()." - }, - { - "name": "title", - "type": "string", - "optional": true, - "description": "Profile title passed as an argument to console.profile()." - } - ], - "description": "Sent when new profile recording is started using console.profile() call." - }, - { - "name": "consoleProfileFinished", - "parameters": [ - { - "name": "id", + "name": "version", + "description": "Domain version.", "type": "string" - }, - { - "name": "location", - "$ref": "Debugger.Location", - "description": "Location of console.profileEnd()." - }, - { - "name": "profile", - "$ref": "Profile" - }, - { - "name": "title", - "type": "string", - "optional": true, - "description": "Profile title passed as an argument to console.profile()." - } - ] - } - ] - }, - { - "domain": "HeapProfiler", - "dependencies": [ - "Runtime" - ], - "experimental": true, - "types": [ - { - "id": "HeapSnapshotObjectId", - "type": "string", - "description": "Heap snapshot object id." - }, - { - "id": "SamplingHeapProfileNode", - "type": "object", - "description": "Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.", - "properties": [ - { - "name": "callFrame", - "$ref": "Runtime.CallFrame", - "description": "Function location." - }, - { - "name": "selfSize", - "type": "number", - "description": "Allocations size in bytes for the node excluding children." - }, - { - "name": "children", - "type": "array", - "items": { - "$ref": "SamplingHeapProfileNode" - }, - "description": "Child nodes." - } - ] - }, - { - "id": "SamplingHeapProfile", - "type": "object", - "description": "Profile.", - "properties": [ - { - "name": "head", - "$ref": "SamplingHeapProfileNode" } ] } ], "commands": [ { - "name": "enable" - }, - { - "name": "disable" - }, - { - "name": "startTrackingHeapObjects", - "parameters": [ - { - "name": "trackAllocations", - "type": "boolean", - "optional": true - } - ] - }, - { - "name": "stopTrackingHeapObjects", - "parameters": [ - { - "name": "reportProgress", - "type": "boolean", - "optional": true, - "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped." - } - ] - }, - { - "name": "takeHeapSnapshot", - "parameters": [ - { - "name": "reportProgress", - "type": "boolean", - "optional": true, - "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." - } - ] - }, - { - "name": "collectGarbage" - }, - { - "name": "getObjectByHeapObjectId", - "parameters": [ - { - "name": "objectId", - "$ref": "HeapSnapshotObjectId" - }, - { - "name": "objectGroup", - "type": "string", - "optional": true, - "description": "Symbolic group name that can be used to release multiple objects." - } - ], + "name": "getDomains", + "description": "Returns supported domains.", "returns": [ { - "name": "result", - "$ref": "Runtime.RemoteObject", - "description": "Evaluation result." - } - ] - }, - { - "name": "addInspectedHeapObject", - "parameters": [ - { - "name": "heapObjectId", - "$ref": "HeapSnapshotObjectId", - "description": "Heap snapshot object id to be accessible by means of $x command line API." - } - ], - "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)." - }, - { - "name": "getHeapObjectId", - "parameters": [ - { - "name": "objectId", - "$ref": "Runtime.RemoteObjectId", - "description": "Identifier of the object to get heap object id for." - } - ], - "returns": [ - { - "name": "heapSnapshotObjectId", - "$ref": "HeapSnapshotObjectId", - "description": "Id of the heap snapshot object corresponding to the passed remote object id." - } - ] - }, - { - "name": "startSampling", - "parameters": [ - { - "name": "samplingInterval", - "type": "number", - "optional": true, - "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes." - } - ] - }, - { - "name": "stopSampling", - "returns": [ - { - "name": "profile", - "$ref": "SamplingHeapProfile", - "description": "Recorded sampling heap profile." - } - ] - }, - { - "name": "getSamplingProfile", - "returns": [ - { - "name": "profile", - "$ref": "SamplingHeapProfile", - "description": "Return the sampling profile being collected." - } - ] - } - ], - "events": [ - { - "name": "addHeapSnapshotChunk", - "parameters": [ - { - "name": "chunk", - "type": "string" - } - ] - }, - { - "name": "resetProfiles" - }, - { - "name": "reportHeapSnapshotProgress", - "parameters": [ - { - "name": "done", - "type": "integer" - }, - { - "name": "total", - "type": "integer" - }, - { - "name": "finished", - "type": "boolean", - "optional": true - } - ] - }, - { - "name": "lastSeenObjectId", - "description": "If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.", - "parameters": [ - { - "name": "lastSeenObjectId", - "type": "integer" - }, - { - "name": "timestamp", - "type": "number" - } - ] - }, - { - "name": "heapStatsUpdate", - "description": "If heap objects tracking has been started then backend may send update for one or more fragments", - "parameters": [ - { - "name": "statsUpdate", + "name": "domains", + "description": "List of supported domains.", "type": "array", "items": { - "type": "integer" - }, - "description": "An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment." + "$ref": "Domain" + } } ] }
Note that `iframe` owner elements will return\ncorresponding document elements as their child nodes.
cookies
screencastFrame
startScreencast
enabled == false
setInspectMode
true
Aborted
isNavigationRequest
id
Note that iframe owner elements will return corresponding document elements as their child nodes.
iframe
Node
nodeId
Container
Element
[name1, value1, name2, value2]
Document
FrameOwner
DocumentType
Attr
setChildNodes
querySelector
querySelectorAll
getSearchResults
cancelSearch
fromIndex
toIndex
targetNodeId
DOMCharacterDataModified
DOMNodeInserted
DOMNodeRemoved
get*ForNode()
styleSheetAdded
styleSheetRemoved
getStyleSheet[Text]()
false
frameId
ruleText
styleSheetId
location
domNodes
getSnapshot
layoutTreeNodes
computedStyles
blob:<uuid>
<uuid>
EventListener
setDOMBreakpoint
\"*\"
targetCreated/targetInfoChanged/targetDestroyed
Runtime.runIfWaitingForDebugger
setDiscoverTargets
targetCreated
targetDestroyed
attachToTarget
detachFromTarget
attachedToTarget
keyUp
rawKeyDown
ReportEvents
Animation
AnimationEffect
Accessibility.AXNode
entryAdded
object
value
map
set
undefined
symbol
objectId
debuggerId
Runtime.StackTrace
Debugger.paused
setPauseOnException
await
executionContextCreated
exceptionThrown
Debugger.scriptParsed
this
global
with
url
urlRegex
locations
breakpointResolved
stackTraceId
none
releaseObjectGroup
0
Debugger.stepInto
breakOnAsynCall
messageAdded