Fixing issues with code generation
This commit is contained in:
parent
861578ac70
commit
58283934b9
12
actions.go
12
actions.go
|
@ -4,19 +4,19 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
"github.com/knq/chromedp/cdp"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Action is a single atomic action.
|
// Action is a single atomic action.
|
||||||
type Action interface {
|
type Action interface {
|
||||||
Do(context.Context, FrameHandler) error
|
Do(context.Context, cdp.FrameHandler) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// ActionFunc is a single action func.
|
// ActionFunc is a single action func.
|
||||||
type ActionFunc func(context.Context, FrameHandler) error
|
type ActionFunc func(context.Context, cdp.FrameHandler) error
|
||||||
|
|
||||||
// Do executes the action using the provided context.
|
// Do executes the action using the provided context.
|
||||||
func (f ActionFunc) Do(ctxt context.Context, h FrameHandler) error {
|
func (f ActionFunc) Do(ctxt context.Context, h cdp.FrameHandler) error {
|
||||||
return f(ctxt, h)
|
return f(ctxt, h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ func (f ActionFunc) Do(ctxt context.Context, h FrameHandler) error {
|
||||||
type Tasks []Action
|
type Tasks []Action
|
||||||
|
|
||||||
// Do executes the list of Tasks using the provided context.
|
// Do executes the list of Tasks using the provided context.
|
||||||
func (t Tasks) Do(ctxt context.Context, h FrameHandler) error {
|
func (t Tasks) Do(ctxt context.Context, h cdp.FrameHandler) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
// TODO: put individual task timeouts from context here
|
// TODO: put individual task timeouts from context here
|
||||||
|
@ -42,7 +42,7 @@ func (t Tasks) Do(ctxt context.Context, h FrameHandler) error {
|
||||||
|
|
||||||
// Sleep is an empty action that calls time.Sleep with the specified duration.
|
// Sleep is an empty action that calls time.Sleep with the specified duration.
|
||||||
func Sleep(d time.Duration) Action {
|
func Sleep(d time.Duration) Action {
|
||||||
return ActionFunc(func(context.Context, FrameHandler) error {
|
return ActionFunc(func(context.Context, cdp.FrameHandler) error {
|
||||||
time.Sleep(d)
|
time.Sleep(d)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,45 +9,25 @@ package accessibility
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetPartialAXTreeParams fetches the accessibility node and partial
|
// GetPartialAXTreeParams fetches the accessibility node and partial
|
||||||
// accessibility tree for this DOM node, if it exists.
|
// accessibility tree for this DOM node, if it exists.
|
||||||
type GetPartialAXTreeParams struct {
|
type GetPartialAXTreeParams struct {
|
||||||
NodeID NodeID `json:"nodeId"` // ID of node to get the partial accessibility tree for.
|
NodeID cdp.NodeID `json:"nodeId"` // ID of node to get the partial accessibility tree for.
|
||||||
FetchRelatives bool `json:"fetchRelatives,omitempty"` // Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
|
FetchRelatives bool `json:"fetchRelatives,omitempty"` // Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPartialAXTree fetches the accessibility node and partial accessibility
|
// GetPartialAXTree fetches the accessibility node and partial accessibility
|
||||||
// tree for this DOM node, if it exists.
|
// tree for this DOM node, if it exists.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// nodeId - ID of node to get the partial accessibility tree for.
|
// nodeID - ID of node to get the partial accessibility tree for.
|
||||||
func GetPartialAXTree(nodeId NodeID) *GetPartialAXTreeParams {
|
func GetPartialAXTree(nodeID cdp.NodeID) *GetPartialAXTreeParams {
|
||||||
return &GetPartialAXTreeParams{
|
return &GetPartialAXTreeParams{
|
||||||
NodeID: nodeId,
|
NodeID: nodeID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +47,7 @@ type GetPartialAXTreeReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// nodes - The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
|
// nodes - The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
|
||||||
func (p *GetPartialAXTreeParams) Do(ctxt context.Context, h FrameHandler) (nodes []*AXNode, err error) {
|
func (p *GetPartialAXTreeParams) Do(ctxt context.Context, h cdp.FrameHandler) (nodes []*AXNode, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -79,13 +59,13 @@ func (p *GetPartialAXTreeParams) Do(ctxt context.Context, h FrameHandler) (nodes
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAccessibilityGetPartialAXTree, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAccessibilityGetPartialAXTree, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -94,7 +74,7 @@ func (p *GetPartialAXTreeParams) Do(ctxt context.Context, h FrameHandler) (nodes
|
||||||
var r GetPartialAXTreeReturns
|
var r GetPartialAXTreeReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Nodes, nil
|
return r.Nodes, nil
|
||||||
|
@ -104,8 +84,8 @@ func (p *GetPartialAXTreeParams) Do(ctxt context.Context, h FrameHandler) (nodes
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,32 +5,12 @@ package accessibility
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// AXNodeID unique accessibility node identifier.
|
// AXNodeID unique accessibility node identifier.
|
||||||
type AXNodeID string
|
type AXNodeID string
|
||||||
|
|
||||||
|
@ -254,12 +234,14 @@ type AXValueSource struct {
|
||||||
InvalidReason string `json:"invalidReason,omitempty"` // Reason for the value being invalid, if it is.
|
InvalidReason string `json:"invalidReason,omitempty"` // Reason for the value being invalid, if it is.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AXRelatedNode [no description].
|
||||||
type AXRelatedNode struct {
|
type AXRelatedNode struct {
|
||||||
BackendDOMNodeID BackendNodeID `json:"backendDOMNodeId,omitempty"` // The BackendNodeId of the related DOM node.
|
BackendDOMNodeID cdp.BackendNodeID `json:"backendDOMNodeId,omitempty"` // The BackendNodeId of the related DOM node.
|
||||||
Idref string `json:"idref,omitempty"` // The IDRef value provided, if any.
|
Idref string `json:"idref,omitempty"` // The IDRef value provided, if any.
|
||||||
Text string `json:"text,omitempty"` // The text alternative of this node in the current context.
|
Text string `json:"text,omitempty"` // The text alternative of this node in the current context.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AXProperty [no description].
|
||||||
type AXProperty struct {
|
type AXProperty struct {
|
||||||
Name string `json:"name,omitempty"` // The name of this property.
|
Name string `json:"name,omitempty"` // The name of this property.
|
||||||
Value *AXValue `json:"value,omitempty"` // The value of this property.
|
Value *AXValue `json:"value,omitempty"` // The value of this property.
|
||||||
|
@ -546,14 +528,14 @@ func (t *AXRelationshipAttributes) UnmarshalJSON(buf []byte) error {
|
||||||
|
|
||||||
// AXNode a node in the accessibility tree.
|
// AXNode a node in the accessibility tree.
|
||||||
type AXNode struct {
|
type AXNode struct {
|
||||||
NodeID AXNodeID `json:"nodeId,omitempty"` // Unique identifier for this node.
|
NodeID AXNodeID `json:"nodeId,omitempty"` // Unique identifier for this node.
|
||||||
Ignored bool `json:"ignored,omitempty"` // Whether this node is ignored for accessibility
|
Ignored bool `json:"ignored,omitempty"` // Whether this node is ignored for accessibility
|
||||||
IgnoredReasons []*AXProperty `json:"ignoredReasons,omitempty"` // Collection of reasons why this node is hidden.
|
IgnoredReasons []*AXProperty `json:"ignoredReasons,omitempty"` // Collection of reasons why this node is hidden.
|
||||||
Role *AXValue `json:"role,omitempty"` // This Node's role, whether explicit or implicit.
|
Role *AXValue `json:"role,omitempty"` // This Node's role, whether explicit or implicit.
|
||||||
Name *AXValue `json:"name,omitempty"` // The accessible name for this Node.
|
Name *AXValue `json:"name,omitempty"` // The accessible name for this Node.
|
||||||
Description *AXValue `json:"description,omitempty"` // The accessible description for this Node.
|
Description *AXValue `json:"description,omitempty"` // The accessible description for this Node.
|
||||||
Value *AXValue `json:"value,omitempty"` // The value for this Node.
|
Value *AXValue `json:"value,omitempty"` // The value for this Node.
|
||||||
Properties []*AXProperty `json:"properties,omitempty"` // All other properties
|
Properties []*AXProperty `json:"properties,omitempty"` // All other properties
|
||||||
ChildIds []AXNodeID `json:"childIds,omitempty"` // IDs for each of this node's child nodes.
|
ChildIds []AXNodeID `json:"childIds,omitempty"` // IDs for each of this node's child nodes.
|
||||||
BackendDOMNodeID BackendNodeID `json:"backendDOMNodeId,omitempty"` // The backend ID for the associated DOM node, if any.
|
BackendDOMNodeID cdp.BackendNodeID `json:"backendDOMNodeId,omitempty"` // The backend ID for the associated DOM node, if any.
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,31 +9,11 @@ package animation
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables animation domain notifications.
|
// EnableParams enables animation domain notifications.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
@ -43,19 +23,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Animation.enable.
|
// Do executes Animation.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandAnimationEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -67,10 +47,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables animation domain notifications.
|
// DisableParams disables animation domain notifications.
|
||||||
|
@ -82,19 +62,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Animation.disable.
|
// Do executes Animation.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandAnimationDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -106,10 +86,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPlaybackRateParams gets the playback rate of the document timeline.
|
// GetPlaybackRateParams gets the playback rate of the document timeline.
|
||||||
|
@ -129,19 +109,19 @@ type GetPlaybackRateReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// playbackRate - Playback rate for animations on page.
|
// playbackRate - Playback rate for animations on page.
|
||||||
func (p *GetPlaybackRateParams) Do(ctxt context.Context, h FrameHandler) (playbackRate float64, err error) {
|
func (p *GetPlaybackRateParams) Do(ctxt context.Context, h cdp.FrameHandler) (playbackRate float64, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationGetPlaybackRate, Empty)
|
ch := h.Execute(ctxt, cdp.CommandAnimationGetPlaybackRate, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return 0, ErrChannelClosed
|
return 0, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -150,7 +130,7 @@ func (p *GetPlaybackRateParams) Do(ctxt context.Context, h FrameHandler) (playba
|
||||||
var r GetPlaybackRateReturns
|
var r GetPlaybackRateReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, ErrInvalidResult
|
return 0, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.PlaybackRate, nil
|
return r.PlaybackRate, nil
|
||||||
|
@ -160,10 +140,10 @@ func (p *GetPlaybackRateParams) Do(ctxt context.Context, h FrameHandler) (playba
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return 0, ErrContextDone
|
return 0, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0, ErrUnknownResult
|
return 0, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetPlaybackRateParams sets the playback rate of the document timeline.
|
// SetPlaybackRateParams sets the playback rate of the document timeline.
|
||||||
|
@ -182,7 +162,7 @@ func SetPlaybackRate(playbackRate float64) *SetPlaybackRateParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Animation.setPlaybackRate.
|
// Do executes Animation.setPlaybackRate.
|
||||||
func (p *SetPlaybackRateParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetPlaybackRateParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -194,13 +174,13 @@ func (p *SetPlaybackRateParams) Do(ctxt context.Context, h FrameHandler) (err er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationSetPlaybackRate, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAnimationSetPlaybackRate, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -212,10 +192,10 @@ func (p *SetPlaybackRateParams) Do(ctxt context.Context, h FrameHandler) (err er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentTimeParams returns the current time of the an animation.
|
// GetCurrentTimeParams returns the current time of the an animation.
|
||||||
|
@ -242,7 +222,7 @@ type GetCurrentTimeReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// currentTime - Current time of the page.
|
// currentTime - Current time of the page.
|
||||||
func (p *GetCurrentTimeParams) Do(ctxt context.Context, h FrameHandler) (currentTime float64, err error) {
|
func (p *GetCurrentTimeParams) Do(ctxt context.Context, h cdp.FrameHandler) (currentTime float64, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -254,13 +234,13 @@ func (p *GetCurrentTimeParams) Do(ctxt context.Context, h FrameHandler) (current
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationGetCurrentTime, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAnimationGetCurrentTime, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return 0, ErrChannelClosed
|
return 0, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -269,7 +249,7 @@ func (p *GetCurrentTimeParams) Do(ctxt context.Context, h FrameHandler) (current
|
||||||
var r GetCurrentTimeReturns
|
var r GetCurrentTimeReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, ErrInvalidResult
|
return 0, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.CurrentTime, nil
|
return r.CurrentTime, nil
|
||||||
|
@ -279,10 +259,10 @@ func (p *GetCurrentTimeParams) Do(ctxt context.Context, h FrameHandler) (current
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return 0, ErrContextDone
|
return 0, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0, ErrUnknownResult
|
return 0, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetPausedParams sets the paused state of a set of animations.
|
// SetPausedParams sets the paused state of a set of animations.
|
||||||
|
@ -304,7 +284,7 @@ func SetPaused(animations []string, paused bool) *SetPausedParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Animation.setPaused.
|
// Do executes Animation.setPaused.
|
||||||
func (p *SetPausedParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetPausedParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -316,13 +296,13 @@ func (p *SetPausedParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationSetPaused, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAnimationSetPaused, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -334,10 +314,10 @@ func (p *SetPausedParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetTimingParams sets the timing of an animation node.
|
// SetTimingParams sets the timing of an animation node.
|
||||||
|
@ -350,19 +330,19 @@ type SetTimingParams struct {
|
||||||
// SetTiming sets the timing of an animation node.
|
// SetTiming sets the timing of an animation node.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// animationId - Animation id.
|
// animationID - Animation id.
|
||||||
// duration - Duration of the animation.
|
// duration - Duration of the animation.
|
||||||
// delay - Delay of the animation.
|
// delay - Delay of the animation.
|
||||||
func SetTiming(animationId string, duration float64, delay float64) *SetTimingParams {
|
func SetTiming(animationID string, duration float64, delay float64) *SetTimingParams {
|
||||||
return &SetTimingParams{
|
return &SetTimingParams{
|
||||||
AnimationID: animationId,
|
AnimationID: animationID,
|
||||||
Duration: duration,
|
Duration: duration,
|
||||||
Delay: delay,
|
Delay: delay,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Animation.setTiming.
|
// Do executes Animation.setTiming.
|
||||||
func (p *SetTimingParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetTimingParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -374,13 +354,13 @@ func (p *SetTimingParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationSetTiming, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAnimationSetTiming, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -392,10 +372,10 @@ func (p *SetTimingParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SeekAnimationsParams seek a set of animations to a particular time within
|
// SeekAnimationsParams seek a set of animations to a particular time within
|
||||||
|
@ -419,7 +399,7 @@ func SeekAnimations(animations []string, currentTime float64) *SeekAnimationsPar
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Animation.seekAnimations.
|
// Do executes Animation.seekAnimations.
|
||||||
func (p *SeekAnimationsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SeekAnimationsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -431,13 +411,13 @@ func (p *SeekAnimationsParams) Do(ctxt context.Context, h FrameHandler) (err err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationSeekAnimations, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAnimationSeekAnimations, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -449,10 +429,10 @@ func (p *SeekAnimationsParams) Do(ctxt context.Context, h FrameHandler) (err err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReleaseAnimationsParams releases a set of animations to no longer be
|
// ReleaseAnimationsParams releases a set of animations to no longer be
|
||||||
|
@ -473,7 +453,7 @@ func ReleaseAnimations(animations []string) *ReleaseAnimationsParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Animation.releaseAnimations.
|
// Do executes Animation.releaseAnimations.
|
||||||
func (p *ReleaseAnimationsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ReleaseAnimationsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -485,13 +465,13 @@ func (p *ReleaseAnimationsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationReleaseAnimations, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAnimationReleaseAnimations, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -503,10 +483,10 @@ func (p *ReleaseAnimationsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResolveAnimationParams gets the remote object of the Animation.
|
// ResolveAnimationParams gets the remote object of the Animation.
|
||||||
|
@ -517,10 +497,10 @@ type ResolveAnimationParams struct {
|
||||||
// ResolveAnimation gets the remote object of the Animation.
|
// ResolveAnimation gets the remote object of the Animation.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// animationId - Animation id.
|
// animationID - Animation id.
|
||||||
func ResolveAnimation(animationId string) *ResolveAnimationParams {
|
func ResolveAnimation(animationID string) *ResolveAnimationParams {
|
||||||
return &ResolveAnimationParams{
|
return &ResolveAnimationParams{
|
||||||
AnimationID: animationId,
|
AnimationID: animationID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,7 +513,7 @@ type ResolveAnimationReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// remoteObject - Corresponding remote object.
|
// remoteObject - Corresponding remote object.
|
||||||
func (p *ResolveAnimationParams) Do(ctxt context.Context, h FrameHandler) (remoteObject *runtime.RemoteObject, err error) {
|
func (p *ResolveAnimationParams) Do(ctxt context.Context, h cdp.FrameHandler) (remoteObject *runtime.RemoteObject, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -545,13 +525,13 @@ func (p *ResolveAnimationParams) Do(ctxt context.Context, h FrameHandler) (remot
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandAnimationResolveAnimation, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandAnimationResolveAnimation, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -560,7 +540,7 @@ func (p *ResolveAnimationParams) Do(ctxt context.Context, h FrameHandler) (remot
|
||||||
var r ResolveAnimationReturns
|
var r ResolveAnimationReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.RemoteObject, nil
|
return r.RemoteObject, nil
|
||||||
|
@ -570,8 +550,8 @@ func (p *ResolveAnimationParams) Do(ctxt context.Context, h FrameHandler) (remot
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1357,66 +1357,7 @@ func (v *EnableParams) UnmarshalJSON(data []byte) error {
|
||||||
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation16(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation16(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation17(in *jlexer.Lexer, out *DisableParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation17(in *jlexer.Lexer, out *Effect) {
|
||||||
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 {
|
|
||||||
default:
|
|
||||||
in.SkipRecursive()
|
|
||||||
}
|
|
||||||
in.WantComma()
|
|
||||||
}
|
|
||||||
in.Delim('}')
|
|
||||||
if isTopLevel {
|
|
||||||
in.Consumed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation17(out *jwriter.Writer, in DisableParams) {
|
|
||||||
out.RawByte('{')
|
|
||||||
first := true
|
|
||||||
_ = first
|
|
||||||
out.RawByte('}')
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
|
||||||
func (v DisableParams) MarshalJSON() ([]byte, error) {
|
|
||||||
w := jwriter.Writer{}
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation17(&w, v)
|
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
||||||
func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation17(w, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
|
||||||
func (v *DisableParams) UnmarshalJSON(data []byte) error {
|
|
||||||
r := jlexer.Lexer{Data: data}
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation17(&r, v)
|
|
||||||
return r.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
||||||
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation17(l, v)
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation18(in *jlexer.Lexer, out *AnimationEffect) {
|
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -1473,7 +1414,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation18(in *jlexer.Lexer,
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation18(out *jwriter.Writer, in AnimationEffect) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation17(out *jwriter.Writer, in Effect) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -1565,26 +1506,85 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation18(out *jwriter.Write
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v AnimationEffect) MarshalJSON() ([]byte, error) {
|
func (v Effect) MarshalJSON() ([]byte, error) {
|
||||||
|
w := jwriter.Writer{}
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation17(&w, v)
|
||||||
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
|
func (v Effect) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation17(w, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
|
func (v *Effect) UnmarshalJSON(data []byte) error {
|
||||||
|
r := jlexer.Lexer{Data: data}
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation17(&r, v)
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
|
func (v *Effect) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation17(l, v)
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation18(in *jlexer.Lexer, out *DisableParams) {
|
||||||
|
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 {
|
||||||
|
default:
|
||||||
|
in.SkipRecursive()
|
||||||
|
}
|
||||||
|
in.WantComma()
|
||||||
|
}
|
||||||
|
in.Delim('}')
|
||||||
|
if isTopLevel {
|
||||||
|
in.Consumed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation18(out *jwriter.Writer, in DisableParams) {
|
||||||
|
out.RawByte('{')
|
||||||
|
first := true
|
||||||
|
_ = first
|
||||||
|
out.RawByte('}')
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON supports json.Marshaler interface
|
||||||
|
func (v DisableParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation18(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation18(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v AnimationEffect) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation18(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation18(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *AnimationEffect) UnmarshalJSON(data []byte) error {
|
func (v *DisableParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation18(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation18(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *AnimationEffect) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation18(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation18(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation19(in *jlexer.Lexer, out *Animation) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation19(in *jlexer.Lexer, out *Animation) {
|
||||||
|
@ -1626,7 +1626,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation19(in *jlexer.Lexer,
|
||||||
out.Source = nil
|
out.Source = nil
|
||||||
} else {
|
} else {
|
||||||
if out.Source == nil {
|
if out.Source == nil {
|
||||||
out.Source = new(AnimationEffect)
|
out.Source = new(Effect)
|
||||||
}
|
}
|
||||||
(*out.Source).UnmarshalEasyJSON(in)
|
(*out.Source).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,27 +3,7 @@ package animation
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventAnimationCreated event for each animation that has been created.
|
// EventAnimationCreated event for each animation that has been created.
|
||||||
|
@ -41,9 +21,9 @@ type EventAnimationCanceled struct {
|
||||||
ID string `json:"id,omitempty"` // Id of the animation that was cancelled.
|
ID string `json:"id,omitempty"` // Id of the animation that was cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventAnimationAnimationCreated,
|
cdp.EventAnimationAnimationCreated,
|
||||||
EventAnimationAnimationStarted,
|
cdp.EventAnimationAnimationStarted,
|
||||||
EventAnimationAnimationCanceled,
|
cdp.EventAnimationAnimationCanceled,
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,58 +5,38 @@ package animation
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// Animation animation instance.
|
// Animation animation instance.
|
||||||
type Animation struct {
|
type Animation struct {
|
||||||
ID string `json:"id,omitempty"` // Animation's id.
|
ID string `json:"id,omitempty"` // Animation's id.
|
||||||
Name string `json:"name,omitempty"` // Animation's name.
|
Name string `json:"name,omitempty"` // Animation's name.
|
||||||
PausedState bool `json:"pausedState,omitempty"` // Animation's internal paused state.
|
PausedState bool `json:"pausedState,omitempty"` // Animation's internal paused state.
|
||||||
PlayState string `json:"playState,omitempty"` // Animation's play state.
|
PlayState string `json:"playState,omitempty"` // Animation's play state.
|
||||||
PlaybackRate float64 `json:"playbackRate,omitempty"` // Animation's playback rate.
|
PlaybackRate float64 `json:"playbackRate,omitempty"` // Animation's playback rate.
|
||||||
StartTime float64 `json:"startTime,omitempty"` // Animation's start time.
|
StartTime float64 `json:"startTime,omitempty"` // Animation's start time.
|
||||||
CurrentTime float64 `json:"currentTime,omitempty"` // Animation's current time.
|
CurrentTime float64 `json:"currentTime,omitempty"` // Animation's current time.
|
||||||
Source *AnimationEffect `json:"source,omitempty"` // Animation's source animation node.
|
Source *Effect `json:"source,omitempty"` // Animation's source animation node.
|
||||||
Type AnimationType `json:"type,omitempty"` // Animation type of Animation.
|
Type Type `json:"type,omitempty"` // Animation type of Animation.
|
||||||
CSSID string `json:"cssId,omitempty"` // A unique ID for Animation representing the sources that triggered this CSS animation/transition.
|
CSSID string `json:"cssId,omitempty"` // A unique ID for Animation representing the sources that triggered this CSS animation/transition.
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnimationEffect animationEffect instance.
|
// Effect animationEffect instance.
|
||||||
type AnimationEffect struct {
|
type Effect struct {
|
||||||
Delay float64 `json:"delay,omitempty"` // AnimationEffect's delay.
|
Delay float64 `json:"delay,omitempty"` // AnimationEffect's delay.
|
||||||
EndDelay float64 `json:"endDelay,omitempty"` // AnimationEffect's end delay.
|
EndDelay float64 `json:"endDelay,omitempty"` // AnimationEffect's end delay.
|
||||||
IterationStart float64 `json:"iterationStart,omitempty"` // AnimationEffect's iteration start.
|
IterationStart float64 `json:"iterationStart,omitempty"` // AnimationEffect's iteration start.
|
||||||
Iterations float64 `json:"iterations,omitempty"` // AnimationEffect's iterations.
|
Iterations float64 `json:"iterations,omitempty"` // AnimationEffect's iterations.
|
||||||
Duration float64 `json:"duration,omitempty"` // AnimationEffect's iteration duration.
|
Duration float64 `json:"duration,omitempty"` // AnimationEffect's iteration duration.
|
||||||
Direction string `json:"direction,omitempty"` // AnimationEffect's playback direction.
|
Direction string `json:"direction,omitempty"` // AnimationEffect's playback direction.
|
||||||
Fill string `json:"fill,omitempty"` // AnimationEffect's fill mode.
|
Fill string `json:"fill,omitempty"` // AnimationEffect's fill mode.
|
||||||
BackendNodeID BackendNodeID `json:"backendNodeId,omitempty"` // AnimationEffect's target node.
|
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // AnimationEffect's target node.
|
||||||
KeyframesRule *KeyframesRule `json:"keyframesRule,omitempty"` // AnimationEffect's keyframes.
|
KeyframesRule *KeyframesRule `json:"keyframesRule,omitempty"` // AnimationEffect's keyframes.
|
||||||
Easing string `json:"easing,omitempty"` // AnimationEffect's timing function.
|
Easing string `json:"easing,omitempty"` // AnimationEffect's timing function.
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeyframesRule keyframes Rule.
|
// KeyframesRule keyframes Rule.
|
||||||
|
@ -71,47 +51,47 @@ type KeyframeStyle struct {
|
||||||
Easing string `json:"easing,omitempty"` // AnimationEffect's timing function.
|
Easing string `json:"easing,omitempty"` // AnimationEffect's timing function.
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnimationType animation type of Animation.
|
// Type animation type of Animation.
|
||||||
type AnimationType string
|
type Type string
|
||||||
|
|
||||||
// String returns the AnimationType as string value.
|
// String returns the Type as string value.
|
||||||
func (t AnimationType) String() string {
|
func (t Type) String() string {
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnimationType values.
|
// Type values.
|
||||||
const (
|
const (
|
||||||
AnimationTypeCSSTransition AnimationType = "CSSTransition"
|
TypeCSSTransition Type = "CSSTransition"
|
||||||
AnimationTypeCSSAnimation AnimationType = "CSSAnimation"
|
TypeCSSAnimation Type = "CSSAnimation"
|
||||||
AnimationTypeWebAnimation AnimationType = "WebAnimation"
|
TypeWebAnimation Type = "WebAnimation"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
||||||
func (t AnimationType) MarshalEasyJSON(out *jwriter.Writer) {
|
func (t Type) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.String(string(t))
|
out.String(string(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON satisfies json.Marshaler.
|
// MarshalJSON satisfies json.Marshaler.
|
||||||
func (t AnimationType) MarshalJSON() ([]byte, error) {
|
func (t Type) MarshalJSON() ([]byte, error) {
|
||||||
return easyjson.Marshal(t)
|
return easyjson.Marshal(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
||||||
func (t *AnimationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
func (t *Type) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
switch AnimationType(in.String()) {
|
switch Type(in.String()) {
|
||||||
case AnimationTypeCSSTransition:
|
case TypeCSSTransition:
|
||||||
*t = AnimationTypeCSSTransition
|
*t = TypeCSSTransition
|
||||||
case AnimationTypeCSSAnimation:
|
case TypeCSSAnimation:
|
||||||
*t = AnimationTypeCSSAnimation
|
*t = TypeCSSAnimation
|
||||||
case AnimationTypeWebAnimation:
|
case TypeWebAnimation:
|
||||||
*t = AnimationTypeWebAnimation
|
*t = TypeWebAnimation
|
||||||
|
|
||||||
default:
|
default:
|
||||||
in.AddError(errors.New("unknown AnimationType value"))
|
in.AddError(errors.New("unknown Type value"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON satisfies json.Unmarshaler.
|
// UnmarshalJSON satisfies json.Unmarshaler.
|
||||||
func (t *AnimationType) UnmarshalJSON(buf []byte) error {
|
func (t *Type) UnmarshalJSON(buf []byte) error {
|
||||||
return easyjson.Unmarshal(buf, t)
|
return easyjson.Unmarshal(buf, t)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,30 +9,10 @@ package applicationcache
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetFramesWithManifestsParams returns array of frame identifiers with
|
// GetFramesWithManifestsParams returns array of frame identifiers with
|
||||||
// manifest urls for each frame containing a document associated with some
|
// manifest urls for each frame containing a document associated with some
|
||||||
// application cache.
|
// application cache.
|
||||||
|
@ -54,19 +34,19 @@ type GetFramesWithManifestsReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// frameIds - Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
|
// 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 FrameHandler) (frameIds []*FrameWithManifest, err error) {
|
func (p *GetFramesWithManifestsParams) Do(ctxt context.Context, h cdp.FrameHandler) (frameIds []*FrameWithManifest, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandApplicationCacheGetFramesWithManifests, Empty)
|
ch := h.Execute(ctxt, cdp.CommandApplicationCacheGetFramesWithManifests, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -75,7 +55,7 @@ func (p *GetFramesWithManifestsParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
var r GetFramesWithManifestsReturns
|
var r GetFramesWithManifestsReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.FrameIds, nil
|
return r.FrameIds, nil
|
||||||
|
@ -85,10 +65,10 @@ func (p *GetFramesWithManifestsParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableParams enables application cache domain notifications.
|
// EnableParams enables application cache domain notifications.
|
||||||
|
@ -100,19 +80,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ApplicationCache.enable.
|
// Do executes ApplicationCache.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandApplicationCacheEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandApplicationCacheEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -124,25 +104,25 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetManifestForFrameParams returns manifest URL for document in the given
|
// GetManifestForFrameParams returns manifest URL for document in the given
|
||||||
// frame.
|
// frame.
|
||||||
type GetManifestForFrameParams struct {
|
type GetManifestForFrameParams struct {
|
||||||
FrameID FrameID `json:"frameId"` // Identifier of the frame containing document whose manifest is retrieved.
|
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.
|
// GetManifestForFrame returns manifest URL for document in the given frame.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// frameId - Identifier of the frame containing document whose manifest is retrieved.
|
// frameID - Identifier of the frame containing document whose manifest is retrieved.
|
||||||
func GetManifestForFrame(frameId FrameID) *GetManifestForFrameParams {
|
func GetManifestForFrame(frameID cdp.FrameID) *GetManifestForFrameParams {
|
||||||
return &GetManifestForFrameParams{
|
return &GetManifestForFrameParams{
|
||||||
FrameID: frameId,
|
FrameID: frameID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +135,7 @@ type GetManifestForFrameReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// manifestURL - Manifest URL for document in the given frame.
|
// manifestURL - Manifest URL for document in the given frame.
|
||||||
func (p *GetManifestForFrameParams) Do(ctxt context.Context, h FrameHandler) (manifestURL string, err error) {
|
func (p *GetManifestForFrameParams) Do(ctxt context.Context, h cdp.FrameHandler) (manifestURL string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -167,13 +147,13 @@ func (p *GetManifestForFrameParams) Do(ctxt context.Context, h FrameHandler) (ma
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandApplicationCacheGetManifestForFrame, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandApplicationCacheGetManifestForFrame, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", ErrChannelClosed
|
return "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -182,7 +162,7 @@ func (p *GetManifestForFrameParams) Do(ctxt context.Context, h FrameHandler) (ma
|
||||||
var r GetManifestForFrameReturns
|
var r GetManifestForFrameReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", ErrInvalidResult
|
return "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.ManifestURL, nil
|
return r.ManifestURL, nil
|
||||||
|
@ -192,26 +172,26 @@ func (p *GetManifestForFrameParams) Do(ctxt context.Context, h FrameHandler) (ma
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", ErrUnknownResult
|
return "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetApplicationCacheForFrameParams returns relevant application cache data
|
// GetApplicationCacheForFrameParams returns relevant application cache data
|
||||||
// for the document in given frame.
|
// for the document in given frame.
|
||||||
type GetApplicationCacheForFrameParams struct {
|
type GetApplicationCacheForFrameParams struct {
|
||||||
FrameID FrameID `json:"frameId"` // Identifier of the frame containing document whose application cache is retrieved.
|
FrameID cdp.FrameID `json:"frameId"` // Identifier of the frame containing document whose application cache is retrieved.
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetApplicationCacheForFrame returns relevant application cache data for
|
// GetApplicationCacheForFrame returns relevant application cache data for
|
||||||
// the document in given frame.
|
// the document in given frame.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// frameId - Identifier of the frame containing document whose application cache is retrieved.
|
// frameID - Identifier of the frame containing document whose application cache is retrieved.
|
||||||
func GetApplicationCacheForFrame(frameId FrameID) *GetApplicationCacheForFrameParams {
|
func GetApplicationCacheForFrame(frameID cdp.FrameID) *GetApplicationCacheForFrameParams {
|
||||||
return &GetApplicationCacheForFrameParams{
|
return &GetApplicationCacheForFrameParams{
|
||||||
FrameID: frameId,
|
FrameID: frameID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +204,7 @@ type GetApplicationCacheForFrameReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// applicationCache - Relevant application cache data for the document in given frame.
|
// applicationCache - Relevant application cache data for the document in given frame.
|
||||||
func (p *GetApplicationCacheForFrameParams) Do(ctxt context.Context, h FrameHandler) (applicationCache *ApplicationCache, err error) {
|
func (p *GetApplicationCacheForFrameParams) Do(ctxt context.Context, h cdp.FrameHandler) (applicationCache *ApplicationCache, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -236,13 +216,13 @@ func (p *GetApplicationCacheForFrameParams) Do(ctxt context.Context, h FrameHand
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandApplicationCacheGetApplicationCacheForFrame, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandApplicationCacheGetApplicationCacheForFrame, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -251,7 +231,7 @@ func (p *GetApplicationCacheForFrameParams) Do(ctxt context.Context, h FrameHand
|
||||||
var r GetApplicationCacheForFrameReturns
|
var r GetApplicationCacheForFrameReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.ApplicationCache, nil
|
return r.ApplicationCache, nil
|
||||||
|
@ -261,8 +241,8 @@ func (p *GetApplicationCacheForFrameParams) Do(ctxt context.Context, h FrameHand
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,96 @@ var (
|
||||||
_ easyjson.Marshaler
|
_ easyjson.Marshaler
|
||||||
)
|
)
|
||||||
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache(in *jlexer.Lexer, out *GetManifestForFrameReturns) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache(in *jlexer.Lexer, out *Resource) {
|
||||||
|
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 "url":
|
||||||
|
out.URL = string(in.String())
|
||||||
|
case "size":
|
||||||
|
out.Size = int64(in.Int64())
|
||||||
|
case "type":
|
||||||
|
out.Type = string(in.String())
|
||||||
|
default:
|
||||||
|
in.SkipRecursive()
|
||||||
|
}
|
||||||
|
in.WantComma()
|
||||||
|
}
|
||||||
|
in.Delim('}')
|
||||||
|
if isTopLevel {
|
||||||
|
in.Consumed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache(out *jwriter.Writer, in Resource) {
|
||||||
|
out.RawByte('{')
|
||||||
|
first := true
|
||||||
|
_ = first
|
||||||
|
if in.URL != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"url\":")
|
||||||
|
out.String(string(in.URL))
|
||||||
|
}
|
||||||
|
if in.Size != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"size\":")
|
||||||
|
out.Int64(int64(in.Size))
|
||||||
|
}
|
||||||
|
if in.Type != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"type\":")
|
||||||
|
out.String(string(in.Type))
|
||||||
|
}
|
||||||
|
out.RawByte('}')
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON supports json.Marshaler interface
|
||||||
|
func (v Resource) MarshalJSON() ([]byte, error) {
|
||||||
|
w := jwriter.Writer{}
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache(&w, v)
|
||||||
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
|
func (v Resource) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache(w, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
|
func (v *Resource) UnmarshalJSON(data []byte) error {
|
||||||
|
r := jlexer.Lexer{Data: data}
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache(&r, v)
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
|
func (v *Resource) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache(l, v)
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache1(in *jlexer.Lexer, out *GetManifestForFrameReturns) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -48,7 +137,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache(in *jlexer.Le
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache(out *jwriter.Writer, in GetManifestForFrameReturns) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache1(out *jwriter.Writer, in GetManifestForFrameReturns) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -66,27 +155,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache(out *jwriter.
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v GetManifestForFrameReturns) MarshalJSON() ([]byte, error) {
|
func (v GetManifestForFrameReturns) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache1(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v GetManifestForFrameReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v GetManifestForFrameReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache1(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *GetManifestForFrameReturns) UnmarshalJSON(data []byte) error {
|
func (v *GetManifestForFrameReturns) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache1(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *GetManifestForFrameReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *GetManifestForFrameReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache1(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache1(in *jlexer.Lexer, out *GetManifestForFrameParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache2(in *jlexer.Lexer, out *GetManifestForFrameParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -117,7 +206,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache1(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache1(out *jwriter.Writer, in GetManifestForFrameParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache2(out *jwriter.Writer, in GetManifestForFrameParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -133,27 +222,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache1(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v GetManifestForFrameParams) MarshalJSON() ([]byte, error) {
|
func (v GetManifestForFrameParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache1(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache2(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v GetManifestForFrameParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v GetManifestForFrameParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache1(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache2(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *GetManifestForFrameParams) UnmarshalJSON(data []byte) error {
|
func (v *GetManifestForFrameParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache1(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache2(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *GetManifestForFrameParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *GetManifestForFrameParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache1(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache2(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache2(in *jlexer.Lexer, out *GetFramesWithManifestsReturns) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache3(in *jlexer.Lexer, out *GetFramesWithManifestsReturns) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -209,7 +298,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache2(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache2(out *jwriter.Writer, in GetFramesWithManifestsReturns) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache3(out *jwriter.Writer, in GetFramesWithManifestsReturns) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -242,27 +331,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache2(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v GetFramesWithManifestsReturns) MarshalJSON() ([]byte, error) {
|
func (v GetFramesWithManifestsReturns) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache2(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache3(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v GetFramesWithManifestsReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v GetFramesWithManifestsReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache2(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache3(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *GetFramesWithManifestsReturns) UnmarshalJSON(data []byte) error {
|
func (v *GetFramesWithManifestsReturns) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache2(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache3(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *GetFramesWithManifestsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *GetFramesWithManifestsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache2(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache3(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache3(in *jlexer.Lexer, out *GetFramesWithManifestsParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache4(in *jlexer.Lexer, out *GetFramesWithManifestsParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -291,7 +380,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache3(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache3(out *jwriter.Writer, in GetFramesWithManifestsParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache4(out *jwriter.Writer, in GetFramesWithManifestsParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -301,27 +390,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache3(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v GetFramesWithManifestsParams) MarshalJSON() ([]byte, error) {
|
func (v GetFramesWithManifestsParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache3(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache4(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v GetFramesWithManifestsParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v GetFramesWithManifestsParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache3(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache4(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *GetFramesWithManifestsParams) UnmarshalJSON(data []byte) error {
|
func (v *GetFramesWithManifestsParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache3(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache4(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *GetFramesWithManifestsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *GetFramesWithManifestsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache3(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache4(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache4(in *jlexer.Lexer, out *GetApplicationCacheForFrameReturns) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache5(in *jlexer.Lexer, out *GetApplicationCacheForFrameReturns) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -360,7 +449,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache4(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache4(out *jwriter.Writer, in GetApplicationCacheForFrameReturns) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache5(out *jwriter.Writer, in GetApplicationCacheForFrameReturns) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -382,27 +471,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache4(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v GetApplicationCacheForFrameReturns) MarshalJSON() ([]byte, error) {
|
func (v GetApplicationCacheForFrameReturns) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache4(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache5(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v GetApplicationCacheForFrameReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v GetApplicationCacheForFrameReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache4(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache5(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *GetApplicationCacheForFrameReturns) UnmarshalJSON(data []byte) error {
|
func (v *GetApplicationCacheForFrameReturns) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache4(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache5(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *GetApplicationCacheForFrameReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *GetApplicationCacheForFrameReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache4(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache5(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache5(in *jlexer.Lexer, out *GetApplicationCacheForFrameParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache6(in *jlexer.Lexer, out *GetApplicationCacheForFrameParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -433,7 +522,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache5(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache5(out *jwriter.Writer, in GetApplicationCacheForFrameParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache6(out *jwriter.Writer, in GetApplicationCacheForFrameParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -449,27 +538,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache5(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v GetApplicationCacheForFrameParams) MarshalJSON() ([]byte, error) {
|
func (v GetApplicationCacheForFrameParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache5(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache6(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v GetApplicationCacheForFrameParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v GetApplicationCacheForFrameParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache5(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache6(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *GetApplicationCacheForFrameParams) UnmarshalJSON(data []byte) error {
|
func (v *GetApplicationCacheForFrameParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache5(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache6(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *GetApplicationCacheForFrameParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *GetApplicationCacheForFrameParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache5(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache6(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache6(in *jlexer.Lexer, out *FrameWithManifest) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache7(in *jlexer.Lexer, out *FrameWithManifest) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -504,7 +593,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache6(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache6(out *jwriter.Writer, in FrameWithManifest) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache7(out *jwriter.Writer, in FrameWithManifest) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -538,27 +627,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache6(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v FrameWithManifest) MarshalJSON() ([]byte, error) {
|
func (v FrameWithManifest) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache6(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache7(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v FrameWithManifest) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v FrameWithManifest) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache6(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache7(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *FrameWithManifest) UnmarshalJSON(data []byte) error {
|
func (v *FrameWithManifest) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache6(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache7(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *FrameWithManifest) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *FrameWithManifest) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache6(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache7(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache7(in *jlexer.Lexer, out *EventNetworkStateUpdated) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache8(in *jlexer.Lexer, out *EventNetworkStateUpdated) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -589,7 +678,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache7(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache7(out *jwriter.Writer, in EventNetworkStateUpdated) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache8(out *jwriter.Writer, in EventNetworkStateUpdated) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -607,27 +696,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache7(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v EventNetworkStateUpdated) MarshalJSON() ([]byte, error) {
|
func (v EventNetworkStateUpdated) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache7(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache8(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v EventNetworkStateUpdated) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v EventNetworkStateUpdated) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache7(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache8(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *EventNetworkStateUpdated) UnmarshalJSON(data []byte) error {
|
func (v *EventNetworkStateUpdated) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache7(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache8(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *EventNetworkStateUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *EventNetworkStateUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache7(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache8(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache8(in *jlexer.Lexer, out *EventApplicationCacheStatusUpdated) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache9(in *jlexer.Lexer, out *EventApplicationCacheStatusUpdated) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -662,7 +751,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache8(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache8(out *jwriter.Writer, in EventApplicationCacheStatusUpdated) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache9(out *jwriter.Writer, in EventApplicationCacheStatusUpdated) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -696,27 +785,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache8(out *jwriter
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v EventApplicationCacheStatusUpdated) MarshalJSON() ([]byte, error) {
|
func (v EventApplicationCacheStatusUpdated) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache8(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache9(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v EventApplicationCacheStatusUpdated) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v EventApplicationCacheStatusUpdated) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache8(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache9(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *EventApplicationCacheStatusUpdated) UnmarshalJSON(data []byte) error {
|
func (v *EventApplicationCacheStatusUpdated) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache8(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache9(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *EventApplicationCacheStatusUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *EventApplicationCacheStatusUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache8(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache9(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache9(in *jlexer.Lexer, out *EnableParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache10(in *jlexer.Lexer, out *EnableParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -745,7 +834,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache9(in *jlexer.L
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache9(out *jwriter.Writer, in EnableParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache10(out *jwriter.Writer, in EnableParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -754,114 +843,25 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache9(out *jwriter
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v EnableParams) MarshalJSON() ([]byte, error) {
|
func (v EnableParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache9(&w, v)
|
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
||||||
func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache9(w, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
|
||||||
func (v *EnableParams) UnmarshalJSON(data []byte) error {
|
|
||||||
r := jlexer.Lexer{Data: data}
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache9(&r, v)
|
|
||||||
return r.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
||||||
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache9(l, v)
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache10(in *jlexer.Lexer, out *ApplicationCacheResource) {
|
|
||||||
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 "url":
|
|
||||||
out.URL = string(in.String())
|
|
||||||
case "size":
|
|
||||||
out.Size = int64(in.Int64())
|
|
||||||
case "type":
|
|
||||||
out.Type = string(in.String())
|
|
||||||
default:
|
|
||||||
in.SkipRecursive()
|
|
||||||
}
|
|
||||||
in.WantComma()
|
|
||||||
}
|
|
||||||
in.Delim('}')
|
|
||||||
if isTopLevel {
|
|
||||||
in.Consumed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache10(out *jwriter.Writer, in ApplicationCacheResource) {
|
|
||||||
out.RawByte('{')
|
|
||||||
first := true
|
|
||||||
_ = first
|
|
||||||
if in.URL != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"url\":")
|
|
||||||
out.String(string(in.URL))
|
|
||||||
}
|
|
||||||
if in.Size != 0 {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"size\":")
|
|
||||||
out.Int64(int64(in.Size))
|
|
||||||
}
|
|
||||||
if in.Type != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"type\":")
|
|
||||||
out.String(string(in.Type))
|
|
||||||
}
|
|
||||||
out.RawByte('}')
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
|
||||||
func (v ApplicationCacheResource) MarshalJSON() ([]byte, error) {
|
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache10(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache10(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v ApplicationCacheResource) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache10(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpApplicationcache10(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *ApplicationCacheResource) UnmarshalJSON(data []byte) error {
|
func (v *EnableParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache10(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache10(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *ApplicationCacheResource) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache10(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache10(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache11(in *jlexer.Lexer, out *ApplicationCache) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache11(in *jlexer.Lexer, out *ApplicationCache) {
|
||||||
|
@ -898,18 +898,18 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpApplicationcache11(in *jlexer.
|
||||||
} else {
|
} else {
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
if !in.IsDelim(']') {
|
if !in.IsDelim(']') {
|
||||||
out.Resources = make([]*ApplicationCacheResource, 0, 8)
|
out.Resources = make([]*Resource, 0, 8)
|
||||||
} else {
|
} else {
|
||||||
out.Resources = []*ApplicationCacheResource{}
|
out.Resources = []*Resource{}
|
||||||
}
|
}
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
var v4 *ApplicationCacheResource
|
var v4 *Resource
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
in.Skip()
|
in.Skip()
|
||||||
v4 = nil
|
v4 = nil
|
||||||
} else {
|
} else {
|
||||||
if v4 == nil {
|
if v4 == nil {
|
||||||
v4 = new(ApplicationCacheResource)
|
v4 = new(Resource)
|
||||||
}
|
}
|
||||||
(*v4).UnmarshalEasyJSON(in)
|
(*v4).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,41 +3,23 @@ package applicationcache
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventApplicationCacheStatusUpdated [no description].
|
||||||
type EventApplicationCacheStatusUpdated struct {
|
type EventApplicationCacheStatusUpdated struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Identifier of the frame containing document whose application cache updated status.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Identifier of the frame containing document whose application cache updated status.
|
||||||
ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL.
|
ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL.
|
||||||
Status int64 `json:"status,omitempty"` // Updated application cache status.
|
Status int64 `json:"status,omitempty"` // Updated application cache status.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventNetworkStateUpdated [no description].
|
||||||
type EventNetworkStateUpdated struct {
|
type EventNetworkStateUpdated struct {
|
||||||
IsNowOnline bool `json:"isNowOnline,omitempty"`
|
IsNowOnline bool `json:"isNowOnline,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventApplicationCacheApplicationCacheStatusUpdated,
|
cdp.EventApplicationCacheApplicationCacheStatusUpdated,
|
||||||
EventApplicationCacheNetworkStateUpdated,
|
cdp.EventApplicationCacheNetworkStateUpdated,
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,31 +3,11 @@ package applicationcache
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// Resource detailed application cache resource information.
|
||||||
_ BackendNode
|
type Resource struct {
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ApplicationCacheResource detailed application cache resource information.
|
|
||||||
type ApplicationCacheResource struct {
|
|
||||||
URL string `json:"url,omitempty"` // Resource url.
|
URL string `json:"url,omitempty"` // Resource url.
|
||||||
Size int64 `json:"size,omitempty"` // Resource size.
|
Size int64 `json:"size,omitempty"` // Resource size.
|
||||||
Type string `json:"type,omitempty"` // Resource type.
|
Type string `json:"type,omitempty"` // Resource type.
|
||||||
|
@ -35,16 +15,16 @@ type ApplicationCacheResource struct {
|
||||||
|
|
||||||
// ApplicationCache detailed application cache information.
|
// ApplicationCache detailed application cache information.
|
||||||
type ApplicationCache struct {
|
type ApplicationCache struct {
|
||||||
ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL.
|
ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL.
|
||||||
Size float64 `json:"size,omitempty"` // Application cache size.
|
Size float64 `json:"size,omitempty"` // Application cache size.
|
||||||
CreationTime float64 `json:"creationTime,omitempty"` // Application cache creation time.
|
CreationTime float64 `json:"creationTime,omitempty"` // Application cache creation time.
|
||||||
UpdateTime float64 `json:"updateTime,omitempty"` // Application cache update time.
|
UpdateTime float64 `json:"updateTime,omitempty"` // Application cache update time.
|
||||||
Resources []*ApplicationCacheResource `json:"resources,omitempty"` // Application cache resources.
|
Resources []*Resource `json:"resources,omitempty"` // Application cache resources.
|
||||||
}
|
}
|
||||||
|
|
||||||
// FrameWithManifest frame identifier - manifest URL pair.
|
// FrameWithManifest frame identifier - manifest URL pair.
|
||||||
type FrameWithManifest struct {
|
type FrameWithManifest struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Frame identifier.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier.
|
||||||
ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL.
|
ManifestURL string `json:"manifestURL,omitempty"` // Manifest URL.
|
||||||
Status int64 `json:"status,omitempty"` // Application cache status.
|
Status int64 `json:"status,omitempty"` // Application cache status.
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,30 +9,10 @@ package cachestorage
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// RequestCacheNamesParams requests cache names.
|
// RequestCacheNamesParams requests cache names.
|
||||||
type RequestCacheNamesParams struct {
|
type RequestCacheNamesParams struct {
|
||||||
SecurityOrigin string `json:"securityOrigin"` // Security origin.
|
SecurityOrigin string `json:"securityOrigin"` // Security origin.
|
||||||
|
@ -57,7 +37,7 @@ type RequestCacheNamesReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// caches - Caches for the security origin.
|
// caches - Caches for the security origin.
|
||||||
func (p *RequestCacheNamesParams) Do(ctxt context.Context, h FrameHandler) (caches []*Cache, err error) {
|
func (p *RequestCacheNamesParams) Do(ctxt context.Context, h cdp.FrameHandler) (caches []*Cache, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -69,13 +49,13 @@ func (p *RequestCacheNamesParams) Do(ctxt context.Context, h FrameHandler) (cach
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandCacheStorageRequestCacheNames, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandCacheStorageRequestCacheNames, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -84,7 +64,7 @@ func (p *RequestCacheNamesParams) Do(ctxt context.Context, h FrameHandler) (cach
|
||||||
var r RequestCacheNamesReturns
|
var r RequestCacheNamesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Caches, nil
|
return r.Caches, nil
|
||||||
|
@ -94,10 +74,10 @@ func (p *RequestCacheNamesParams) Do(ctxt context.Context, h FrameHandler) (cach
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestEntriesParams requests data from cache.
|
// RequestEntriesParams requests data from cache.
|
||||||
|
@ -110,12 +90,12 @@ type RequestEntriesParams struct {
|
||||||
// RequestEntries requests data from cache.
|
// RequestEntries requests data from cache.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// cacheId - ID of cache to get entries from.
|
// cacheID - ID of cache to get entries from.
|
||||||
// skipCount - Number of records to skip.
|
// skipCount - Number of records to skip.
|
||||||
// pageSize - Number of records to fetch.
|
// pageSize - Number of records to fetch.
|
||||||
func RequestEntries(cacheId CacheID, skipCount int64, pageSize int64) *RequestEntriesParams {
|
func RequestEntries(cacheID CacheID, skipCount int64, pageSize int64) *RequestEntriesParams {
|
||||||
return &RequestEntriesParams{
|
return &RequestEntriesParams{
|
||||||
CacheID: cacheId,
|
CacheID: cacheID,
|
||||||
SkipCount: skipCount,
|
SkipCount: skipCount,
|
||||||
PageSize: pageSize,
|
PageSize: pageSize,
|
||||||
}
|
}
|
||||||
|
@ -132,7 +112,7 @@ type RequestEntriesReturns struct {
|
||||||
// returns:
|
// returns:
|
||||||
// cacheDataEntries - Array of object store data entries.
|
// cacheDataEntries - Array of object store data entries.
|
||||||
// hasMore - If true, there are more entries to fetch in the given range.
|
// hasMore - If true, there are more entries to fetch in the given range.
|
||||||
func (p *RequestEntriesParams) Do(ctxt context.Context, h FrameHandler) (cacheDataEntries []*DataEntry, hasMore bool, err error) {
|
func (p *RequestEntriesParams) Do(ctxt context.Context, h cdp.FrameHandler) (cacheDataEntries []*DataEntry, hasMore bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -144,13 +124,13 @@ func (p *RequestEntriesParams) Do(ctxt context.Context, h FrameHandler) (cacheDa
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandCacheStorageRequestEntries, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandCacheStorageRequestEntries, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, false, ErrChannelClosed
|
return nil, false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -159,7 +139,7 @@ func (p *RequestEntriesParams) Do(ctxt context.Context, h FrameHandler) (cacheDa
|
||||||
var r RequestEntriesReturns
|
var r RequestEntriesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, false, ErrInvalidResult
|
return nil, false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.CacheDataEntries, r.HasMore, nil
|
return r.CacheDataEntries, r.HasMore, nil
|
||||||
|
@ -169,10 +149,10 @@ func (p *RequestEntriesParams) Do(ctxt context.Context, h FrameHandler) (cacheDa
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, false, ErrContextDone
|
return nil, false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, false, ErrUnknownResult
|
return nil, false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteCacheParams deletes a cache.
|
// DeleteCacheParams deletes a cache.
|
||||||
|
@ -183,15 +163,15 @@ type DeleteCacheParams struct {
|
||||||
// DeleteCache deletes a cache.
|
// DeleteCache deletes a cache.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// cacheId - Id of cache for deletion.
|
// cacheID - Id of cache for deletion.
|
||||||
func DeleteCache(cacheId CacheID) *DeleteCacheParams {
|
func DeleteCache(cacheID CacheID) *DeleteCacheParams {
|
||||||
return &DeleteCacheParams{
|
return &DeleteCacheParams{
|
||||||
CacheID: cacheId,
|
CacheID: cacheID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes CacheStorage.deleteCache.
|
// Do executes CacheStorage.deleteCache.
|
||||||
func (p *DeleteCacheParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DeleteCacheParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -203,13 +183,13 @@ func (p *DeleteCacheParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandCacheStorageDeleteCache, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandCacheStorageDeleteCache, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -221,10 +201,10 @@ func (p *DeleteCacheParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteEntryParams deletes a cache entry.
|
// DeleteEntryParams deletes a cache entry.
|
||||||
|
@ -236,17 +216,17 @@ type DeleteEntryParams struct {
|
||||||
// DeleteEntry deletes a cache entry.
|
// DeleteEntry deletes a cache entry.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// cacheId - Id of cache where the entry will be deleted.
|
// cacheID - Id of cache where the entry will be deleted.
|
||||||
// request - URL spec of the request.
|
// request - URL spec of the request.
|
||||||
func DeleteEntry(cacheId CacheID, request string) *DeleteEntryParams {
|
func DeleteEntry(cacheID CacheID, request string) *DeleteEntryParams {
|
||||||
return &DeleteEntryParams{
|
return &DeleteEntryParams{
|
||||||
CacheID: cacheId,
|
CacheID: cacheID,
|
||||||
Request: request,
|
Request: request,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes CacheStorage.deleteEntry.
|
// Do executes CacheStorage.deleteEntry.
|
||||||
func (p *DeleteEntryParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DeleteEntryParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -258,13 +238,13 @@ func (p *DeleteEntryParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandCacheStorageDeleteEntry, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandCacheStorageDeleteEntry, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -276,8 +256,8 @@ func (p *DeleteEntryParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,30 +2,6 @@ package cachestorage
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// CacheID unique identifier of the Cache object.
|
// CacheID unique identifier of the Cache object.
|
||||||
type CacheID string
|
type CacheID string
|
||||||
|
|
||||||
|
|
|
@ -1343,7 +1343,7 @@ type FrameHandler interface {
|
||||||
Execute(context.Context, MethodType, easyjson.RawMessage) <-chan interface{}
|
Execute(context.Context, MethodType, easyjson.RawMessage) <-chan interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Empty is an empty JSON object message
|
// Empty is an empty JSON object message.
|
||||||
var Empty = easyjson.RawMessage(`{}`)
|
var Empty = easyjson.RawMessage(`{}`)
|
||||||
|
|
||||||
// FrameID unique frame identifier.
|
// FrameID unique frame identifier.
|
||||||
|
@ -1879,8 +1879,3 @@ func (t *NodeType) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
func (t *NodeType) UnmarshalJSON(buf []byte) error {
|
func (t *NodeType) UnmarshalJSON(buf []byte) error {
|
||||||
return easyjson.Unmarshal(buf, t)
|
return easyjson.Unmarshal(buf, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ComputedProperty struct {
|
|
||||||
Name string `json:"name,omitempty"` // Computed style property name.
|
|
||||||
Value string `json:"value,omitempty"` // Computed style property value.
|
|
||||||
}
|
|
||||||
|
|
397
cdp/css/css.go
397
cdp/css/css.go
File diff suppressed because it is too large
Load Diff
|
@ -4,7 +4,6 @@ package css
|
||||||
|
|
||||||
import (
|
import (
|
||||||
json "encoding/json"
|
json "encoding/json"
|
||||||
cdp "github.com/knq/chromedp/cdp"
|
|
||||||
dom "github.com/knq/chromedp/cdp/dom"
|
dom "github.com/knq/chromedp/cdp/dom"
|
||||||
easyjson "github.com/mailru/easyjson"
|
easyjson "github.com/mailru/easyjson"
|
||||||
jlexer "github.com/mailru/easyjson/jlexer"
|
jlexer "github.com/mailru/easyjson/jlexer"
|
||||||
|
@ -5206,18 +5205,18 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss47(in *jlexer.Lexer, out *G
|
||||||
} else {
|
} else {
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
if !in.IsDelim(']') {
|
if !in.IsDelim(']') {
|
||||||
out.ComputedStyle = make([]*cdp.ComputedProperty, 0, 8)
|
out.ComputedStyle = make([]*ComputedProperty, 0, 8)
|
||||||
} else {
|
} else {
|
||||||
out.ComputedStyle = []*cdp.ComputedProperty{}
|
out.ComputedStyle = []*ComputedProperty{}
|
||||||
}
|
}
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
var v70 *cdp.ComputedProperty
|
var v70 *ComputedProperty
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
in.Skip()
|
in.Skip()
|
||||||
v70 = nil
|
v70 = nil
|
||||||
} else {
|
} else {
|
||||||
if v70 == nil {
|
if v70 == nil {
|
||||||
v70 = new(cdp.ComputedProperty)
|
v70 = new(ComputedProperty)
|
||||||
}
|
}
|
||||||
(*v70).UnmarshalEasyJSON(in)
|
(*v70).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
@ -6240,18 +6239,18 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss61(in *jlexer.Lexer, out *C
|
||||||
} else {
|
} else {
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
if !in.IsDelim(']') {
|
if !in.IsDelim(']') {
|
||||||
out.Properties = make([]*cdp.ComputedProperty, 0, 8)
|
out.Properties = make([]*ComputedProperty, 0, 8)
|
||||||
} else {
|
} else {
|
||||||
out.Properties = []*cdp.ComputedProperty{}
|
out.Properties = []*ComputedProperty{}
|
||||||
}
|
}
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
var v79 *cdp.ComputedProperty
|
var v79 *ComputedProperty
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
in.Skip()
|
in.Skip()
|
||||||
v79 = nil
|
v79 = nil
|
||||||
} else {
|
} else {
|
||||||
if v79 == nil {
|
if v79 == nil {
|
||||||
v79 = new(cdp.ComputedProperty)
|
v79 = new(ComputedProperty)
|
||||||
}
|
}
|
||||||
(*v79).UnmarshalEasyJSON(in)
|
(*v79).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
@ -6323,7 +6322,86 @@ func (v *ComputedStyle) UnmarshalJSON(data []byte) error {
|
||||||
func (v *ComputedStyle) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *ComputedStyle) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss61(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss61(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss62(in *jlexer.Lexer, out *CollectClassNamesReturns) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss62(in *jlexer.Lexer, out *ComputedProperty) {
|
||||||
|
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 "name":
|
||||||
|
out.Name = string(in.String())
|
||||||
|
case "value":
|
||||||
|
out.Value = string(in.String())
|
||||||
|
default:
|
||||||
|
in.SkipRecursive()
|
||||||
|
}
|
||||||
|
in.WantComma()
|
||||||
|
}
|
||||||
|
in.Delim('}')
|
||||||
|
if isTopLevel {
|
||||||
|
in.Consumed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss62(out *jwriter.Writer, in ComputedProperty) {
|
||||||
|
out.RawByte('{')
|
||||||
|
first := true
|
||||||
|
_ = first
|
||||||
|
if in.Name != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"name\":")
|
||||||
|
out.String(string(in.Name))
|
||||||
|
}
|
||||||
|
if in.Value != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"value\":")
|
||||||
|
out.String(string(in.Value))
|
||||||
|
}
|
||||||
|
out.RawByte('}')
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON supports json.Marshaler interface
|
||||||
|
func (v ComputedProperty) MarshalJSON() ([]byte, error) {
|
||||||
|
w := jwriter.Writer{}
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss62(&w, v)
|
||||||
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
|
func (v ComputedProperty) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss62(w, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
|
func (v *ComputedProperty) UnmarshalJSON(data []byte) error {
|
||||||
|
r := jlexer.Lexer{Data: data}
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss62(&r, v)
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
|
func (v *ComputedProperty) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss62(l, v)
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss63(in *jlexer.Lexer, out *CollectClassNamesReturns) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -6371,7 +6449,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss62(in *jlexer.Lexer, out *C
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss62(out *jwriter.Writer, in CollectClassNamesReturns) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss63(out *jwriter.Writer, in CollectClassNamesReturns) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -6400,27 +6478,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss62(out *jwriter.Writer, in
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v CollectClassNamesReturns) MarshalJSON() ([]byte, error) {
|
func (v CollectClassNamesReturns) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss62(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss63(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v CollectClassNamesReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v CollectClassNamesReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss62(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss63(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *CollectClassNamesReturns) UnmarshalJSON(data []byte) error {
|
func (v *CollectClassNamesReturns) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss62(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss63(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *CollectClassNamesReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *CollectClassNamesReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss62(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss63(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss63(in *jlexer.Lexer, out *CollectClassNamesParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss64(in *jlexer.Lexer, out *CollectClassNamesParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -6451,7 +6529,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss63(in *jlexer.Lexer, out *C
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss63(out *jwriter.Writer, in CollectClassNamesParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss64(out *jwriter.Writer, in CollectClassNamesParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -6467,27 +6545,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss63(out *jwriter.Writer, in
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v CollectClassNamesParams) MarshalJSON() ([]byte, error) {
|
func (v CollectClassNamesParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss63(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss64(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v CollectClassNamesParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v CollectClassNamesParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss63(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss64(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *CollectClassNamesParams) UnmarshalJSON(data []byte) error {
|
func (v *CollectClassNamesParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss63(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss64(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *CollectClassNamesParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *CollectClassNamesParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss63(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss64(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss64(in *jlexer.Lexer, out *AddRuleReturns) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss65(in *jlexer.Lexer, out *AddRuleReturns) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -6526,7 +6604,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss64(in *jlexer.Lexer, out *A
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss64(out *jwriter.Writer, in AddRuleReturns) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss65(out *jwriter.Writer, in AddRuleReturns) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -6548,27 +6626,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss64(out *jwriter.Writer, in
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v AddRuleReturns) MarshalJSON() ([]byte, error) {
|
func (v AddRuleReturns) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss64(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss65(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v AddRuleReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v AddRuleReturns) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss64(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss65(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *AddRuleReturns) UnmarshalJSON(data []byte) error {
|
func (v *AddRuleReturns) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss64(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss65(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *AddRuleReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *AddRuleReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss64(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss65(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss65(in *jlexer.Lexer, out *AddRuleParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss66(in *jlexer.Lexer, out *AddRuleParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -6611,7 +6689,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss65(in *jlexer.Lexer, out *A
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss65(out *jwriter.Writer, in AddRuleParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss66(out *jwriter.Writer, in AddRuleParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -6643,23 +6721,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss65(out *jwriter.Writer, in
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v AddRuleParams) MarshalJSON() ([]byte, error) {
|
func (v AddRuleParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss65(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss66(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v AddRuleParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v AddRuleParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss65(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpCss66(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *AddRuleParams) UnmarshalJSON(data []byte) error {
|
func (v *AddRuleParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss65(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss66(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *AddRuleParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *AddRuleParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss65(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpCss66(l, v)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,27 +3,7 @@ package css
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventMediaQueryResultChanged fires whenever a MediaQuery result changes
|
// EventMediaQueryResultChanged fires whenever a MediaQuery result changes
|
||||||
|
@ -52,11 +32,11 @@ type EventStyleSheetRemoved struct {
|
||||||
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the removed stylesheet.
|
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the removed stylesheet.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventCSSMediaQueryResultChanged,
|
cdp.EventCSSMediaQueryResultChanged,
|
||||||
EventCSSFontsUpdated,
|
cdp.EventCSSFontsUpdated,
|
||||||
EventCSSStyleSheetChanged,
|
cdp.EventCSSStyleSheetChanged,
|
||||||
EventCSSStyleSheetAdded,
|
cdp.EventCSSStyleSheetAdded,
|
||||||
EventCSSStyleSheetRemoved,
|
cdp.EventCSSStyleSheetRemoved,
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,33 +5,14 @@ package css
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/dom"
|
"github.com/knq/chromedp/cdp/dom"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// StyleSheetID [no description].
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type StyleSheetID string
|
type StyleSheetID string
|
||||||
|
|
||||||
// String returns the StyleSheetID as string value.
|
// String returns the StyleSheetID as string value.
|
||||||
|
@ -92,8 +73,8 @@ func (t *StyleSheetOrigin) UnmarshalJSON(buf []byte) error {
|
||||||
|
|
||||||
// PseudoElementMatches cSS rule collection for a single pseudo style.
|
// PseudoElementMatches cSS rule collection for a single pseudo style.
|
||||||
type PseudoElementMatches struct {
|
type PseudoElementMatches struct {
|
||||||
PseudoType PseudoType `json:"pseudoType,omitempty"` // Pseudo element type.
|
PseudoType cdp.PseudoType `json:"pseudoType,omitempty"` // Pseudo element type.
|
||||||
Matches []*RuleMatch `json:"matches,omitempty"` // Matches of CSS rules applicable to the pseudo style.
|
Matches []*RuleMatch `json:"matches,omitempty"` // Matches of CSS rules applicable to the pseudo style.
|
||||||
}
|
}
|
||||||
|
|
||||||
// InheritedStyleEntry inherited CSS rule collection from ancestor node.
|
// InheritedStyleEntry inherited CSS rule collection from ancestor node.
|
||||||
|
@ -123,18 +104,18 @@ type SelectorList struct {
|
||||||
|
|
||||||
// StyleSheetHeader cSS stylesheet metainformation.
|
// StyleSheetHeader cSS stylesheet metainformation.
|
||||||
type StyleSheetHeader struct {
|
type StyleSheetHeader struct {
|
||||||
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The stylesheet identifier.
|
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The stylesheet identifier.
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Owner frame identifier.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Owner frame identifier.
|
||||||
SourceURL string `json:"sourceURL,omitempty"` // Stylesheet resource URL.
|
SourceURL string `json:"sourceURL,omitempty"` // Stylesheet resource URL.
|
||||||
SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
|
SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
|
||||||
Origin StyleSheetOrigin `json:"origin,omitempty"` // Stylesheet origin.
|
Origin StyleSheetOrigin `json:"origin,omitempty"` // Stylesheet origin.
|
||||||
Title string `json:"title,omitempty"` // Stylesheet title.
|
Title string `json:"title,omitempty"` // Stylesheet title.
|
||||||
OwnerNode BackendNodeID `json:"ownerNode,omitempty"` // The backend id for the owner node of the stylesheet.
|
OwnerNode cdp.BackendNodeID `json:"ownerNode,omitempty"` // The backend id for the owner node of the stylesheet.
|
||||||
Disabled bool `json:"disabled,omitempty"` // Denotes whether the stylesheet is disabled.
|
Disabled bool `json:"disabled,omitempty"` // Denotes whether the stylesheet is disabled.
|
||||||
HasSourceURL bool `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
|
HasSourceURL bool `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
|
||||||
IsInline bool `json:"isInline,omitempty"` // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
|
IsInline bool `json:"isInline,omitempty"` // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
|
||||||
StartLine float64 `json:"startLine,omitempty"` // Line offset of the stylesheet within the resource (zero based).
|
StartLine float64 `json:"startLine,omitempty"` // Line offset of the stylesheet within the resource (zero based).
|
||||||
StartColumn float64 `json:"startColumn,omitempty"` // Column offset of the stylesheet within the resource (zero based).
|
StartColumn float64 `json:"startColumn,omitempty"` // Column offset of the stylesheet within the resource (zero based).
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rule cSS rule representation.
|
// Rule cSS rule representation.
|
||||||
|
@ -161,12 +142,19 @@ type SourceRange struct {
|
||||||
EndColumn int64 `json:"endColumn,omitempty"` // End column of range (exclusive).
|
EndColumn int64 `json:"endColumn,omitempty"` // End column of range (exclusive).
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ShorthandEntry [no description].
|
||||||
type ShorthandEntry struct {
|
type ShorthandEntry struct {
|
||||||
Name string `json:"name,omitempty"` // Shorthand name.
|
Name string `json:"name,omitempty"` // Shorthand name.
|
||||||
Value string `json:"value,omitempty"` // Shorthand value.
|
Value string `json:"value,omitempty"` // Shorthand value.
|
||||||
Important bool `json:"important,omitempty"` // Whether the property has "!important" annotation (implies false if absent).
|
Important bool `json:"important,omitempty"` // Whether the property has "!important" annotation (implies false if absent).
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ComputedProperty [no description].
|
||||||
|
type ComputedProperty struct {
|
||||||
|
Name string `json:"name,omitempty"` // Computed style property name.
|
||||||
|
Value string `json:"value,omitempty"` // Computed style property value.
|
||||||
|
}
|
||||||
|
|
||||||
// Style cSS style representation.
|
// Style cSS style representation.
|
||||||
type Style struct {
|
type Style struct {
|
||||||
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
|
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
|
||||||
|
@ -253,7 +241,7 @@ type InlineTextBox struct {
|
||||||
|
|
||||||
// LayoutTreeNode details of an element in the DOM tree with a LayoutObject.
|
// LayoutTreeNode details of an element in the DOM tree with a LayoutObject.
|
||||||
type LayoutTreeNode struct {
|
type LayoutTreeNode struct {
|
||||||
NodeID NodeID `json:"nodeId,omitempty"` // The id of the related DOM node matching one from DOM.GetDocument.
|
NodeID cdp.NodeID `json:"nodeId,omitempty"` // The id of the related DOM node matching one from DOM.GetDocument.
|
||||||
BoundingBox *dom.Rect `json:"boundingBox,omitempty"` // The absolute position bounding box.
|
BoundingBox *dom.Rect `json:"boundingBox,omitempty"` // The absolute position bounding box.
|
||||||
LayoutText string `json:"layoutText,omitempty"` // Contents of the LayoutText if any
|
LayoutText string `json:"layoutText,omitempty"` // Contents of the LayoutText if any
|
||||||
InlineTextNodes []*InlineTextBox `json:"inlineTextNodes,omitempty"` // The post layout inline text nodes, if any.
|
InlineTextNodes []*InlineTextBox `json:"inlineTextNodes,omitempty"` // The post layout inline text nodes, if any.
|
||||||
|
@ -318,6 +306,7 @@ func (t *MediaSource) UnmarshalJSON(buf []byte) error {
|
||||||
return easyjson.Unmarshal(buf, t)
|
return easyjson.Unmarshal(buf, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PseudoClass [no description].
|
||||||
type PseudoClass string
|
type PseudoClass string
|
||||||
|
|
||||||
// String returns the PseudoClass as string value.
|
// String returns the PseudoClass as string value.
|
||||||
|
|
|
@ -9,30 +9,10 @@ package database
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables database tracking, database events will now be
|
// EnableParams enables database tracking, database events will now be
|
||||||
// delivered to the client.
|
// delivered to the client.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
@ -44,19 +24,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Database.enable.
|
// Do executes Database.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDatabaseEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandDatabaseEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -68,10 +48,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables database tracking, prevents database events from
|
// DisableParams disables database tracking, prevents database events from
|
||||||
|
@ -85,19 +65,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Database.disable.
|
// Do executes Database.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDatabaseDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandDatabaseDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -109,21 +89,24 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDatabaseTableNamesParams [no description].
|
||||||
type GetDatabaseTableNamesParams struct {
|
type GetDatabaseTableNamesParams struct {
|
||||||
DatabaseID DatabaseID `json:"databaseId"`
|
DatabaseID ID `json:"databaseId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDatabaseTableNames [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// databaseId
|
// databaseID
|
||||||
func GetDatabaseTableNames(databaseId DatabaseID) *GetDatabaseTableNamesParams {
|
func GetDatabaseTableNames(databaseID ID) *GetDatabaseTableNamesParams {
|
||||||
return &GetDatabaseTableNamesParams{
|
return &GetDatabaseTableNamesParams{
|
||||||
DatabaseID: databaseId,
|
DatabaseID: databaseID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +119,7 @@ type GetDatabaseTableNamesReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// tableNames
|
// tableNames
|
||||||
func (p *GetDatabaseTableNamesParams) Do(ctxt context.Context, h FrameHandler) (tableNames []string, err error) {
|
func (p *GetDatabaseTableNamesParams) Do(ctxt context.Context, h cdp.FrameHandler) (tableNames []string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -148,13 +131,13 @@ func (p *GetDatabaseTableNamesParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDatabaseGetDatabaseTableNames, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDatabaseGetDatabaseTableNames, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -163,7 +146,7 @@ func (p *GetDatabaseTableNamesParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
var r GetDatabaseTableNamesReturns
|
var r GetDatabaseTableNamesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.TableNames, nil
|
return r.TableNames, nil
|
||||||
|
@ -173,23 +156,26 @@ func (p *GetDatabaseTableNamesParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExecuteSQLParams [no description].
|
||||||
type ExecuteSQLParams struct {
|
type ExecuteSQLParams struct {
|
||||||
DatabaseID DatabaseID `json:"databaseId"`
|
DatabaseID ID `json:"databaseId"`
|
||||||
Query string `json:"query"`
|
Query string `json:"query"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExecuteSQL [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// databaseId
|
// databaseID
|
||||||
// query
|
// query
|
||||||
func ExecuteSQL(databaseId DatabaseID, query string) *ExecuteSQLParams {
|
func ExecuteSQL(databaseID ID, query string) *ExecuteSQLParams {
|
||||||
return &ExecuteSQLParams{
|
return &ExecuteSQLParams{
|
||||||
DatabaseID: databaseId,
|
DatabaseID: databaseID,
|
||||||
Query: query,
|
Query: query,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +193,7 @@ type ExecuteSQLReturns struct {
|
||||||
// columnNames
|
// columnNames
|
||||||
// values
|
// values
|
||||||
// sqlError
|
// sqlError
|
||||||
func (p *ExecuteSQLParams) Do(ctxt context.Context, h FrameHandler) (columnNames []string, values []easyjson.RawMessage, sqlError *Error, err error) {
|
func (p *ExecuteSQLParams) Do(ctxt context.Context, h cdp.FrameHandler) (columnNames []string, values []easyjson.RawMessage, sqlError *Error, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -219,13 +205,13 @@ func (p *ExecuteSQLParams) Do(ctxt context.Context, h FrameHandler) (columnNames
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDatabaseExecuteSQL, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDatabaseExecuteSQL, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, nil, nil, ErrChannelClosed
|
return nil, nil, nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -234,7 +220,7 @@ func (p *ExecuteSQLParams) Do(ctxt context.Context, h FrameHandler) (columnNames
|
||||||
var r ExecuteSQLReturns
|
var r ExecuteSQLReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, ErrInvalidResult
|
return nil, nil, nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.ColumnNames, r.Values, r.SQLError, nil
|
return r.ColumnNames, r.Values, r.SQLError, nil
|
||||||
|
@ -244,8 +230,8 @@ func (p *ExecuteSQLParams) Do(ctxt context.Context, h FrameHandler) (columnNames
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, nil, nil, ErrContextDone
|
return nil, nil, nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil, nil, ErrUnknownResult
|
return nil, nil, nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDatabase1(in *jlexer.Lexer, ou
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "databaseId":
|
case "databaseId":
|
||||||
out.DatabaseID = DatabaseID(in.String())
|
out.DatabaseID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDatabase3(in *jlexer.Lexer, ou
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "databaseId":
|
case "databaseId":
|
||||||
out.DatabaseID = DatabaseID(in.String())
|
out.DatabaseID = ID(in.String())
|
||||||
case "query":
|
case "query":
|
||||||
out.Query = string(in.String())
|
out.Query = string(in.String())
|
||||||
default:
|
default:
|
||||||
|
@ -711,7 +711,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDatabase8(in *jlexer.Lexer, ou
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "id":
|
case "id":
|
||||||
out.ID = DatabaseID(in.String())
|
out.ID = ID(in.String())
|
||||||
case "domain":
|
case "domain":
|
||||||
out.Domain = string(in.String())
|
out.Domain = string(in.String())
|
||||||
case "name":
|
case "name":
|
||||||
|
|
|
@ -3,34 +3,15 @@ package database
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventAddDatabase [no description].
|
||||||
type EventAddDatabase struct {
|
type EventAddDatabase struct {
|
||||||
Database *Database `json:"database,omitempty"`
|
Database *Database `json:"database,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventDatabaseAddDatabase,
|
cdp.EventDatabaseAddDatabase,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,44 +2,20 @@ package database
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
// ID unique identifier of Database object.
|
||||||
. "github.com/knq/chromedp/cdp"
|
type ID string
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
// String returns the ID as string value.
|
||||||
_ BackendNode
|
func (t ID) String() string {
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// DatabaseID unique identifier of Database object.
|
|
||||||
type DatabaseID string
|
|
||||||
|
|
||||||
// String returns the DatabaseID as string value.
|
|
||||||
func (t DatabaseID) String() string {
|
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Database database object.
|
// Database database object.
|
||||||
type Database struct {
|
type Database struct {
|
||||||
ID DatabaseID `json:"id,omitempty"` // Database ID.
|
ID ID `json:"id,omitempty"` // Database ID.
|
||||||
Domain string `json:"domain,omitempty"` // Database domain.
|
Domain string `json:"domain,omitempty"` // Database domain.
|
||||||
Name string `json:"name,omitempty"` // Database name.
|
Name string `json:"name,omitempty"` // Database name.
|
||||||
Version string `json:"version,omitempty"` // Database version.
|
Version string `json:"version,omitempty"` // Database version.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error database error.
|
// Error database error.
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,31 +3,11 @@ package debugger
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EventScriptParsed fired when virtual machine parses script. This event is
|
// EventScriptParsed fired when virtual machine parses script. This event is
|
||||||
// also fired for all known and uncollected scripts upon enabling debugger.
|
// also fired for all known and uncollected scripts upon enabling debugger.
|
||||||
type EventScriptParsed struct {
|
type EventScriptParsed struct {
|
||||||
|
@ -81,11 +61,11 @@ type EventPaused struct {
|
||||||
// EventResumed fired when the virtual machine resumed execution.
|
// EventResumed fired when the virtual machine resumed execution.
|
||||||
type EventResumed struct{}
|
type EventResumed struct{}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventDebuggerScriptParsed,
|
cdp.EventDebuggerScriptParsed,
|
||||||
EventDebuggerScriptFailedToParse,
|
cdp.EventDebuggerScriptFailedToParse,
|
||||||
EventDebuggerBreakpointResolved,
|
cdp.EventDebuggerBreakpointResolved,
|
||||||
EventDebuggerPaused,
|
cdp.EventDebuggerPaused,
|
||||||
EventDebuggerResumed,
|
cdp.EventDebuggerResumed,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,15 @@
|
||||||
package debugger
|
package debugger
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// BreakpointID breakpoint identifier.
|
// BreakpointID breakpoint identifier.
|
||||||
type BreakpointID string
|
type BreakpointID string
|
||||||
|
|
|
@ -9,30 +9,10 @@ package deviceorientation
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// SetDeviceOrientationOverrideParams overrides the Device Orientation.
|
// SetDeviceOrientationOverrideParams overrides the Device Orientation.
|
||||||
type SetDeviceOrientationOverrideParams struct {
|
type SetDeviceOrientationOverrideParams struct {
|
||||||
Alpha float64 `json:"alpha"` // Mock alpha
|
Alpha float64 `json:"alpha"` // Mock alpha
|
||||||
|
@ -55,7 +35,7 @@ func SetDeviceOrientationOverride(alpha float64, beta float64, gamma float64) *S
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DeviceOrientation.setDeviceOrientationOverride.
|
// Do executes DeviceOrientation.setDeviceOrientationOverride.
|
||||||
func (p *SetDeviceOrientationOverrideParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetDeviceOrientationOverrideParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -67,13 +47,13 @@ func (p *SetDeviceOrientationOverrideParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDeviceOrientationSetDeviceOrientationOverride, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDeviceOrientationSetDeviceOrientationOverride, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -85,10 +65,10 @@ func (p *SetDeviceOrientationOverrideParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearDeviceOrientationOverrideParams clears the overridden Device
|
// ClearDeviceOrientationOverrideParams clears the overridden Device
|
||||||
|
@ -101,19 +81,19 @@ func ClearDeviceOrientationOverride() *ClearDeviceOrientationOverrideParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DeviceOrientation.clearDeviceOrientationOverride.
|
// Do executes DeviceOrientation.clearDeviceOrientationOverride.
|
||||||
func (p *ClearDeviceOrientationOverrideParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearDeviceOrientationOverrideParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDeviceOrientationClearDeviceOrientationOverride, Empty)
|
ch := h.Execute(ctxt, cdp.CommandDeviceOrientationClearDeviceOrientationOverride, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -125,8 +105,8 @@ func (p *ClearDeviceOrientationOverrideParams) Do(ctxt context.Context, h FrameH
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
820
cdp/dom/dom.go
820
cdp/dom/dom.go
File diff suppressed because it is too large
Load Diff
|
@ -3,27 +3,7 @@ package dom
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventDocumentUpdated fired when Document has been totally updated. Node
|
// EventDocumentUpdated fired when Document has been totally updated. Node
|
||||||
|
@ -33,114 +13,115 @@ type EventDocumentUpdated struct{}
|
||||||
// EventInspectNodeRequested fired when the node should be inspected. This
|
// EventInspectNodeRequested fired when the node should be inspected. This
|
||||||
// happens after call to setInspectMode.
|
// happens after call to setInspectMode.
|
||||||
type EventInspectNodeRequested struct {
|
type EventInspectNodeRequested struct {
|
||||||
BackendNodeID BackendNodeID `json:"backendNodeId,omitempty"` // Id of the node to inspect.
|
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Id of the node to inspect.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventSetChildNodes fired when backend wants to provide client with the
|
// EventSetChildNodes fired when backend wants to provide client with the
|
||||||
// missing DOM structure. This happens upon most of the calls requesting node
|
// missing DOM structure. This happens upon most of the calls requesting node
|
||||||
// ids.
|
// ids.
|
||||||
type EventSetChildNodes struct {
|
type EventSetChildNodes struct {
|
||||||
ParentID NodeID `json:"parentId,omitempty"` // Parent node id to populate with children.
|
ParentID cdp.NodeID `json:"parentId,omitempty"` // Parent node id to populate with children.
|
||||||
Nodes []*Node `json:"nodes,omitempty"` // Child nodes array.
|
Nodes []*cdp.Node `json:"nodes,omitempty"` // Child nodes array.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventAttributeModified fired when Element's attribute is modified.
|
// EventAttributeModified fired when Element's attribute is modified.
|
||||||
type EventAttributeModified struct {
|
type EventAttributeModified struct {
|
||||||
NodeID NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
||||||
Name string `json:"name,omitempty"` // Attribute name.
|
Name string `json:"name,omitempty"` // Attribute name.
|
||||||
Value string `json:"value,omitempty"` // Attribute value.
|
Value string `json:"value,omitempty"` // Attribute value.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventAttributeRemoved fired when Element's attribute is removed.
|
// EventAttributeRemoved fired when Element's attribute is removed.
|
||||||
type EventAttributeRemoved struct {
|
type EventAttributeRemoved struct {
|
||||||
NodeID NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
||||||
Name string `json:"name,omitempty"` // A ttribute name.
|
Name string `json:"name,omitempty"` // A ttribute name.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventInlineStyleInvalidated fired when Element's inline style is modified
|
// EventInlineStyleInvalidated fired when Element's inline style is modified
|
||||||
// via a CSS property modification.
|
// via a CSS property modification.
|
||||||
type EventInlineStyleInvalidated struct {
|
type EventInlineStyleInvalidated struct {
|
||||||
NodeIds []NodeID `json:"nodeIds,omitempty"` // Ids of the nodes for which the inline styles have been invalidated.
|
NodeIds []cdp.NodeID `json:"nodeIds,omitempty"` // Ids of the nodes for which the inline styles have been invalidated.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventCharacterDataModified mirrors DOMCharacterDataModified event.
|
// EventCharacterDataModified mirrors DOMCharacterDataModified event.
|
||||||
type EventCharacterDataModified struct {
|
type EventCharacterDataModified struct {
|
||||||
NodeID NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
||||||
CharacterData string `json:"characterData,omitempty"` // New text value.
|
CharacterData string `json:"characterData,omitempty"` // New text value.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventChildNodeCountUpdated fired when Container's child node count has
|
// EventChildNodeCountUpdated fired when Container's child node count has
|
||||||
// changed.
|
// changed.
|
||||||
type EventChildNodeCountUpdated struct {
|
type EventChildNodeCountUpdated struct {
|
||||||
NodeID NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node that has changed.
|
||||||
ChildNodeCount int64 `json:"childNodeCount,omitempty"` // New node count.
|
ChildNodeCount int64 `json:"childNodeCount,omitempty"` // New node count.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventChildNodeInserted mirrors DOMNodeInserted event.
|
// EventChildNodeInserted mirrors DOMNodeInserted event.
|
||||||
type EventChildNodeInserted struct {
|
type EventChildNodeInserted struct {
|
||||||
ParentNodeID NodeID `json:"parentNodeId,omitempty"` // Id of the node that has changed.
|
ParentNodeID cdp.NodeID `json:"parentNodeId,omitempty"` // Id of the node that has changed.
|
||||||
PreviousNodeID NodeID `json:"previousNodeId,omitempty"` // If of the previous siblint.
|
PreviousNodeID cdp.NodeID `json:"previousNodeId,omitempty"` // If of the previous siblint.
|
||||||
Node *Node `json:"node,omitempty"` // Inserted node data.
|
Node *cdp.Node `json:"node,omitempty"` // Inserted node data.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventChildNodeRemoved mirrors DOMNodeRemoved event.
|
// EventChildNodeRemoved mirrors DOMNodeRemoved event.
|
||||||
type EventChildNodeRemoved struct {
|
type EventChildNodeRemoved struct {
|
||||||
ParentNodeID NodeID `json:"parentNodeId,omitempty"` // Parent id.
|
ParentNodeID cdp.NodeID `json:"parentNodeId,omitempty"` // Parent id.
|
||||||
NodeID NodeID `json:"nodeId,omitempty"` // Id of the node that has been removed.
|
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node that has been removed.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventShadowRootPushed called when shadow root is pushed into the element.
|
// EventShadowRootPushed called when shadow root is pushed into the element.
|
||||||
type EventShadowRootPushed struct {
|
type EventShadowRootPushed struct {
|
||||||
HostID NodeID `json:"hostId,omitempty"` // Host element id.
|
HostID cdp.NodeID `json:"hostId,omitempty"` // Host element id.
|
||||||
Root *Node `json:"root,omitempty"` // Shadow root.
|
Root *cdp.Node `json:"root,omitempty"` // Shadow root.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventShadowRootPopped called when shadow root is popped from the element.
|
// EventShadowRootPopped called when shadow root is popped from the element.
|
||||||
type EventShadowRootPopped struct {
|
type EventShadowRootPopped struct {
|
||||||
HostID NodeID `json:"hostId,omitempty"` // Host element id.
|
HostID cdp.NodeID `json:"hostId,omitempty"` // Host element id.
|
||||||
RootID NodeID `json:"rootId,omitempty"` // Shadow root id.
|
RootID cdp.NodeID `json:"rootId,omitempty"` // Shadow root id.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventPseudoElementAdded called when a pseudo element is added to an
|
// EventPseudoElementAdded called when a pseudo element is added to an
|
||||||
// element.
|
// element.
|
||||||
type EventPseudoElementAdded struct {
|
type EventPseudoElementAdded struct {
|
||||||
ParentID NodeID `json:"parentId,omitempty"` // Pseudo element's parent element id.
|
ParentID cdp.NodeID `json:"parentId,omitempty"` // Pseudo element's parent element id.
|
||||||
PseudoElement *Node `json:"pseudoElement,omitempty"` // The added pseudo element.
|
PseudoElement *cdp.Node `json:"pseudoElement,omitempty"` // The added pseudo element.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventPseudoElementRemoved called when a pseudo element is removed from an
|
// EventPseudoElementRemoved called when a pseudo element is removed from an
|
||||||
// element.
|
// element.
|
||||||
type EventPseudoElementRemoved struct {
|
type EventPseudoElementRemoved struct {
|
||||||
ParentID NodeID `json:"parentId,omitempty"` // Pseudo element's parent element id.
|
ParentID cdp.NodeID `json:"parentId,omitempty"` // Pseudo element's parent element id.
|
||||||
PseudoElementID NodeID `json:"pseudoElementId,omitempty"` // The removed pseudo element id.
|
PseudoElementID cdp.NodeID `json:"pseudoElementId,omitempty"` // The removed pseudo element id.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventDistributedNodesUpdated called when distrubution is changed.
|
// EventDistributedNodesUpdated called when distrubution is changed.
|
||||||
type EventDistributedNodesUpdated struct {
|
type EventDistributedNodesUpdated struct {
|
||||||
InsertionPointID NodeID `json:"insertionPointId,omitempty"` // Insertion point where distrubuted nodes were updated.
|
InsertionPointID cdp.NodeID `json:"insertionPointId,omitempty"` // Insertion point where distrubuted nodes were updated.
|
||||||
DistributedNodes []*BackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point.
|
DistributedNodes []*cdp.BackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventNodeHighlightRequested [no description].
|
||||||
type EventNodeHighlightRequested struct {
|
type EventNodeHighlightRequested struct {
|
||||||
NodeID NodeID `json:"nodeId,omitempty"`
|
NodeID cdp.NodeID `json:"nodeId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventDOMDocumentUpdated,
|
cdp.EventDOMDocumentUpdated,
|
||||||
EventDOMInspectNodeRequested,
|
cdp.EventDOMInspectNodeRequested,
|
||||||
EventDOMSetChildNodes,
|
cdp.EventDOMSetChildNodes,
|
||||||
EventDOMAttributeModified,
|
cdp.EventDOMAttributeModified,
|
||||||
EventDOMAttributeRemoved,
|
cdp.EventDOMAttributeRemoved,
|
||||||
EventDOMInlineStyleInvalidated,
|
cdp.EventDOMInlineStyleInvalidated,
|
||||||
EventDOMCharacterDataModified,
|
cdp.EventDOMCharacterDataModified,
|
||||||
EventDOMChildNodeCountUpdated,
|
cdp.EventDOMChildNodeCountUpdated,
|
||||||
EventDOMChildNodeInserted,
|
cdp.EventDOMChildNodeInserted,
|
||||||
EventDOMChildNodeRemoved,
|
cdp.EventDOMChildNodeRemoved,
|
||||||
EventDOMShadowRootPushed,
|
cdp.EventDOMShadowRootPushed,
|
||||||
EventDOMShadowRootPopped,
|
cdp.EventDOMShadowRootPopped,
|
||||||
EventDOMPseudoElementAdded,
|
cdp.EventDOMPseudoElementAdded,
|
||||||
EventDOMPseudoElementRemoved,
|
cdp.EventDOMPseudoElementRemoved,
|
||||||
EventDOMDistributedNodesUpdated,
|
cdp.EventDOMDistributedNodesUpdated,
|
||||||
EventDOMNodeHighlightRequested,
|
cdp.EventDOMNodeHighlightRequested,
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,32 +5,12 @@ package dom
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// Quad an array of quad vertices, x immediately followed by y for each
|
// Quad an array of quad vertices, x immediately followed by y for each
|
||||||
// point, points clock-wise.
|
// point, points clock-wise.
|
||||||
type Quad []float64
|
type Quad []float64
|
||||||
|
@ -63,20 +43,21 @@ type Rect struct {
|
||||||
|
|
||||||
// HighlightConfig configuration data for the highlighting of page elements.
|
// HighlightConfig configuration data for the highlighting of page elements.
|
||||||
type HighlightConfig struct {
|
type HighlightConfig struct {
|
||||||
ShowInfo bool `json:"showInfo,omitempty"` // Whether the node info tooltip should be shown (default: false).
|
ShowInfo bool `json:"showInfo,omitempty"` // Whether the node info tooltip should be shown (default: false).
|
||||||
ShowRulers bool `json:"showRulers,omitempty"` // Whether the rulers should be shown (default: false).
|
ShowRulers bool `json:"showRulers,omitempty"` // Whether the rulers should be shown (default: false).
|
||||||
ShowExtensionLines bool `json:"showExtensionLines,omitempty"` // Whether the extension lines from node to the rulers should be shown (default: false).
|
ShowExtensionLines bool `json:"showExtensionLines,omitempty"` // Whether the extension lines from node to the rulers should be shown (default: false).
|
||||||
DisplayAsMaterial bool `json:"displayAsMaterial,omitempty"`
|
DisplayAsMaterial bool `json:"displayAsMaterial,omitempty"`
|
||||||
ContentColor *RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent).
|
ContentColor *cdp.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent).
|
||||||
PaddingColor *RGBA `json:"paddingColor,omitempty"` // The padding highlight fill color (default: transparent).
|
PaddingColor *cdp.RGBA `json:"paddingColor,omitempty"` // The padding highlight fill color (default: transparent).
|
||||||
BorderColor *RGBA `json:"borderColor,omitempty"` // The border highlight fill color (default: transparent).
|
BorderColor *cdp.RGBA `json:"borderColor,omitempty"` // The border highlight fill color (default: transparent).
|
||||||
MarginColor *RGBA `json:"marginColor,omitempty"` // The margin highlight fill color (default: transparent).
|
MarginColor *cdp.RGBA `json:"marginColor,omitempty"` // The margin highlight fill color (default: transparent).
|
||||||
EventTargetColor *RGBA `json:"eventTargetColor,omitempty"` // The event target element highlight fill color (default: transparent).
|
EventTargetColor *cdp.RGBA `json:"eventTargetColor,omitempty"` // The event target element highlight fill color (default: transparent).
|
||||||
ShapeColor *RGBA `json:"shapeColor,omitempty"` // The shape outside fill color (default: transparent).
|
ShapeColor *cdp.RGBA `json:"shapeColor,omitempty"` // The shape outside fill color (default: transparent).
|
||||||
ShapeMarginColor *RGBA `json:"shapeMarginColor,omitempty"` // The shape margin fill color (default: transparent).
|
ShapeMarginColor *cdp.RGBA `json:"shapeMarginColor,omitempty"` // The shape margin fill color (default: transparent).
|
||||||
SelectorList string `json:"selectorList,omitempty"` // Selectors to highlight relevant nodes.
|
SelectorList string `json:"selectorList,omitempty"` // Selectors to highlight relevant nodes.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InspectMode [no description].
|
||||||
type InspectMode string
|
type InspectMode string
|
||||||
|
|
||||||
// String returns the InspectMode as string value.
|
// String returns the InspectMode as string value.
|
||||||
|
|
|
@ -13,51 +13,31 @@ package domdebugger
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// SetDOMBreakpointParams sets breakpoint on particular operation with DOM.
|
// SetDOMBreakpointParams sets breakpoint on particular operation with DOM.
|
||||||
type SetDOMBreakpointParams struct {
|
type SetDOMBreakpointParams struct {
|
||||||
NodeID NodeID `json:"nodeId"` // Identifier of the node to set breakpoint on.
|
NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to set breakpoint on.
|
||||||
Type DOMBreakpointType `json:"type"` // Type of the operation to stop upon.
|
Type DOMBreakpointType `json:"type"` // Type of the operation to stop upon.
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDOMBreakpoint sets breakpoint on particular operation with DOM.
|
// SetDOMBreakpoint sets breakpoint on particular operation with DOM.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// nodeId - Identifier of the node to set breakpoint on.
|
// nodeID - Identifier of the node to set breakpoint on.
|
||||||
// type - Type of the operation to stop upon.
|
// type - Type of the operation to stop upon.
|
||||||
func SetDOMBreakpoint(nodeId NodeID, type_ DOMBreakpointType) *SetDOMBreakpointParams {
|
func SetDOMBreakpoint(nodeID cdp.NodeID, typeVal DOMBreakpointType) *SetDOMBreakpointParams {
|
||||||
return &SetDOMBreakpointParams{
|
return &SetDOMBreakpointParams{
|
||||||
NodeID: nodeId,
|
NodeID: nodeID,
|
||||||
Type: type_,
|
Type: typeVal,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.setDOMBreakpoint.
|
// Do executes DOMDebugger.setDOMBreakpoint.
|
||||||
func (p *SetDOMBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetDOMBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -69,13 +49,13 @@ func (p *SetDOMBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerSetDOMBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerSetDOMBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -87,16 +67,16 @@ func (p *SetDOMBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveDOMBreakpointParams removes DOM breakpoint that was set using
|
// RemoveDOMBreakpointParams removes DOM breakpoint that was set using
|
||||||
// setDOMBreakpoint.
|
// setDOMBreakpoint.
|
||||||
type RemoveDOMBreakpointParams struct {
|
type RemoveDOMBreakpointParams struct {
|
||||||
NodeID NodeID `json:"nodeId"` // Identifier of the node to remove breakpoint from.
|
NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to remove breakpoint from.
|
||||||
Type DOMBreakpointType `json:"type"` // Type of the breakpoint to remove.
|
Type DOMBreakpointType `json:"type"` // Type of the breakpoint to remove.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,17 +84,17 @@ type RemoveDOMBreakpointParams struct {
|
||||||
// setDOMBreakpoint.
|
// setDOMBreakpoint.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// nodeId - Identifier of the node to remove breakpoint from.
|
// nodeID - Identifier of the node to remove breakpoint from.
|
||||||
// type - Type of the breakpoint to remove.
|
// type - Type of the breakpoint to remove.
|
||||||
func RemoveDOMBreakpoint(nodeId NodeID, type_ DOMBreakpointType) *RemoveDOMBreakpointParams {
|
func RemoveDOMBreakpoint(nodeID cdp.NodeID, typeVal DOMBreakpointType) *RemoveDOMBreakpointParams {
|
||||||
return &RemoveDOMBreakpointParams{
|
return &RemoveDOMBreakpointParams{
|
||||||
NodeID: nodeId,
|
NodeID: nodeID,
|
||||||
Type: type_,
|
Type: typeVal,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.removeDOMBreakpoint.
|
// Do executes DOMDebugger.removeDOMBreakpoint.
|
||||||
func (p *RemoveDOMBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RemoveDOMBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -126,13 +106,13 @@ func (p *RemoveDOMBreakpointParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerRemoveDOMBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveDOMBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -144,10 +124,10 @@ func (p *RemoveDOMBreakpointParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetEventListenerBreakpointParams sets breakpoint on particular DOM event.
|
// SetEventListenerBreakpointParams sets breakpoint on particular DOM event.
|
||||||
|
@ -174,7 +154,7 @@ func (p SetEventListenerBreakpointParams) WithTargetName(targetName string) *Set
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.setEventListenerBreakpoint.
|
// Do executes DOMDebugger.setEventListenerBreakpoint.
|
||||||
func (p *SetEventListenerBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetEventListenerBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -186,13 +166,13 @@ func (p *SetEventListenerBreakpointParams) Do(ctxt context.Context, h FrameHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerSetEventListenerBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerSetEventListenerBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -204,10 +184,10 @@ func (p *SetEventListenerBreakpointParams) Do(ctxt context.Context, h FrameHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveEventListenerBreakpointParams removes breakpoint on particular DOM
|
// RemoveEventListenerBreakpointParams removes breakpoint on particular DOM
|
||||||
|
@ -234,7 +214,7 @@ func (p RemoveEventListenerBreakpointParams) WithTargetName(targetName string) *
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.removeEventListenerBreakpoint.
|
// Do executes DOMDebugger.removeEventListenerBreakpoint.
|
||||||
func (p *RemoveEventListenerBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RemoveEventListenerBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -246,13 +226,13 @@ func (p *RemoveEventListenerBreakpointParams) Do(ctxt context.Context, h FrameHa
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerRemoveEventListenerBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveEventListenerBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -264,10 +244,10 @@ func (p *RemoveEventListenerBreakpointParams) Do(ctxt context.Context, h FrameHa
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetInstrumentationBreakpointParams sets breakpoint on particular native
|
// SetInstrumentationBreakpointParams sets breakpoint on particular native
|
||||||
|
@ -287,7 +267,7 @@ func SetInstrumentationBreakpoint(eventName string) *SetInstrumentationBreakpoin
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.setInstrumentationBreakpoint.
|
// Do executes DOMDebugger.setInstrumentationBreakpoint.
|
||||||
func (p *SetInstrumentationBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetInstrumentationBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -299,13 +279,13 @@ func (p *SetInstrumentationBreakpointParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerSetInstrumentationBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerSetInstrumentationBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -317,10 +297,10 @@ func (p *SetInstrumentationBreakpointParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveInstrumentationBreakpointParams removes breakpoint on particular
|
// RemoveInstrumentationBreakpointParams removes breakpoint on particular
|
||||||
|
@ -341,7 +321,7 @@ func RemoveInstrumentationBreakpoint(eventName string) *RemoveInstrumentationBre
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.removeInstrumentationBreakpoint.
|
// Do executes DOMDebugger.removeInstrumentationBreakpoint.
|
||||||
func (p *RemoveInstrumentationBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RemoveInstrumentationBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -353,13 +333,13 @@ func (p *RemoveInstrumentationBreakpointParams) Do(ctxt context.Context, h Frame
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerRemoveInstrumentationBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveInstrumentationBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -371,10 +351,10 @@ func (p *RemoveInstrumentationBreakpointParams) Do(ctxt context.Context, h Frame
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetXHRBreakpointParams sets breakpoint on XMLHttpRequest.
|
// SetXHRBreakpointParams sets breakpoint on XMLHttpRequest.
|
||||||
|
@ -393,7 +373,7 @@ func SetXHRBreakpoint(url string) *SetXHRBreakpointParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.setXHRBreakpoint.
|
// Do executes DOMDebugger.setXHRBreakpoint.
|
||||||
func (p *SetXHRBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetXHRBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -405,13 +385,13 @@ func (p *SetXHRBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerSetXHRBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerSetXHRBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -423,10 +403,10 @@ func (p *SetXHRBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveXHRBreakpointParams removes breakpoint from XMLHttpRequest.
|
// RemoveXHRBreakpointParams removes breakpoint from XMLHttpRequest.
|
||||||
|
@ -445,7 +425,7 @@ func RemoveXHRBreakpoint(url string) *RemoveXHRBreakpointParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMDebugger.removeXHRBreakpoint.
|
// Do executes DOMDebugger.removeXHRBreakpoint.
|
||||||
func (p *RemoveXHRBreakpointParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RemoveXHRBreakpointParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -457,13 +437,13 @@ func (p *RemoveXHRBreakpointParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerRemoveXHRBreakpoint, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerRemoveXHRBreakpoint, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -475,10 +455,10 @@ func (p *RemoveXHRBreakpointParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEventListenersParams returns event listeners of the given object.
|
// GetEventListenersParams returns event listeners of the given object.
|
||||||
|
@ -489,10 +469,10 @@ type GetEventListenersParams struct {
|
||||||
// GetEventListeners returns event listeners of the given object.
|
// GetEventListeners returns event listeners of the given object.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// objectId - Identifier of the object to return listeners for.
|
// objectID - Identifier of the object to return listeners for.
|
||||||
func GetEventListeners(objectId runtime.RemoteObjectID) *GetEventListenersParams {
|
func GetEventListeners(objectID runtime.RemoteObjectID) *GetEventListenersParams {
|
||||||
return &GetEventListenersParams{
|
return &GetEventListenersParams{
|
||||||
ObjectID: objectId,
|
ObjectID: objectID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,7 +485,7 @@ type GetEventListenersReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// listeners - Array of relevant listeners.
|
// listeners - Array of relevant listeners.
|
||||||
func (p *GetEventListenersParams) Do(ctxt context.Context, h FrameHandler) (listeners []*EventListener, err error) {
|
func (p *GetEventListenersParams) Do(ctxt context.Context, h cdp.FrameHandler) (listeners []*EventListener, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -517,13 +497,13 @@ func (p *GetEventListenersParams) Do(ctxt context.Context, h FrameHandler) (list
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMDebuggerGetEventListeners, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMDebuggerGetEventListeners, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -532,7 +512,7 @@ func (p *GetEventListenersParams) Do(ctxt context.Context, h FrameHandler) (list
|
||||||
var r GetEventListenersReturns
|
var r GetEventListenersReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Listeners, nil
|
return r.Listeners, nil
|
||||||
|
@ -542,8 +522,8 @@ func (p *GetEventListenersParams) Do(ctxt context.Context, h FrameHandler) (list
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,15 @@
|
||||||
package domdebugger
|
package domdebugger
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// DOMBreakpointType dOM breakpoint type.
|
// DOMBreakpointType dOM breakpoint type.
|
||||||
type DOMBreakpointType string
|
type DOMBreakpointType string
|
||||||
|
|
|
@ -11,30 +11,10 @@ package domstorage
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables storage tracking, storage events will now be
|
// EnableParams enables storage tracking, storage events will now be
|
||||||
// delivered to the client.
|
// delivered to the client.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
@ -46,19 +26,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMStorage.enable.
|
// Do executes DOMStorage.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMStorageEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandDOMStorageEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -70,10 +50,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables storage tracking, prevents storage events from
|
// DisableParams disables storage tracking, prevents storage events from
|
||||||
|
@ -87,19 +67,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMStorage.disable.
|
// Do executes DOMStorage.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMStorageDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandDOMStorageDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -111,26 +91,29 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ClearParams [no description].
|
||||||
type ClearParams struct {
|
type ClearParams struct {
|
||||||
StorageID *StorageID `json:"storageId"`
|
StorageID *StorageID `json:"storageId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// storageId
|
// storageID
|
||||||
func Clear(storageId *StorageID) *ClearParams {
|
func Clear(storageID *StorageID) *ClearParams {
|
||||||
return &ClearParams{
|
return &ClearParams{
|
||||||
StorageID: storageId,
|
StorageID: storageID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMStorage.clear.
|
// Do executes DOMStorage.clear.
|
||||||
func (p *ClearParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -142,13 +125,13 @@ func (p *ClearParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMStorageClear, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMStorageClear, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -160,21 +143,24 @@ func (p *ClearParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDOMStorageItemsParams [no description].
|
||||||
type GetDOMStorageItemsParams struct {
|
type GetDOMStorageItemsParams struct {
|
||||||
StorageID *StorageID `json:"storageId"`
|
StorageID *StorageID `json:"storageId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDOMStorageItems [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// storageId
|
// storageID
|
||||||
func GetDOMStorageItems(storageId *StorageID) *GetDOMStorageItemsParams {
|
func GetDOMStorageItems(storageID *StorageID) *GetDOMStorageItemsParams {
|
||||||
return &GetDOMStorageItemsParams{
|
return &GetDOMStorageItemsParams{
|
||||||
StorageID: storageId,
|
StorageID: storageID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +173,7 @@ type GetDOMStorageItemsReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// entries
|
// entries
|
||||||
func (p *GetDOMStorageItemsParams) Do(ctxt context.Context, h FrameHandler) (entries []Item, err error) {
|
func (p *GetDOMStorageItemsParams) Do(ctxt context.Context, h cdp.FrameHandler) (entries []Item, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -199,13 +185,13 @@ func (p *GetDOMStorageItemsParams) Do(ctxt context.Context, h FrameHandler) (ent
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMStorageGetDOMStorageItems, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMStorageGetDOMStorageItems, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -214,7 +200,7 @@ func (p *GetDOMStorageItemsParams) Do(ctxt context.Context, h FrameHandler) (ent
|
||||||
var r GetDOMStorageItemsReturns
|
var r GetDOMStorageItemsReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Entries, nil
|
return r.Entries, nil
|
||||||
|
@ -224,32 +210,35 @@ func (p *GetDOMStorageItemsParams) Do(ctxt context.Context, h FrameHandler) (ent
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetDOMStorageItemParams [no description].
|
||||||
type SetDOMStorageItemParams struct {
|
type SetDOMStorageItemParams struct {
|
||||||
StorageID *StorageID `json:"storageId"`
|
StorageID *StorageID `json:"storageId"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetDOMStorageItem [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// storageId
|
// storageID
|
||||||
// key
|
// key
|
||||||
// value
|
// value
|
||||||
func SetDOMStorageItem(storageId *StorageID, key string, value string) *SetDOMStorageItemParams {
|
func SetDOMStorageItem(storageID *StorageID, key string, value string) *SetDOMStorageItemParams {
|
||||||
return &SetDOMStorageItemParams{
|
return &SetDOMStorageItemParams{
|
||||||
StorageID: storageId,
|
StorageID: storageID,
|
||||||
Key: key,
|
Key: key,
|
||||||
Value: value,
|
Value: value,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMStorage.setDOMStorageItem.
|
// Do executes DOMStorage.setDOMStorageItem.
|
||||||
func (p *SetDOMStorageItemParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetDOMStorageItemParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -261,13 +250,13 @@ func (p *SetDOMStorageItemParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMStorageSetDOMStorageItem, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMStorageSetDOMStorageItem, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -279,29 +268,32 @@ func (p *SetDOMStorageItemParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveDOMStorageItemParams [no description].
|
||||||
type RemoveDOMStorageItemParams struct {
|
type RemoveDOMStorageItemParams struct {
|
||||||
StorageID *StorageID `json:"storageId"`
|
StorageID *StorageID `json:"storageId"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveDOMStorageItem [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// storageId
|
// storageID
|
||||||
// key
|
// key
|
||||||
func RemoveDOMStorageItem(storageId *StorageID, key string) *RemoveDOMStorageItemParams {
|
func RemoveDOMStorageItem(storageID *StorageID, key string) *RemoveDOMStorageItemParams {
|
||||||
return &RemoveDOMStorageItemParams{
|
return &RemoveDOMStorageItemParams{
|
||||||
StorageID: storageId,
|
StorageID: storageID,
|
||||||
Key: key,
|
Key: key,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes DOMStorage.removeDOMStorageItem.
|
// Do executes DOMStorage.removeDOMStorageItem.
|
||||||
func (p *RemoveDOMStorageItemParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RemoveDOMStorageItemParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -313,13 +305,13 @@ func (p *RemoveDOMStorageItemParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandDOMStorageRemoveDOMStorageItem, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandDOMStorageRemoveDOMStorageItem, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -331,8 +323,8 @@ func (p *RemoveDOMStorageItemParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,44 +3,28 @@ package domstorage
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventDomStorageItemsCleared [no description].
|
||||||
type EventDomStorageItemsCleared struct {
|
type EventDomStorageItemsCleared struct {
|
||||||
StorageID *StorageID `json:"storageId,omitempty"`
|
StorageID *StorageID `json:"storageId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventDomStorageItemRemoved [no description].
|
||||||
type EventDomStorageItemRemoved struct {
|
type EventDomStorageItemRemoved struct {
|
||||||
StorageID *StorageID `json:"storageId,omitempty"`
|
StorageID *StorageID `json:"storageId,omitempty"`
|
||||||
Key string `json:"key,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventDomStorageItemAdded [no description].
|
||||||
type EventDomStorageItemAdded struct {
|
type EventDomStorageItemAdded struct {
|
||||||
StorageID *StorageID `json:"storageId,omitempty"`
|
StorageID *StorageID `json:"storageId,omitempty"`
|
||||||
Key string `json:"key,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
NewValue string `json:"newValue,omitempty"`
|
NewValue string `json:"newValue,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventDomStorageItemUpdated [no description].
|
||||||
type EventDomStorageItemUpdated struct {
|
type EventDomStorageItemUpdated struct {
|
||||||
StorageID *StorageID `json:"storageId,omitempty"`
|
StorageID *StorageID `json:"storageId,omitempty"`
|
||||||
Key string `json:"key,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
|
@ -48,10 +32,10 @@ type EventDomStorageItemUpdated struct {
|
||||||
NewValue string `json:"newValue,omitempty"`
|
NewValue string `json:"newValue,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventDOMStorageDomStorageItemsCleared,
|
cdp.EventDOMStorageDomStorageItemsCleared,
|
||||||
EventDOMStorageDomStorageItemRemoved,
|
cdp.EventDOMStorageDomStorageItemRemoved,
|
||||||
EventDOMStorageDomStorageItemAdded,
|
cdp.EventDOMStorageDomStorageItemAdded,
|
||||||
EventDOMStorageDomStorageItemUpdated,
|
cdp.EventDOMStorageDomStorageItemUpdated,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,30 +2,6 @@ package domstorage
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// StorageID dOM Storage identifier.
|
// StorageID dOM Storage identifier.
|
||||||
type StorageID struct {
|
type StorageID struct {
|
||||||
SecurityOrigin string `json:"securityOrigin,omitempty"` // Security origin for the storage.
|
SecurityOrigin string `json:"securityOrigin,omitempty"` // Security origin for the storage.
|
||||||
|
|
|
@ -998,86 +998,7 @@ func (v *Frame) UnmarshalJSON(data []byte) error {
|
||||||
func (v *Frame) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *Frame) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp4(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp4(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdp5(in *jlexer.Lexer, out *ComputedProperty) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdp5(in *jlexer.Lexer, out *BackendNode) {
|
||||||
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 "name":
|
|
||||||
out.Name = string(in.String())
|
|
||||||
case "value":
|
|
||||||
out.Value = string(in.String())
|
|
||||||
default:
|
|
||||||
in.SkipRecursive()
|
|
||||||
}
|
|
||||||
in.WantComma()
|
|
||||||
}
|
|
||||||
in.Delim('}')
|
|
||||||
if isTopLevel {
|
|
||||||
in.Consumed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdp5(out *jwriter.Writer, in ComputedProperty) {
|
|
||||||
out.RawByte('{')
|
|
||||||
first := true
|
|
||||||
_ = first
|
|
||||||
if in.Name != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"name\":")
|
|
||||||
out.String(string(in.Name))
|
|
||||||
}
|
|
||||||
if in.Value != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"value\":")
|
|
||||||
out.String(string(in.Value))
|
|
||||||
}
|
|
||||||
out.RawByte('}')
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
|
||||||
func (v ComputedProperty) MarshalJSON() ([]byte, error) {
|
|
||||||
w := jwriter.Writer{}
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdp5(&w, v)
|
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
||||||
func (v ComputedProperty) MarshalEasyJSON(w *jwriter.Writer) {
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdp5(w, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
|
||||||
func (v *ComputedProperty) UnmarshalJSON(data []byte) error {
|
|
||||||
r := jlexer.Lexer{Data: data}
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp5(&r, v)
|
|
||||||
return r.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
||||||
func (v *ComputedProperty) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp5(l, v)
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdp6(in *jlexer.Lexer, out *BackendNode) {
|
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -1112,7 +1033,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdp6(in *jlexer.Lexer, out *Backe
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdp6(out *jwriter.Writer, in BackendNode) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdp5(out *jwriter.Writer, in BackendNode) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -1146,23 +1067,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdp6(out *jwriter.Writer, in Back
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v BackendNode) MarshalJSON() ([]byte, error) {
|
func (v BackendNode) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdp6(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdp5(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v BackendNode) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v BackendNode) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdp6(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdp5(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *BackendNode) UnmarshalJSON(data []byte) error {
|
func (v *BackendNode) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp6(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp5(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *BackendNode) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *BackendNode) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp6(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdp5(l, v)
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,30 +11,10 @@ package emulation
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// SetDeviceMetricsOverrideParams overrides the values of device screen
|
// SetDeviceMetricsOverrideParams overrides the values of device screen
|
||||||
// dimensions (window.screen.width, window.screen.height, window.innerWidth,
|
// dimensions (window.screen.width, window.screen.height, window.innerWidth,
|
||||||
// window.innerHeight, and "device-width"/"device-height"-related CSS media
|
// window.innerHeight, and "device-width"/"device-height"-related CSS media
|
||||||
|
@ -116,7 +96,7 @@ func (p SetDeviceMetricsOverrideParams) WithScreenOrientation(screenOrientation
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setDeviceMetricsOverride.
|
// Do executes Emulation.setDeviceMetricsOverride.
|
||||||
func (p *SetDeviceMetricsOverrideParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetDeviceMetricsOverrideParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -128,13 +108,13 @@ func (p *SetDeviceMetricsOverrideParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetDeviceMetricsOverride, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetDeviceMetricsOverride, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -146,10 +126,10 @@ func (p *SetDeviceMetricsOverrideParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearDeviceMetricsOverrideParams clears the overriden device metrics.
|
// ClearDeviceMetricsOverrideParams clears the overriden device metrics.
|
||||||
|
@ -161,19 +141,19 @@ func ClearDeviceMetricsOverride() *ClearDeviceMetricsOverrideParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.clearDeviceMetricsOverride.
|
// Do executes Emulation.clearDeviceMetricsOverride.
|
||||||
func (p *ClearDeviceMetricsOverrideParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearDeviceMetricsOverrideParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationClearDeviceMetricsOverride, Empty)
|
ch := h.Execute(ctxt, cdp.CommandEmulationClearDeviceMetricsOverride, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -185,10 +165,10 @@ func (p *ClearDeviceMetricsOverrideParams) Do(ctxt context.Context, h FrameHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ForceViewportParams overrides the visible area of the page. The change is
|
// ForceViewportParams overrides the visible area of the page. The change is
|
||||||
|
@ -219,7 +199,7 @@ func ForceViewport(x float64, y float64, scale float64) *ForceViewportParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.forceViewport.
|
// Do executes Emulation.forceViewport.
|
||||||
func (p *ForceViewportParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ForceViewportParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -231,13 +211,13 @@ func (p *ForceViewportParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationForceViewport, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationForceViewport, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -249,10 +229,10 @@ func (p *ForceViewportParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResetViewportParams resets the visible area of the page to the original
|
// ResetViewportParams resets the visible area of the page to the original
|
||||||
|
@ -266,19 +246,19 @@ func ResetViewport() *ResetViewportParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.resetViewport.
|
// Do executes Emulation.resetViewport.
|
||||||
func (p *ResetViewportParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ResetViewportParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationResetViewport, Empty)
|
ch := h.Execute(ctxt, cdp.CommandEmulationResetViewport, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -290,10 +270,10 @@ func (p *ResetViewportParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResetPageScaleFactorParams requests that page scale factor is reset to
|
// ResetPageScaleFactorParams requests that page scale factor is reset to
|
||||||
|
@ -307,19 +287,19 @@ func ResetPageScaleFactor() *ResetPageScaleFactorParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.resetPageScaleFactor.
|
// Do executes Emulation.resetPageScaleFactor.
|
||||||
func (p *ResetPageScaleFactorParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ResetPageScaleFactorParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationResetPageScaleFactor, Empty)
|
ch := h.Execute(ctxt, cdp.CommandEmulationResetPageScaleFactor, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -331,10 +311,10 @@ func (p *ResetPageScaleFactorParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetPageScaleFactorParams sets a specified page scale factor.
|
// SetPageScaleFactorParams sets a specified page scale factor.
|
||||||
|
@ -353,7 +333,7 @@ func SetPageScaleFactor(pageScaleFactor float64) *SetPageScaleFactorParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setPageScaleFactor.
|
// Do executes Emulation.setPageScaleFactor.
|
||||||
func (p *SetPageScaleFactorParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetPageScaleFactorParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -365,13 +345,13 @@ func (p *SetPageScaleFactorParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetPageScaleFactor, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetPageScaleFactor, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -383,10 +363,10 @@ func (p *SetPageScaleFactorParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetVisibleSizeParams resizes the frame/viewport of the page. Note that
|
// SetVisibleSizeParams resizes the frame/viewport of the page. Note that
|
||||||
|
@ -412,7 +392,7 @@ func SetVisibleSize(width int64, height int64) *SetVisibleSizeParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setVisibleSize.
|
// Do executes Emulation.setVisibleSize.
|
||||||
func (p *SetVisibleSizeParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetVisibleSizeParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -424,13 +404,13 @@ func (p *SetVisibleSizeParams) Do(ctxt context.Context, h FrameHandler) (err err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetVisibleSize, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetVisibleSize, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -442,10 +422,10 @@ func (p *SetVisibleSizeParams) Do(ctxt context.Context, h FrameHandler) (err err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetScriptExecutionDisabledParams switches script execution in the page.
|
// SetScriptExecutionDisabledParams switches script execution in the page.
|
||||||
|
@ -464,7 +444,7 @@ func SetScriptExecutionDisabled(value bool) *SetScriptExecutionDisabledParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setScriptExecutionDisabled.
|
// Do executes Emulation.setScriptExecutionDisabled.
|
||||||
func (p *SetScriptExecutionDisabledParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetScriptExecutionDisabledParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -476,13 +456,13 @@ func (p *SetScriptExecutionDisabledParams) Do(ctxt context.Context, h FrameHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetScriptExecutionDisabled, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetScriptExecutionDisabled, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -494,10 +474,10 @@ func (p *SetScriptExecutionDisabledParams) Do(ctxt context.Context, h FrameHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetGeolocationOverrideParams overrides the Geolocation Position or Error.
|
// SetGeolocationOverrideParams overrides the Geolocation Position or Error.
|
||||||
|
@ -535,7 +515,7 @@ func (p SetGeolocationOverrideParams) WithAccuracy(accuracy float64) *SetGeoloca
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setGeolocationOverride.
|
// Do executes Emulation.setGeolocationOverride.
|
||||||
func (p *SetGeolocationOverrideParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetGeolocationOverrideParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -547,13 +527,13 @@ func (p *SetGeolocationOverrideParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetGeolocationOverride, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetGeolocationOverride, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -565,10 +545,10 @@ func (p *SetGeolocationOverrideParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearGeolocationOverrideParams clears the overriden Geolocation Position
|
// ClearGeolocationOverrideParams clears the overriden Geolocation Position
|
||||||
|
@ -582,19 +562,19 @@ func ClearGeolocationOverride() *ClearGeolocationOverrideParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.clearGeolocationOverride.
|
// Do executes Emulation.clearGeolocationOverride.
|
||||||
func (p *ClearGeolocationOverrideParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearGeolocationOverrideParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationClearGeolocationOverride, Empty)
|
ch := h.Execute(ctxt, cdp.CommandEmulationClearGeolocationOverride, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -606,10 +586,10 @@ func (p *ClearGeolocationOverrideParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetTouchEmulationEnabledParams toggles mouse event-based touch event
|
// SetTouchEmulationEnabledParams toggles mouse event-based touch event
|
||||||
|
@ -637,7 +617,7 @@ func (p SetTouchEmulationEnabledParams) WithConfiguration(configuration EnabledC
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setTouchEmulationEnabled.
|
// Do executes Emulation.setTouchEmulationEnabled.
|
||||||
func (p *SetTouchEmulationEnabledParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetTouchEmulationEnabledParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -649,13 +629,13 @@ func (p *SetTouchEmulationEnabledParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetTouchEmulationEnabled, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetTouchEmulationEnabled, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -667,10 +647,10 @@ func (p *SetTouchEmulationEnabledParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetEmulatedMediaParams emulates the given media for CSS media queries.
|
// SetEmulatedMediaParams emulates the given media for CSS media queries.
|
||||||
|
@ -689,7 +669,7 @@ func SetEmulatedMedia(media string) *SetEmulatedMediaParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setEmulatedMedia.
|
// Do executes Emulation.setEmulatedMedia.
|
||||||
func (p *SetEmulatedMediaParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetEmulatedMediaParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -701,13 +681,13 @@ func (p *SetEmulatedMediaParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetEmulatedMedia, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetEmulatedMedia, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -719,10 +699,10 @@ func (p *SetEmulatedMediaParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCPUThrottlingRateParams enables CPU throttling to emulate slow CPUs.
|
// SetCPUThrottlingRateParams enables CPU throttling to emulate slow CPUs.
|
||||||
|
@ -741,7 +721,7 @@ func SetCPUThrottlingRate(rate float64) *SetCPUThrottlingRateParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setCPUThrottlingRate.
|
// Do executes Emulation.setCPUThrottlingRate.
|
||||||
func (p *SetCPUThrottlingRateParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetCPUThrottlingRateParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -753,13 +733,13 @@ func (p *SetCPUThrottlingRateParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetCPUThrottlingRate, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetCPUThrottlingRate, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -771,10 +751,10 @@ func (p *SetCPUThrottlingRateParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanEmulateParams tells whether emulation is supported.
|
// CanEmulateParams tells whether emulation is supported.
|
||||||
|
@ -794,19 +774,19 @@ type CanEmulateReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// result - True if emulation is supported.
|
// result - True if emulation is supported.
|
||||||
func (p *CanEmulateParams) Do(ctxt context.Context, h FrameHandler) (result bool, err error) {
|
func (p *CanEmulateParams) Do(ctxt context.Context, h cdp.FrameHandler) (result bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationCanEmulate, Empty)
|
ch := h.Execute(ctxt, cdp.CommandEmulationCanEmulate, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -815,7 +795,7 @@ func (p *CanEmulateParams) Do(ctxt context.Context, h FrameHandler) (result bool
|
||||||
var r CanEmulateReturns
|
var r CanEmulateReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, nil
|
return r.Result, nil
|
||||||
|
@ -825,10 +805,10 @@ func (p *CanEmulateParams) Do(ctxt context.Context, h FrameHandler) (result bool
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetVirtualTimePolicyParams turns on virtual time for all frames (replacing
|
// SetVirtualTimePolicyParams turns on virtual time for all frames (replacing
|
||||||
|
@ -859,7 +839,7 @@ func (p SetVirtualTimePolicyParams) WithBudget(budget int64) *SetVirtualTimePoli
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Emulation.setVirtualTimePolicy.
|
// Do executes Emulation.setVirtualTimePolicy.
|
||||||
func (p *SetVirtualTimePolicyParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetVirtualTimePolicyParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -871,13 +851,13 @@ func (p *SetVirtualTimePolicyParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandEmulationSetVirtualTimePolicy, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandEmulationSetVirtualTimePolicy, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -889,8 +869,8 @@ func (p *SetVirtualTimePolicyParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,34 +3,14 @@ package emulation
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventVirtualTimeBudgetExpired notification sent after the virual time
|
// EventVirtualTimeBudgetExpired notification sent after the virual time
|
||||||
// budget for the current VirtualTimePolicy has run out.
|
// budget for the current VirtualTimePolicy has run out.
|
||||||
type EventVirtualTimeBudgetExpired struct{}
|
type EventVirtualTimeBudgetExpired struct{}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventEmulationVirtualTimeBudgetExpired,
|
cdp.EventEmulationVirtualTimeBudgetExpired,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
package emulation
|
package emulation
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ScreenOrientation screen orientation.
|
// ScreenOrientation screen orientation.
|
||||||
type ScreenOrientation struct {
|
type ScreenOrientation struct {
|
||||||
|
|
|
@ -3,35 +3,18 @@ package heapprofiler
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventAddHeapSnapshotChunk [no description].
|
||||||
type EventAddHeapSnapshotChunk struct {
|
type EventAddHeapSnapshotChunk struct {
|
||||||
Chunk string `json:"chunk,omitempty"`
|
Chunk string `json:"chunk,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventResetProfiles [no description].
|
||||||
type EventResetProfiles struct{}
|
type EventResetProfiles struct{}
|
||||||
|
|
||||||
|
// EventReportHeapSnapshotProgress [no description].
|
||||||
type EventReportHeapSnapshotProgress struct {
|
type EventReportHeapSnapshotProgress struct {
|
||||||
Done int64 `json:"done,omitempty"`
|
Done int64 `json:"done,omitempty"`
|
||||||
Total int64 `json:"total,omitempty"`
|
Total int64 `json:"total,omitempty"`
|
||||||
|
@ -44,8 +27,8 @@ type EventReportHeapSnapshotProgress struct {
|
||||||
// then one or more heapStatsUpdate events will be sent before a new
|
// then one or more heapStatsUpdate events will be sent before a new
|
||||||
// lastSeenObjectId event.
|
// lastSeenObjectId event.
|
||||||
type EventLastSeenObjectID struct {
|
type EventLastSeenObjectID struct {
|
||||||
LastSeenObjectID int64 `json:"lastSeenObjectId,omitempty"`
|
LastSeenObjectID int64 `json:"lastSeenObjectId,omitempty"`
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"`
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventHeapStatsUpdate if heap objects tracking has been started then
|
// EventHeapStatsUpdate if heap objects tracking has been started then
|
||||||
|
@ -54,11 +37,11 @@ type EventHeapStatsUpdate struct {
|
||||||
StatsUpdate []int64 `json:"statsUpdate,omitempty"` // 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.
|
StatsUpdate []int64 `json:"statsUpdate,omitempty"` // 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.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventHeapProfilerAddHeapSnapshotChunk,
|
cdp.EventHeapProfilerAddHeapSnapshotChunk,
|
||||||
EventHeapProfilerResetProfiles,
|
cdp.EventHeapProfilerResetProfiles,
|
||||||
EventHeapProfilerReportHeapSnapshotProgress,
|
cdp.EventHeapProfilerReportHeapSnapshotProgress,
|
||||||
EventHeapProfilerLastSeenObjectID,
|
cdp.EventHeapProfilerLastSeenObjectID,
|
||||||
EventHeapProfilerHeapStatsUpdate,
|
cdp.EventHeapProfilerHeapStatsUpdate,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,51 +9,33 @@ package heapprofiler
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// EnableParams [no description].
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
// Enable [no description].
|
||||||
func Enable() *EnableParams {
|
func Enable() *EnableParams {
|
||||||
return &EnableParams{}
|
return &EnableParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.enable.
|
// Do executes HeapProfiler.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -65,32 +47,34 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DisableParams [no description].
|
||||||
type DisableParams struct{}
|
type DisableParams struct{}
|
||||||
|
|
||||||
|
// Disable [no description].
|
||||||
func Disable() *DisableParams {
|
func Disable() *DisableParams {
|
||||||
return &DisableParams{}
|
return &DisableParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.disable.
|
// Do executes HeapProfiler.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -102,28 +86,32 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartTrackingHeapObjectsParams [no description].
|
||||||
type StartTrackingHeapObjectsParams struct {
|
type StartTrackingHeapObjectsParams struct {
|
||||||
TrackAllocations bool `json:"trackAllocations,omitempty"`
|
TrackAllocations bool `json:"trackAllocations,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartTrackingHeapObjects [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
func StartTrackingHeapObjects() *StartTrackingHeapObjectsParams {
|
func StartTrackingHeapObjects() *StartTrackingHeapObjectsParams {
|
||||||
return &StartTrackingHeapObjectsParams{}
|
return &StartTrackingHeapObjectsParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithTrackAllocations [no description].
|
||||||
func (p StartTrackingHeapObjectsParams) WithTrackAllocations(trackAllocations bool) *StartTrackingHeapObjectsParams {
|
func (p StartTrackingHeapObjectsParams) WithTrackAllocations(trackAllocations bool) *StartTrackingHeapObjectsParams {
|
||||||
p.TrackAllocations = trackAllocations
|
p.TrackAllocations = trackAllocations
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.startTrackingHeapObjects.
|
// Do executes HeapProfiler.startTrackingHeapObjects.
|
||||||
func (p *StartTrackingHeapObjectsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StartTrackingHeapObjectsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -135,13 +123,13 @@ func (p *StartTrackingHeapObjectsParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerStartTrackingHeapObjects, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerStartTrackingHeapObjects, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -153,16 +141,19 @@ func (p *StartTrackingHeapObjectsParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StopTrackingHeapObjectsParams [no description].
|
||||||
type StopTrackingHeapObjectsParams struct {
|
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.
|
ReportProgress bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StopTrackingHeapObjects [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
func StopTrackingHeapObjects() *StopTrackingHeapObjectsParams {
|
func StopTrackingHeapObjects() *StopTrackingHeapObjectsParams {
|
||||||
return &StopTrackingHeapObjectsParams{}
|
return &StopTrackingHeapObjectsParams{}
|
||||||
|
@ -176,7 +167,7 @@ func (p StopTrackingHeapObjectsParams) WithReportProgress(reportProgress bool) *
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.stopTrackingHeapObjects.
|
// Do executes HeapProfiler.stopTrackingHeapObjects.
|
||||||
func (p *StopTrackingHeapObjectsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StopTrackingHeapObjectsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -188,13 +179,13 @@ func (p *StopTrackingHeapObjectsParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerStopTrackingHeapObjects, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerStopTrackingHeapObjects, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -206,16 +197,19 @@ func (p *StopTrackingHeapObjectsParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TakeHeapSnapshotParams [no description].
|
||||||
type TakeHeapSnapshotParams struct {
|
type TakeHeapSnapshotParams struct {
|
||||||
ReportProgress bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
|
ReportProgress bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TakeHeapSnapshot [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
func TakeHeapSnapshot() *TakeHeapSnapshotParams {
|
func TakeHeapSnapshot() *TakeHeapSnapshotParams {
|
||||||
return &TakeHeapSnapshotParams{}
|
return &TakeHeapSnapshotParams{}
|
||||||
|
@ -229,7 +223,7 @@ func (p TakeHeapSnapshotParams) WithReportProgress(reportProgress bool) *TakeHea
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.takeHeapSnapshot.
|
// Do executes HeapProfiler.takeHeapSnapshot.
|
||||||
func (p *TakeHeapSnapshotParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *TakeHeapSnapshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -241,13 +235,13 @@ func (p *TakeHeapSnapshotParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerTakeHeapSnapshot, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerTakeHeapSnapshot, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -259,32 +253,34 @@ func (p *TakeHeapSnapshotParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CollectGarbageParams [no description].
|
||||||
type CollectGarbageParams struct{}
|
type CollectGarbageParams struct{}
|
||||||
|
|
||||||
|
// CollectGarbage [no description].
|
||||||
func CollectGarbage() *CollectGarbageParams {
|
func CollectGarbage() *CollectGarbageParams {
|
||||||
return &CollectGarbageParams{}
|
return &CollectGarbageParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.collectGarbage.
|
// Do executes HeapProfiler.collectGarbage.
|
||||||
func (p *CollectGarbageParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *CollectGarbageParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerCollectGarbage, Empty)
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerCollectGarbage, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -296,22 +292,25 @@ func (p *CollectGarbageParams) Do(ctxt context.Context, h FrameHandler) (err err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetObjectByHeapObjectIDParams [no description].
|
||||||
type GetObjectByHeapObjectIDParams struct {
|
type GetObjectByHeapObjectIDParams struct {
|
||||||
ObjectID HeapSnapshotObjectID `json:"objectId"`
|
ObjectID HeapSnapshotObjectID `json:"objectId"`
|
||||||
ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects.
|
ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetObjectByHeapObjectID [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// objectId
|
// objectID
|
||||||
func GetObjectByHeapObjectID(objectId HeapSnapshotObjectID) *GetObjectByHeapObjectIDParams {
|
func GetObjectByHeapObjectID(objectID HeapSnapshotObjectID) *GetObjectByHeapObjectIDParams {
|
||||||
return &GetObjectByHeapObjectIDParams{
|
return &GetObjectByHeapObjectIDParams{
|
||||||
ObjectID: objectId,
|
ObjectID: objectID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +330,7 @@ type GetObjectByHeapObjectIDReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// result - Evaluation result.
|
// result - Evaluation result.
|
||||||
func (p *GetObjectByHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler) (result *runtime.RemoteObject, err error) {
|
func (p *GetObjectByHeapObjectIDParams) Do(ctxt context.Context, h cdp.FrameHandler) (result *runtime.RemoteObject, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -343,13 +342,13 @@ func (p *GetObjectByHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerGetObjectByHeapObjectID, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerGetObjectByHeapObjectID, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -358,7 +357,7 @@ func (p *GetObjectByHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
var r GetObjectByHeapObjectIDReturns
|
var r GetObjectByHeapObjectIDReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, nil
|
return r.Result, nil
|
||||||
|
@ -368,10 +367,10 @@ func (p *GetObjectByHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddInspectedHeapObjectParams enables console to refer to the node with
|
// AddInspectedHeapObjectParams enables console to refer to the node with
|
||||||
|
@ -384,15 +383,15 @@ type AddInspectedHeapObjectParams struct {
|
||||||
// via $x (see Command Line API for more details $x functions).
|
// via $x (see Command Line API for more details $x functions).
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// heapObjectId - Heap snapshot object id to be accessible by means of $x command line API.
|
// heapObjectID - Heap snapshot object id to be accessible by means of $x command line API.
|
||||||
func AddInspectedHeapObject(heapObjectId HeapSnapshotObjectID) *AddInspectedHeapObjectParams {
|
func AddInspectedHeapObject(heapObjectID HeapSnapshotObjectID) *AddInspectedHeapObjectParams {
|
||||||
return &AddInspectedHeapObjectParams{
|
return &AddInspectedHeapObjectParams{
|
||||||
HeapObjectID: heapObjectId,
|
HeapObjectID: heapObjectID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.addInspectedHeapObject.
|
// Do executes HeapProfiler.addInspectedHeapObject.
|
||||||
func (p *AddInspectedHeapObjectParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *AddInspectedHeapObjectParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -404,13 +403,13 @@ func (p *AddInspectedHeapObjectParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerAddInspectedHeapObject, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerAddInspectedHeapObject, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -422,21 +421,24 @@ func (p *AddInspectedHeapObjectParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetHeapObjectIDParams [no description].
|
||||||
type GetHeapObjectIDParams struct {
|
type GetHeapObjectIDParams struct {
|
||||||
ObjectID runtime.RemoteObjectID `json:"objectId"` // Identifier of the object to get heap object id for.
|
ObjectID runtime.RemoteObjectID `json:"objectId"` // Identifier of the object to get heap object id for.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetHeapObjectID [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// objectId - Identifier of the object to get heap object id for.
|
// objectID - Identifier of the object to get heap object id for.
|
||||||
func GetHeapObjectID(objectId runtime.RemoteObjectID) *GetHeapObjectIDParams {
|
func GetHeapObjectID(objectID runtime.RemoteObjectID) *GetHeapObjectIDParams {
|
||||||
return &GetHeapObjectIDParams{
|
return &GetHeapObjectIDParams{
|
||||||
ObjectID: objectId,
|
ObjectID: objectID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,8 +450,8 @@ type GetHeapObjectIDReturns struct {
|
||||||
// Do executes HeapProfiler.getHeapObjectId.
|
// Do executes HeapProfiler.getHeapObjectId.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// heapSnapshotObjectId - Id of the heap snapshot object corresponding to the passed remote object id.
|
// heapSnapshotObjectID - Id of the heap snapshot object corresponding to the passed remote object id.
|
||||||
func (p *GetHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler) (heapSnapshotObjectId HeapSnapshotObjectID, err error) {
|
func (p *GetHeapObjectIDParams) Do(ctxt context.Context, h cdp.FrameHandler) (heapSnapshotObjectID HeapSnapshotObjectID, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -461,13 +463,13 @@ func (p *GetHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler) (heapSn
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerGetHeapObjectID, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerGetHeapObjectID, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", ErrChannelClosed
|
return "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -476,7 +478,7 @@ func (p *GetHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler) (heapSn
|
||||||
var r GetHeapObjectIDReturns
|
var r GetHeapObjectIDReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", ErrInvalidResult
|
return "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.HeapSnapshotObjectID, nil
|
return r.HeapSnapshotObjectID, nil
|
||||||
|
@ -486,16 +488,19 @@ func (p *GetHeapObjectIDParams) Do(ctxt context.Context, h FrameHandler) (heapSn
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", ErrUnknownResult
|
return "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartSamplingParams [no description].
|
||||||
type StartSamplingParams struct {
|
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.
|
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:
|
// parameters:
|
||||||
func StartSampling() *StartSamplingParams {
|
func StartSampling() *StartSamplingParams {
|
||||||
return &StartSamplingParams{}
|
return &StartSamplingParams{}
|
||||||
|
@ -509,7 +514,7 @@ func (p StartSamplingParams) WithSamplingInterval(samplingInterval float64) *Sta
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes HeapProfiler.startSampling.
|
// Do executes HeapProfiler.startSampling.
|
||||||
func (p *StartSamplingParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StartSamplingParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -521,13 +526,13 @@ func (p *StartSamplingParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerStartSampling, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerStartSampling, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -539,14 +544,16 @@ func (p *StartSamplingParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StopSamplingParams [no description].
|
||||||
type StopSamplingParams struct{}
|
type StopSamplingParams struct{}
|
||||||
|
|
||||||
|
// StopSampling [no description].
|
||||||
func StopSampling() *StopSamplingParams {
|
func StopSampling() *StopSamplingParams {
|
||||||
return &StopSamplingParams{}
|
return &StopSamplingParams{}
|
||||||
}
|
}
|
||||||
|
@ -560,19 +567,19 @@ type StopSamplingReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// profile - Recorded sampling heap profile.
|
// profile - Recorded sampling heap profile.
|
||||||
func (p *StopSamplingParams) Do(ctxt context.Context, h FrameHandler) (profile *SamplingHeapProfile, err error) {
|
func (p *StopSamplingParams) Do(ctxt context.Context, h cdp.FrameHandler) (profile *SamplingHeapProfile, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandHeapProfilerStopSampling, Empty)
|
ch := h.Execute(ctxt, cdp.CommandHeapProfilerStopSampling, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -581,7 +588,7 @@ func (p *StopSamplingParams) Do(ctxt context.Context, h FrameHandler) (profile *
|
||||||
var r StopSamplingReturns
|
var r StopSamplingReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Profile, nil
|
return r.Profile, nil
|
||||||
|
@ -591,8 +598,8 @@ func (p *StopSamplingParams) Do(ctxt context.Context, h FrameHandler) (profile *
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,9 @@
|
||||||
package heapprofiler
|
package heapprofiler
|
||||||
|
|
||||||
|
import "github.com/knq/chromedp/cdp/runtime"
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// HeapSnapshotObjectID heap snapshot object id.
|
// HeapSnapshotObjectID heap snapshot object id.
|
||||||
type HeapSnapshotObjectID string
|
type HeapSnapshotObjectID string
|
||||||
|
|
||||||
|
|
|
@ -9,30 +9,10 @@ package indexeddb
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables events from backend.
|
// EnableParams enables events from backend.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
@ -42,19 +22,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes IndexedDB.enable.
|
// Do executes IndexedDB.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIndexedDBEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandIndexedDBEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -66,10 +46,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables events from backend.
|
// DisableParams disables events from backend.
|
||||||
|
@ -81,19 +61,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes IndexedDB.disable.
|
// Do executes IndexedDB.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIndexedDBDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandIndexedDBDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -105,10 +85,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestDatabaseNamesParams requests database names for given security
|
// RequestDatabaseNamesParams requests database names for given security
|
||||||
|
@ -136,7 +116,7 @@ type RequestDatabaseNamesReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// databaseNames - Database names for origin.
|
// databaseNames - Database names for origin.
|
||||||
func (p *RequestDatabaseNamesParams) Do(ctxt context.Context, h FrameHandler) (databaseNames []string, err error) {
|
func (p *RequestDatabaseNamesParams) Do(ctxt context.Context, h cdp.FrameHandler) (databaseNames []string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -148,13 +128,13 @@ func (p *RequestDatabaseNamesParams) Do(ctxt context.Context, h FrameHandler) (d
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIndexedDBRequestDatabaseNames, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandIndexedDBRequestDatabaseNames, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -163,7 +143,7 @@ func (p *RequestDatabaseNamesParams) Do(ctxt context.Context, h FrameHandler) (d
|
||||||
var r RequestDatabaseNamesReturns
|
var r RequestDatabaseNamesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.DatabaseNames, nil
|
return r.DatabaseNames, nil
|
||||||
|
@ -173,10 +153,10 @@ func (p *RequestDatabaseNamesParams) Do(ctxt context.Context, h FrameHandler) (d
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestDatabaseParams requests database with given name in given frame.
|
// RequestDatabaseParams requests database with given name in given frame.
|
||||||
|
@ -206,7 +186,7 @@ type RequestDatabaseReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// databaseWithObjectStores - Database with an array of object stores.
|
// databaseWithObjectStores - Database with an array of object stores.
|
||||||
func (p *RequestDatabaseParams) Do(ctxt context.Context, h FrameHandler) (databaseWithObjectStores *DatabaseWithObjectStores, err error) {
|
func (p *RequestDatabaseParams) Do(ctxt context.Context, h cdp.FrameHandler) (databaseWithObjectStores *DatabaseWithObjectStores, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -218,13 +198,13 @@ func (p *RequestDatabaseParams) Do(ctxt context.Context, h FrameHandler) (databa
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIndexedDBRequestDatabase, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandIndexedDBRequestDatabase, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -233,7 +213,7 @@ func (p *RequestDatabaseParams) Do(ctxt context.Context, h FrameHandler) (databa
|
||||||
var r RequestDatabaseReturns
|
var r RequestDatabaseReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.DatabaseWithObjectStores, nil
|
return r.DatabaseWithObjectStores, nil
|
||||||
|
@ -243,10 +223,10 @@ func (p *RequestDatabaseParams) Do(ctxt context.Context, h FrameHandler) (databa
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestDataParams requests data from object store or index.
|
// RequestDataParams requests data from object store or index.
|
||||||
|
@ -297,7 +277,7 @@ type RequestDataReturns struct {
|
||||||
// returns:
|
// returns:
|
||||||
// objectStoreDataEntries - Array of object store data entries.
|
// objectStoreDataEntries - Array of object store data entries.
|
||||||
// hasMore - If true, there are more entries to fetch in the given range.
|
// hasMore - If true, there are more entries to fetch in the given range.
|
||||||
func (p *RequestDataParams) Do(ctxt context.Context, h FrameHandler) (objectStoreDataEntries []*DataEntry, hasMore bool, err error) {
|
func (p *RequestDataParams) Do(ctxt context.Context, h cdp.FrameHandler) (objectStoreDataEntries []*DataEntry, hasMore bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -309,13 +289,13 @@ func (p *RequestDataParams) Do(ctxt context.Context, h FrameHandler) (objectStor
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIndexedDBRequestData, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandIndexedDBRequestData, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, false, ErrChannelClosed
|
return nil, false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -324,7 +304,7 @@ func (p *RequestDataParams) Do(ctxt context.Context, h FrameHandler) (objectStor
|
||||||
var r RequestDataReturns
|
var r RequestDataReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, false, ErrInvalidResult
|
return nil, false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.ObjectStoreDataEntries, r.HasMore, nil
|
return r.ObjectStoreDataEntries, r.HasMore, nil
|
||||||
|
@ -334,10 +314,10 @@ func (p *RequestDataParams) Do(ctxt context.Context, h FrameHandler) (objectStor
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, false, ErrContextDone
|
return nil, false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, false, ErrUnknownResult
|
return nil, false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearObjectStoreParams clears all entries from an object store.
|
// ClearObjectStoreParams clears all entries from an object store.
|
||||||
|
@ -362,7 +342,7 @@ func ClearObjectStore(securityOrigin string, databaseName string, objectStoreNam
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes IndexedDB.clearObjectStore.
|
// Do executes IndexedDB.clearObjectStore.
|
||||||
func (p *ClearObjectStoreParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearObjectStoreParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -374,13 +354,13 @@ func (p *ClearObjectStoreParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIndexedDBClearObjectStore, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandIndexedDBClearObjectStore, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -392,8 +372,8 @@ func (p *ClearObjectStoreParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,15 @@
|
||||||
package indexeddb
|
package indexeddb
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// DatabaseWithObjectStores database with an array of object stores.
|
// DatabaseWithObjectStores database with an array of object stores.
|
||||||
type DatabaseWithObjectStores struct {
|
type DatabaseWithObjectStores struct {
|
||||||
|
|
|
@ -9,30 +9,10 @@ package input
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// DispatchKeyEventParams dispatches a key event to the page.
|
// DispatchKeyEventParams dispatches a key event to the page.
|
||||||
type DispatchKeyEventParams struct {
|
type DispatchKeyEventParams struct {
|
||||||
Type KeyType `json:"type"` // Type of the key event.
|
Type KeyType `json:"type"` // Type of the key event.
|
||||||
|
@ -54,9 +34,9 @@ type DispatchKeyEventParams struct {
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// type - Type of the key event.
|
// type - Type of the key event.
|
||||||
func DispatchKeyEvent(type_ KeyType) *DispatchKeyEventParams {
|
func DispatchKeyEvent(typeVal KeyType) *DispatchKeyEventParams {
|
||||||
return &DispatchKeyEventParams{
|
return &DispatchKeyEventParams{
|
||||||
Type: type_,
|
Type: typeVal,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +124,7 @@ func (p DispatchKeyEventParams) WithIsSystemKey(isSystemKey bool) *DispatchKeyEv
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Input.dispatchKeyEvent.
|
// Do executes Input.dispatchKeyEvent.
|
||||||
func (p *DispatchKeyEventParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DispatchKeyEventParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -156,13 +136,13 @@ func (p *DispatchKeyEventParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInputDispatchKeyEvent, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandInputDispatchKeyEvent, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -174,10 +154,10 @@ func (p *DispatchKeyEventParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DispatchMouseEventParams dispatches a mouse event to the page.
|
// DispatchMouseEventParams dispatches a mouse event to the page.
|
||||||
|
@ -197,9 +177,9 @@ type DispatchMouseEventParams struct {
|
||||||
// type - Type of the mouse event.
|
// type - Type of the mouse event.
|
||||||
// x - X coordinate of the event relative to the main frame's viewport.
|
// x - X coordinate of the event relative to the main frame's viewport.
|
||||||
// y - Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
|
// y - Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
|
||||||
func DispatchMouseEvent(type_ MouseType, x int64, y int64) *DispatchMouseEventParams {
|
func DispatchMouseEvent(typeVal MouseType, x int64, y int64) *DispatchMouseEventParams {
|
||||||
return &DispatchMouseEventParams{
|
return &DispatchMouseEventParams{
|
||||||
Type: type_,
|
Type: typeVal,
|
||||||
X: x,
|
X: x,
|
||||||
Y: y,
|
Y: y,
|
||||||
}
|
}
|
||||||
|
@ -232,7 +212,7 @@ func (p DispatchMouseEventParams) WithClickCount(clickCount int64) *DispatchMous
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Input.dispatchMouseEvent.
|
// Do executes Input.dispatchMouseEvent.
|
||||||
func (p *DispatchMouseEventParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DispatchMouseEventParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -244,13 +224,13 @@ func (p *DispatchMouseEventParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInputDispatchMouseEvent, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandInputDispatchMouseEvent, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -262,10 +242,10 @@ func (p *DispatchMouseEventParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DispatchTouchEventParams dispatches a touch event to the page.
|
// DispatchTouchEventParams dispatches a touch event to the page.
|
||||||
|
@ -281,9 +261,9 @@ type DispatchTouchEventParams struct {
|
||||||
// parameters:
|
// parameters:
|
||||||
// type - Type of the touch event.
|
// type - Type of the touch event.
|
||||||
// touchPoints - Touch points.
|
// touchPoints - Touch points.
|
||||||
func DispatchTouchEvent(type_ TouchType, touchPoints []*TouchPoint) *DispatchTouchEventParams {
|
func DispatchTouchEvent(typeVal TouchType, touchPoints []*TouchPoint) *DispatchTouchEventParams {
|
||||||
return &DispatchTouchEventParams{
|
return &DispatchTouchEventParams{
|
||||||
Type: type_,
|
Type: typeVal,
|
||||||
TouchPoints: touchPoints,
|
TouchPoints: touchPoints,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,7 +283,7 @@ func (p DispatchTouchEventParams) WithTimestamp(timestamp float64) *DispatchTouc
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Input.dispatchTouchEvent.
|
// Do executes Input.dispatchTouchEvent.
|
||||||
func (p *DispatchTouchEventParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DispatchTouchEventParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -315,13 +295,13 @@ func (p *DispatchTouchEventParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInputDispatchTouchEvent, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandInputDispatchTouchEvent, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -333,10 +313,10 @@ func (p *DispatchTouchEventParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmulateTouchFromMouseEventParams emulates touch event from the mouse event
|
// EmulateTouchFromMouseEventParams emulates touch event from the mouse event
|
||||||
|
@ -362,9 +342,9 @@ type EmulateTouchFromMouseEventParams struct {
|
||||||
// y - Y coordinate of the mouse pointer in DIP.
|
// y - Y coordinate of the mouse pointer in DIP.
|
||||||
// timestamp - Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970.
|
// timestamp - Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970.
|
||||||
// button - Mouse button.
|
// button - Mouse button.
|
||||||
func EmulateTouchFromMouseEvent(type_ MouseType, x int64, y int64, timestamp float64, button ButtonType) *EmulateTouchFromMouseEventParams {
|
func EmulateTouchFromMouseEvent(typeVal MouseType, x int64, y int64, timestamp float64, button ButtonType) *EmulateTouchFromMouseEventParams {
|
||||||
return &EmulateTouchFromMouseEventParams{
|
return &EmulateTouchFromMouseEventParams{
|
||||||
Type: type_,
|
Type: typeVal,
|
||||||
X: x,
|
X: x,
|
||||||
Y: y,
|
Y: y,
|
||||||
Timestamp: timestamp,
|
Timestamp: timestamp,
|
||||||
|
@ -398,7 +378,7 @@ func (p EmulateTouchFromMouseEventParams) WithClickCount(clickCount int64) *Emul
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Input.emulateTouchFromMouseEvent.
|
// Do executes Input.emulateTouchFromMouseEvent.
|
||||||
func (p *EmulateTouchFromMouseEventParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EmulateTouchFromMouseEventParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -410,13 +390,13 @@ func (p *EmulateTouchFromMouseEventParams) Do(ctxt context.Context, h FrameHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInputEmulateTouchFromMouseEvent, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandInputEmulateTouchFromMouseEvent, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -428,10 +408,10 @@ func (p *EmulateTouchFromMouseEventParams) Do(ctxt context.Context, h FrameHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SynthesizePinchGestureParams synthesizes a pinch gesture over a time
|
// SynthesizePinchGestureParams synthesizes a pinch gesture over a time
|
||||||
|
@ -474,7 +454,7 @@ func (p SynthesizePinchGestureParams) WithGestureSourceType(gestureSourceType Ge
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Input.synthesizePinchGesture.
|
// Do executes Input.synthesizePinchGesture.
|
||||||
func (p *SynthesizePinchGestureParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SynthesizePinchGestureParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -486,13 +466,13 @@ func (p *SynthesizePinchGestureParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInputSynthesizePinchGesture, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandInputSynthesizePinchGesture, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -504,10 +484,10 @@ func (p *SynthesizePinchGestureParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SynthesizeScrollGestureParams synthesizes a scroll gesture over a time
|
// SynthesizeScrollGestureParams synthesizes a scroll gesture over a time
|
||||||
|
@ -608,7 +588,7 @@ func (p SynthesizeScrollGestureParams) WithInteractionMarkerName(interactionMark
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Input.synthesizeScrollGesture.
|
// Do executes Input.synthesizeScrollGesture.
|
||||||
func (p *SynthesizeScrollGestureParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SynthesizeScrollGestureParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -620,13 +600,13 @@ func (p *SynthesizeScrollGestureParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInputSynthesizeScrollGesture, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandInputSynthesizeScrollGesture, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -638,10 +618,10 @@ func (p *SynthesizeScrollGestureParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SynthesizeTapGestureParams synthesizes a tap gesture over a time period by
|
// SynthesizeTapGestureParams synthesizes a tap gesture over a time period by
|
||||||
|
@ -689,7 +669,7 @@ func (p SynthesizeTapGestureParams) WithGestureSourceType(gestureSourceType Gest
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Input.synthesizeTapGesture.
|
// Do executes Input.synthesizeTapGesture.
|
||||||
func (p *SynthesizeTapGestureParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SynthesizeTapGestureParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -701,13 +681,13 @@ func (p *SynthesizeTapGestureParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInputSynthesizeTapGesture, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandInputSynthesizeTapGesture, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -719,8 +699,8 @@ func (p *SynthesizeTapGestureParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,17 @@
|
||||||
package input
|
package input
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
// TouchPoint [no description].
|
||||||
type TouchPoint struct {
|
type TouchPoint struct {
|
||||||
State TouchState `json:"state,omitempty"` // State of the touch point.
|
State TouchState `json:"state,omitempty"` // State of the touch point.
|
||||||
X int64 `json:"x,omitempty"` // X coordinate of the event relative to the main frame's viewport.
|
X int64 `json:"x,omitempty"` // X coordinate of the event relative to the main frame's viewport.
|
||||||
|
@ -43,6 +23,7 @@ type TouchPoint struct {
|
||||||
ID float64 `json:"id,omitempty"` // Identifier used to track touch sources between events, must be unique within an event.
|
ID float64 `json:"id,omitempty"` // Identifier used to track touch sources between events, must be unique within an event.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GestureType [no description].
|
||||||
type GestureType string
|
type GestureType string
|
||||||
|
|
||||||
// String returns the GestureType as string value.
|
// String returns the GestureType as string value.
|
||||||
|
|
|
@ -3,27 +3,7 @@ package inspector
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventDetached fired when remote debugging connection is about to be
|
// EventDetached fired when remote debugging connection is about to be
|
||||||
|
@ -35,8 +15,8 @@ type EventDetached struct {
|
||||||
// EventTargetCrashed fired when debugging target has crashed.
|
// EventTargetCrashed fired when debugging target has crashed.
|
||||||
type EventTargetCrashed struct{}
|
type EventTargetCrashed struct{}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventInspectorDetached,
|
cdp.EventInspectorDetached,
|
||||||
EventInspectorTargetCrashed,
|
cdp.EventInspectorTargetCrashed,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,30 +9,10 @@ package inspector
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables inspector domain notifications.
|
// EnableParams enables inspector domain notifications.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
@ -42,19 +22,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Inspector.enable.
|
// Do executes Inspector.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInspectorEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandInspectorEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -66,10 +46,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables inspector domain notifications.
|
// DisableParams disables inspector domain notifications.
|
||||||
|
@ -81,19 +61,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Inspector.disable.
|
// Do executes Inspector.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandInspectorDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandInspectorDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -105,8 +85,8 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
package inspector
|
package inspector
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// DetachReason detach reason.
|
// DetachReason detach reason.
|
||||||
type DetachReason string
|
type DetachReason string
|
||||||
|
|
44
cdp/io/io.go
44
cdp/io/io.go
|
@ -11,30 +11,10 @@ package io
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ReadParams read a chunk of the stream.
|
// ReadParams read a chunk of the stream.
|
||||||
type ReadParams struct {
|
type ReadParams struct {
|
||||||
Handle StreamHandle `json:"handle"` // Handle of the stream to read.
|
Handle StreamHandle `json:"handle"` // Handle of the stream to read.
|
||||||
|
@ -77,7 +57,7 @@ type ReadReturns struct {
|
||||||
// returns:
|
// returns:
|
||||||
// data - Data that were read.
|
// data - Data that were read.
|
||||||
// eof - Set if the end-of-file condition occured while reading.
|
// eof - Set if the end-of-file condition occured while reading.
|
||||||
func (p *ReadParams) Do(ctxt context.Context, h FrameHandler) (data string, eof bool, err error) {
|
func (p *ReadParams) Do(ctxt context.Context, h cdp.FrameHandler) (data string, eof bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -89,13 +69,13 @@ func (p *ReadParams) Do(ctxt context.Context, h FrameHandler) (data string, eof
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIORead, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandIORead, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", false, ErrChannelClosed
|
return "", false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -104,7 +84,7 @@ func (p *ReadParams) Do(ctxt context.Context, h FrameHandler) (data string, eof
|
||||||
var r ReadReturns
|
var r ReadReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", false, ErrInvalidResult
|
return "", false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Data, r.EOF, nil
|
return r.Data, r.EOF, nil
|
||||||
|
@ -114,10 +94,10 @@ func (p *ReadParams) Do(ctxt context.Context, h FrameHandler) (data string, eof
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", false, ErrContextDone
|
return "", false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", false, ErrUnknownResult
|
return "", false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloseParams close the stream, discard any temporary backing storage.
|
// CloseParams close the stream, discard any temporary backing storage.
|
||||||
|
@ -136,7 +116,7 @@ func Close(handle StreamHandle) *CloseParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes IO.close.
|
// Do executes IO.close.
|
||||||
func (p *CloseParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *CloseParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -148,13 +128,13 @@ func (p *CloseParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandIOClose, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandIOClose, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -166,8 +146,8 @@ func (p *CloseParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,30 +2,7 @@ package io
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
// StreamHandle [no description].
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type StreamHandle string
|
type StreamHandle string
|
||||||
|
|
||||||
// String returns the StreamHandle as string value.
|
// String returns the StreamHandle as string value.
|
||||||
|
|
|
@ -3,41 +3,23 @@ package layertree
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/dom"
|
"github.com/knq/chromedp/cdp/dom"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// EventLayerTreeDidChange [no description].
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type EventLayerTreeDidChange struct {
|
type EventLayerTreeDidChange struct {
|
||||||
Layers []*Layer `json:"layers,omitempty"` // Layer tree, absent if not in the comspositing mode.
|
Layers []*Layer `json:"layers,omitempty"` // Layer tree, absent if not in the comspositing mode.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventLayerPainted [no description].
|
||||||
type EventLayerPainted struct {
|
type EventLayerPainted struct {
|
||||||
LayerID LayerID `json:"layerId,omitempty"` // The id of the painted layer.
|
LayerID LayerID `json:"layerId,omitempty"` // The id of the painted layer.
|
||||||
Clip *dom.Rect `json:"clip,omitempty"` // Clip rectangle.
|
Clip *dom.Rect `json:"clip,omitempty"` // Clip rectangle.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventLayerTreeLayerTreeDidChange,
|
cdp.EventLayerTreeLayerTreeDidChange,
|
||||||
EventLayerTreeLayerPainted,
|
cdp.EventLayerTreeLayerPainted,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,31 +9,11 @@ package layertree
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/dom"
|
"github.com/knq/chromedp/cdp/dom"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables compositing tree inspection.
|
// EnableParams enables compositing tree inspection.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
@ -43,19 +23,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes LayerTree.enable.
|
// Do executes LayerTree.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -67,10 +47,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables compositing tree inspection.
|
// DisableParams disables compositing tree inspection.
|
||||||
|
@ -82,19 +62,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes LayerTree.disable.
|
// Do executes LayerTree.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -106,10 +86,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompositingReasonsParams provides the reasons why the given layer was
|
// CompositingReasonsParams provides the reasons why the given layer was
|
||||||
|
@ -122,10 +102,10 @@ type CompositingReasonsParams struct {
|
||||||
// composited.
|
// composited.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// layerId - The id of the layer for which we want to get the reasons it was composited.
|
// layerID - The id of the layer for which we want to get the reasons it was composited.
|
||||||
func CompositingReasons(layerId LayerID) *CompositingReasonsParams {
|
func CompositingReasons(layerID LayerID) *CompositingReasonsParams {
|
||||||
return &CompositingReasonsParams{
|
return &CompositingReasonsParams{
|
||||||
LayerID: layerId,
|
LayerID: layerID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +118,7 @@ type CompositingReasonsReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// compositingReasons - A list of strings specifying reasons for the given layer to become composited.
|
// compositingReasons - A list of strings specifying reasons for the given layer to become composited.
|
||||||
func (p *CompositingReasonsParams) Do(ctxt context.Context, h FrameHandler) (compositingReasons []string, err error) {
|
func (p *CompositingReasonsParams) Do(ctxt context.Context, h cdp.FrameHandler) (compositingReasons []string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -150,13 +130,13 @@ func (p *CompositingReasonsParams) Do(ctxt context.Context, h FrameHandler) (com
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeCompositingReasons, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeCompositingReasons, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -165,7 +145,7 @@ func (p *CompositingReasonsParams) Do(ctxt context.Context, h FrameHandler) (com
|
||||||
var r CompositingReasonsReturns
|
var r CompositingReasonsReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.CompositingReasons, nil
|
return r.CompositingReasons, nil
|
||||||
|
@ -175,10 +155,10 @@ func (p *CompositingReasonsParams) Do(ctxt context.Context, h FrameHandler) (com
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeSnapshotParams returns the layer snapshot identifier.
|
// MakeSnapshotParams returns the layer snapshot identifier.
|
||||||
|
@ -189,10 +169,10 @@ type MakeSnapshotParams struct {
|
||||||
// MakeSnapshot returns the layer snapshot identifier.
|
// MakeSnapshot returns the layer snapshot identifier.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// layerId - The id of the layer.
|
// layerID - The id of the layer.
|
||||||
func MakeSnapshot(layerId LayerID) *MakeSnapshotParams {
|
func MakeSnapshot(layerID LayerID) *MakeSnapshotParams {
|
||||||
return &MakeSnapshotParams{
|
return &MakeSnapshotParams{
|
||||||
LayerID: layerId,
|
LayerID: layerID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,8 +184,8 @@ type MakeSnapshotReturns struct {
|
||||||
// Do executes LayerTree.makeSnapshot.
|
// Do executes LayerTree.makeSnapshot.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// snapshotId - The id of the layer snapshot.
|
// snapshotID - The id of the layer snapshot.
|
||||||
func (p *MakeSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotId SnapshotID, err error) {
|
func (p *MakeSnapshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (snapshotID SnapshotID, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -217,13 +197,13 @@ func (p *MakeSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotI
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeMakeSnapshot, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeMakeSnapshot, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", ErrChannelClosed
|
return "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -232,7 +212,7 @@ func (p *MakeSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotI
|
||||||
var r MakeSnapshotReturns
|
var r MakeSnapshotReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", ErrInvalidResult
|
return "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.SnapshotID, nil
|
return r.SnapshotID, nil
|
||||||
|
@ -242,10 +222,10 @@ func (p *MakeSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotI
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", ErrUnknownResult
|
return "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadSnapshotParams returns the snapshot identifier.
|
// LoadSnapshotParams returns the snapshot identifier.
|
||||||
|
@ -271,8 +251,8 @@ type LoadSnapshotReturns struct {
|
||||||
// Do executes LayerTree.loadSnapshot.
|
// Do executes LayerTree.loadSnapshot.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// snapshotId - The id of the snapshot.
|
// snapshotID - The id of the snapshot.
|
||||||
func (p *LoadSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotId SnapshotID, err error) {
|
func (p *LoadSnapshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (snapshotID SnapshotID, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -284,13 +264,13 @@ func (p *LoadSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotI
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeLoadSnapshot, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeLoadSnapshot, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", ErrChannelClosed
|
return "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -299,7 +279,7 @@ func (p *LoadSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotI
|
||||||
var r LoadSnapshotReturns
|
var r LoadSnapshotReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", ErrInvalidResult
|
return "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.SnapshotID, nil
|
return r.SnapshotID, nil
|
||||||
|
@ -309,10 +289,10 @@ func (p *LoadSnapshotParams) Do(ctxt context.Context, h FrameHandler) (snapshotI
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", ErrUnknownResult
|
return "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReleaseSnapshotParams releases layer snapshot captured by the back-end.
|
// ReleaseSnapshotParams releases layer snapshot captured by the back-end.
|
||||||
|
@ -323,15 +303,15 @@ type ReleaseSnapshotParams struct {
|
||||||
// ReleaseSnapshot releases layer snapshot captured by the back-end.
|
// ReleaseSnapshot releases layer snapshot captured by the back-end.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// snapshotId - The id of the layer snapshot.
|
// snapshotID - The id of the layer snapshot.
|
||||||
func ReleaseSnapshot(snapshotId SnapshotID) *ReleaseSnapshotParams {
|
func ReleaseSnapshot(snapshotID SnapshotID) *ReleaseSnapshotParams {
|
||||||
return &ReleaseSnapshotParams{
|
return &ReleaseSnapshotParams{
|
||||||
SnapshotID: snapshotId,
|
SnapshotID: snapshotID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes LayerTree.releaseSnapshot.
|
// Do executes LayerTree.releaseSnapshot.
|
||||||
func (p *ReleaseSnapshotParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ReleaseSnapshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -343,13 +323,13 @@ func (p *ReleaseSnapshotParams) Do(ctxt context.Context, h FrameHandler) (err er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeReleaseSnapshot, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeReleaseSnapshot, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -361,12 +341,13 @@ func (p *ReleaseSnapshotParams) Do(ctxt context.Context, h FrameHandler) (err er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProfileSnapshotParams [no description].
|
||||||
type ProfileSnapshotParams struct {
|
type ProfileSnapshotParams struct {
|
||||||
SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot.
|
SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot.
|
||||||
MinRepeatCount int64 `json:"minRepeatCount,omitempty"` // The maximum number of times to replay the snapshot (1, if not specified).
|
MinRepeatCount int64 `json:"minRepeatCount,omitempty"` // The maximum number of times to replay the snapshot (1, if not specified).
|
||||||
|
@ -374,11 +355,13 @@ type ProfileSnapshotParams struct {
|
||||||
ClipRect *dom.Rect `json:"clipRect,omitempty"` // The clip rectangle to apply when replaying the snapshot.
|
ClipRect *dom.Rect `json:"clipRect,omitempty"` // The clip rectangle to apply when replaying the snapshot.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProfileSnapshot [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// snapshotId - The id of the layer snapshot.
|
// snapshotID - The id of the layer snapshot.
|
||||||
func ProfileSnapshot(snapshotId SnapshotID) *ProfileSnapshotParams {
|
func ProfileSnapshot(snapshotID SnapshotID) *ProfileSnapshotParams {
|
||||||
return &ProfileSnapshotParams{
|
return &ProfileSnapshotParams{
|
||||||
SnapshotID: snapshotId,
|
SnapshotID: snapshotID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +393,7 @@ type ProfileSnapshotReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// timings - The array of paint profiles, one per run.
|
// timings - The array of paint profiles, one per run.
|
||||||
func (p *ProfileSnapshotParams) Do(ctxt context.Context, h FrameHandler) (timings []PaintProfile, err error) {
|
func (p *ProfileSnapshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (timings []PaintProfile, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -422,13 +405,13 @@ func (p *ProfileSnapshotParams) Do(ctxt context.Context, h FrameHandler) (timing
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeProfileSnapshot, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeProfileSnapshot, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -437,7 +420,7 @@ func (p *ProfileSnapshotParams) Do(ctxt context.Context, h FrameHandler) (timing
|
||||||
var r ProfileSnapshotReturns
|
var r ProfileSnapshotReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Timings, nil
|
return r.Timings, nil
|
||||||
|
@ -447,10 +430,10 @@ func (p *ProfileSnapshotParams) Do(ctxt context.Context, h FrameHandler) (timing
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReplaySnapshotParams replays the layer snapshot and returns the resulting
|
// ReplaySnapshotParams replays the layer snapshot and returns the resulting
|
||||||
|
@ -466,10 +449,10 @@ type ReplaySnapshotParams struct {
|
||||||
// bitmap.
|
// bitmap.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// snapshotId - The id of the layer snapshot.
|
// snapshotID - The id of the layer snapshot.
|
||||||
func ReplaySnapshot(snapshotId SnapshotID) *ReplaySnapshotParams {
|
func ReplaySnapshot(snapshotID SnapshotID) *ReplaySnapshotParams {
|
||||||
return &ReplaySnapshotParams{
|
return &ReplaySnapshotParams{
|
||||||
SnapshotID: snapshotId,
|
SnapshotID: snapshotID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,7 +485,7 @@ type ReplaySnapshotReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// dataURL - A data: URL for resulting image.
|
// dataURL - A data: URL for resulting image.
|
||||||
func (p *ReplaySnapshotParams) Do(ctxt context.Context, h FrameHandler) (dataURL string, err error) {
|
func (p *ReplaySnapshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (dataURL string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -514,13 +497,13 @@ func (p *ReplaySnapshotParams) Do(ctxt context.Context, h FrameHandler) (dataURL
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeReplaySnapshot, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeReplaySnapshot, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", ErrChannelClosed
|
return "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -529,7 +512,7 @@ func (p *ReplaySnapshotParams) Do(ctxt context.Context, h FrameHandler) (dataURL
|
||||||
var r ReplaySnapshotReturns
|
var r ReplaySnapshotReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", ErrInvalidResult
|
return "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.DataURL, nil
|
return r.DataURL, nil
|
||||||
|
@ -539,10 +522,10 @@ func (p *ReplaySnapshotParams) Do(ctxt context.Context, h FrameHandler) (dataURL
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", ErrUnknownResult
|
return "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SnapshotCommandLogParams replays the layer snapshot and returns canvas
|
// SnapshotCommandLogParams replays the layer snapshot and returns canvas
|
||||||
|
@ -554,10 +537,10 @@ type SnapshotCommandLogParams struct {
|
||||||
// SnapshotCommandLog replays the layer snapshot and returns canvas log.
|
// SnapshotCommandLog replays the layer snapshot and returns canvas log.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// snapshotId - The id of the layer snapshot.
|
// snapshotID - The id of the layer snapshot.
|
||||||
func SnapshotCommandLog(snapshotId SnapshotID) *SnapshotCommandLogParams {
|
func SnapshotCommandLog(snapshotID SnapshotID) *SnapshotCommandLogParams {
|
||||||
return &SnapshotCommandLogParams{
|
return &SnapshotCommandLogParams{
|
||||||
SnapshotID: snapshotId,
|
SnapshotID: snapshotID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,7 +553,7 @@ type SnapshotCommandLogReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// commandLog - The array of canvas function calls.
|
// commandLog - The array of canvas function calls.
|
||||||
func (p *SnapshotCommandLogParams) Do(ctxt context.Context, h FrameHandler) (commandLog []easyjson.RawMessage, err error) {
|
func (p *SnapshotCommandLogParams) Do(ctxt context.Context, h cdp.FrameHandler) (commandLog []easyjson.RawMessage, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -582,13 +565,13 @@ func (p *SnapshotCommandLogParams) Do(ctxt context.Context, h FrameHandler) (com
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLayerTreeSnapshotCommandLog, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLayerTreeSnapshotCommandLog, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -597,7 +580,7 @@ func (p *SnapshotCommandLogParams) Do(ctxt context.Context, h FrameHandler) (com
|
||||||
var r SnapshotCommandLogReturns
|
var r SnapshotCommandLogReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.CommandLog, nil
|
return r.CommandLog, nil
|
||||||
|
@ -607,8 +590,8 @@ func (p *SnapshotCommandLogParams) Do(ctxt context.Context, h FrameHandler) (com
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,33 +5,13 @@ package layertree
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/dom"
|
"github.com/knq/chromedp/cdp/dom"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// LayerID unique Layer identifier.
|
// LayerID unique Layer identifier.
|
||||||
type LayerID string
|
type LayerID string
|
||||||
|
|
||||||
|
@ -64,21 +44,21 @@ type PictureTile struct {
|
||||||
|
|
||||||
// Layer information about a compositing layer.
|
// Layer information about a compositing layer.
|
||||||
type Layer struct {
|
type Layer struct {
|
||||||
LayerID LayerID `json:"layerId,omitempty"` // The unique id for this layer.
|
LayerID LayerID `json:"layerId,omitempty"` // The unique id for this layer.
|
||||||
ParentLayerID LayerID `json:"parentLayerId,omitempty"` // The id of parent (not present for root).
|
ParentLayerID LayerID `json:"parentLayerId,omitempty"` // The id of parent (not present for root).
|
||||||
BackendNodeID BackendNodeID `json:"backendNodeId,omitempty"` // The backend id for the node associated with this layer.
|
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // The backend id for the node associated with this layer.
|
||||||
OffsetX float64 `json:"offsetX,omitempty"` // Offset from parent layer, X coordinate.
|
OffsetX float64 `json:"offsetX,omitempty"` // Offset from parent layer, X coordinate.
|
||||||
OffsetY float64 `json:"offsetY,omitempty"` // Offset from parent layer, Y coordinate.
|
OffsetY float64 `json:"offsetY,omitempty"` // Offset from parent layer, Y coordinate.
|
||||||
Width float64 `json:"width,omitempty"` // Layer width.
|
Width float64 `json:"width,omitempty"` // Layer width.
|
||||||
Height float64 `json:"height,omitempty"` // Layer height.
|
Height float64 `json:"height,omitempty"` // Layer height.
|
||||||
Transform []float64 `json:"transform,omitempty"` // Transformation matrix for layer, default is identity matrix
|
Transform []float64 `json:"transform,omitempty"` // Transformation matrix for layer, default is identity matrix
|
||||||
AnchorX float64 `json:"anchorX,omitempty"` // Transform anchor point X, absent if no transform specified
|
AnchorX float64 `json:"anchorX,omitempty"` // Transform anchor point X, absent if no transform specified
|
||||||
AnchorY float64 `json:"anchorY,omitempty"` // Transform anchor point Y, absent if no transform specified
|
AnchorY float64 `json:"anchorY,omitempty"` // Transform anchor point Y, absent if no transform specified
|
||||||
AnchorZ float64 `json:"anchorZ,omitempty"` // Transform anchor point Z, absent if no transform specified
|
AnchorZ float64 `json:"anchorZ,omitempty"` // Transform anchor point Z, absent if no transform specified
|
||||||
PaintCount int64 `json:"paintCount,omitempty"` // Indicates how many time this layer has painted.
|
PaintCount int64 `json:"paintCount,omitempty"` // Indicates how many time this layer has painted.
|
||||||
DrawsContent bool `json:"drawsContent,omitempty"` // Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
|
DrawsContent bool `json:"drawsContent,omitempty"` // Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
|
||||||
Invisible bool `json:"invisible,omitempty"` // Set if layer is not visible.
|
Invisible bool `json:"invisible,omitempty"` // Set if layer is not visible.
|
||||||
ScrollRects []*ScrollRect `json:"scrollRects,omitempty"` // Rectangles scrolling on main thread only.
|
ScrollRects []*ScrollRect `json:"scrollRects,omitempty"` // Rectangles scrolling on main thread only.
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaintProfile array of timings, one per paint step.
|
// PaintProfile array of timings, one per paint step.
|
||||||
|
|
|
@ -264,7 +264,88 @@ func (v *StartViolationsReportParams) UnmarshalJSON(data []byte) error {
|
||||||
func (v *StartViolationsReportParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *StartViolationsReportParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog2(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog2(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog3(in *jlexer.Lexer, out *LogEntry) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog3(in *jlexer.Lexer, out *EventEntryAdded) {
|
||||||
|
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 "entry":
|
||||||
|
if in.IsNull() {
|
||||||
|
in.Skip()
|
||||||
|
out.Entry = nil
|
||||||
|
} else {
|
||||||
|
if out.Entry == nil {
|
||||||
|
out.Entry = new(Entry)
|
||||||
|
}
|
||||||
|
(*out.Entry).UnmarshalEasyJSON(in)
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
in.SkipRecursive()
|
||||||
|
}
|
||||||
|
in.WantComma()
|
||||||
|
}
|
||||||
|
in.Delim('}')
|
||||||
|
if isTopLevel {
|
||||||
|
in.Consumed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog3(out *jwriter.Writer, in EventEntryAdded) {
|
||||||
|
out.RawByte('{')
|
||||||
|
first := true
|
||||||
|
_ = first
|
||||||
|
if in.Entry != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"entry\":")
|
||||||
|
if in.Entry == nil {
|
||||||
|
out.RawString("null")
|
||||||
|
} else {
|
||||||
|
(*in.Entry).MarshalEasyJSON(out)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out.RawByte('}')
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON supports json.Marshaler interface
|
||||||
|
func (v EventEntryAdded) MarshalJSON() ([]byte, error) {
|
||||||
|
w := jwriter.Writer{}
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog3(&w, v)
|
||||||
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
|
func (v EventEntryAdded) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog3(w, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
|
func (v *EventEntryAdded) UnmarshalJSON(data []byte) error {
|
||||||
|
r := jlexer.Lexer{Data: data}
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog3(&r, v)
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
|
func (v *EventEntryAdded) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog3(l, v)
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog4(in *jlexer.Lexer, out *Entry) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -319,7 +400,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog3(in *jlexer.Lexer, out *Lo
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog3(out *jwriter.Writer, in LogEntry) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog4(out *jwriter.Writer, in Entry) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -403,107 +484,26 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog3(out *jwriter.Writer, in L
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v LogEntry) MarshalJSON() ([]byte, error) {
|
func (v Entry) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog3(&w, v)
|
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
||||||
func (v LogEntry) MarshalEasyJSON(w *jwriter.Writer) {
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog3(w, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
|
||||||
func (v *LogEntry) UnmarshalJSON(data []byte) error {
|
|
||||||
r := jlexer.Lexer{Data: data}
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog3(&r, v)
|
|
||||||
return r.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
||||||
func (v *LogEntry) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog3(l, v)
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog4(in *jlexer.Lexer, out *EventEntryAdded) {
|
|
||||||
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 "entry":
|
|
||||||
if in.IsNull() {
|
|
||||||
in.Skip()
|
|
||||||
out.Entry = nil
|
|
||||||
} else {
|
|
||||||
if out.Entry == nil {
|
|
||||||
out.Entry = new(LogEntry)
|
|
||||||
}
|
|
||||||
(*out.Entry).UnmarshalEasyJSON(in)
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
in.SkipRecursive()
|
|
||||||
}
|
|
||||||
in.WantComma()
|
|
||||||
}
|
|
||||||
in.Delim('}')
|
|
||||||
if isTopLevel {
|
|
||||||
in.Consumed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog4(out *jwriter.Writer, in EventEntryAdded) {
|
|
||||||
out.RawByte('{')
|
|
||||||
first := true
|
|
||||||
_ = first
|
|
||||||
if in.Entry != nil {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"entry\":")
|
|
||||||
if in.Entry == nil {
|
|
||||||
out.RawString("null")
|
|
||||||
} else {
|
|
||||||
(*in.Entry).MarshalEasyJSON(out)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
out.RawByte('}')
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
|
||||||
func (v EventEntryAdded) MarshalJSON() ([]byte, error) {
|
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog4(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog4(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v EventEntryAdded) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v Entry) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog4(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog4(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *EventEntryAdded) UnmarshalJSON(data []byte) error {
|
func (v *Entry) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog4(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog4(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *EventEntryAdded) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *Entry) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog4(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog4(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog5(in *jlexer.Lexer, out *EnableParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog5(in *jlexer.Lexer, out *EnableParams) {
|
||||||
|
|
|
@ -3,35 +3,15 @@ package log
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventEntryAdded issued when new message was logged.
|
// EventEntryAdded issued when new message was logged.
|
||||||
type EventEntryAdded struct {
|
type EventEntryAdded struct {
|
||||||
Entry *LogEntry `json:"entry,omitempty"` // The entry.
|
Entry *Entry `json:"entry,omitempty"` // The entry.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventLogEntryAdded,
|
cdp.EventLogEntryAdded,
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,30 +11,10 @@ package log
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables log domain, sends the entries collected so far to the
|
// EnableParams enables log domain, sends the entries collected so far to the
|
||||||
// client by means of the entryAdded notification.
|
// client by means of the entryAdded notification.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
@ -46,19 +26,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Log.enable.
|
// Do executes Log.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLogEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandLogEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -70,10 +50,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables log domain, prevents further log entries from being
|
// DisableParams disables log domain, prevents further log entries from being
|
||||||
|
@ -87,19 +67,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Log.disable.
|
// Do executes Log.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLogDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandLogDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -111,10 +91,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearParams clears the log.
|
// ClearParams clears the log.
|
||||||
|
@ -126,19 +106,19 @@ func Clear() *ClearParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Log.clear.
|
// Do executes Log.clear.
|
||||||
func (p *ClearParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLogClear, Empty)
|
ch := h.Execute(ctxt, cdp.CommandLogClear, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -150,10 +130,10 @@ func (p *ClearParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartViolationsReportParams start violation reporting.
|
// StartViolationsReportParams start violation reporting.
|
||||||
|
@ -172,7 +152,7 @@ func StartViolationsReport(config []*ViolationSetting) *StartViolationsReportPar
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Log.startViolationsReport.
|
// Do executes Log.startViolationsReport.
|
||||||
func (p *StartViolationsReportParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StartViolationsReportParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -184,13 +164,13 @@ func (p *StartViolationsReportParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLogStartViolationsReport, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandLogStartViolationsReport, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -202,10 +182,10 @@ func (p *StartViolationsReportParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopViolationsReportParams stop violation reporting.
|
// StopViolationsReportParams stop violation reporting.
|
||||||
|
@ -217,19 +197,19 @@ func StopViolationsReport() *StopViolationsReportParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Log.stopViolationsReport.
|
// Do executes Log.stopViolationsReport.
|
||||||
func (p *StopViolationsReportParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StopViolationsReportParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandLogStopViolationsReport, Empty)
|
ch := h.Execute(ctxt, cdp.CommandLogStopViolationsReport, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -241,8 +221,8 @@ func (p *StopViolationsReportParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ package log
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/network"
|
"github.com/knq/chromedp/cdp/network"
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
|
@ -13,32 +13,12 @@ import (
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// Entry log entry.
|
||||||
_ BackendNode
|
type Entry struct {
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// LogEntry log entry.
|
|
||||||
type LogEntry struct {
|
|
||||||
Source Source `json:"source,omitempty"` // Log entry source.
|
Source Source `json:"source,omitempty"` // Log entry source.
|
||||||
Level Level `json:"level,omitempty"` // Log entry severity.
|
Level Level `json:"level,omitempty"` // Log entry severity.
|
||||||
Text string `json:"text,omitempty"` // Logged text.
|
Text string `json:"text,omitempty"` // Logged text.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp when this entry was added.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp when this entry was added.
|
||||||
URL string `json:"url,omitempty"` // URL of the resource if known.
|
URL string `json:"url,omitempty"` // URL of the resource if known.
|
||||||
LineNumber int64 `json:"lineNumber,omitempty"` // Line number in the resource.
|
LineNumber int64 `json:"lineNumber,omitempty"` // Line number in the resource.
|
||||||
StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace.
|
StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace.
|
||||||
|
|
|
@ -9,32 +9,14 @@ package memory
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// GetDOMCountersParams [no description].
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type GetDOMCountersParams struct{}
|
type GetDOMCountersParams struct{}
|
||||||
|
|
||||||
|
// GetDOMCounters [no description].
|
||||||
func GetDOMCounters() *GetDOMCountersParams {
|
func GetDOMCounters() *GetDOMCountersParams {
|
||||||
return &GetDOMCountersParams{}
|
return &GetDOMCountersParams{}
|
||||||
}
|
}
|
||||||
|
@ -52,19 +34,19 @@ type GetDOMCountersReturns struct {
|
||||||
// documents
|
// documents
|
||||||
// nodes
|
// nodes
|
||||||
// jsEventListeners
|
// jsEventListeners
|
||||||
func (p *GetDOMCountersParams) Do(ctxt context.Context, h FrameHandler) (documents int64, nodes int64, jsEventListeners int64, err error) {
|
func (p *GetDOMCountersParams) Do(ctxt context.Context, h cdp.FrameHandler) (documents int64, nodes int64, jsEventListeners int64, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandMemoryGetDOMCounters, Empty)
|
ch := h.Execute(ctxt, cdp.CommandMemoryGetDOMCounters, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return 0, 0, 0, ErrChannelClosed
|
return 0, 0, 0, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -73,7 +55,7 @@ func (p *GetDOMCountersParams) Do(ctxt context.Context, h FrameHandler) (documen
|
||||||
var r GetDOMCountersReturns
|
var r GetDOMCountersReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, 0, ErrInvalidResult
|
return 0, 0, 0, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Documents, r.Nodes, r.JsEventListeners, nil
|
return r.Documents, r.Nodes, r.JsEventListeners, nil
|
||||||
|
@ -83,10 +65,10 @@ func (p *GetDOMCountersParams) Do(ctxt context.Context, h FrameHandler) (documen
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return 0, 0, 0, ErrContextDone
|
return 0, 0, 0, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0, 0, 0, ErrUnknownResult
|
return 0, 0, 0, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetPressureNotificationsSuppressedParams enable/disable suppressing memory
|
// SetPressureNotificationsSuppressedParams enable/disable suppressing memory
|
||||||
|
@ -107,7 +89,7 @@ func SetPressureNotificationsSuppressed(suppressed bool) *SetPressureNotificatio
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Memory.setPressureNotificationsSuppressed.
|
// Do executes Memory.setPressureNotificationsSuppressed.
|
||||||
func (p *SetPressureNotificationsSuppressedParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetPressureNotificationsSuppressedParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -119,13 +101,13 @@ func (p *SetPressureNotificationsSuppressedParams) Do(ctxt context.Context, h Fr
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandMemorySetPressureNotificationsSuppressed, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandMemorySetPressureNotificationsSuppressed, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -137,10 +119,10 @@ func (p *SetPressureNotificationsSuppressedParams) Do(ctxt context.Context, h Fr
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SimulatePressureNotificationParams simulate a memory pressure notification
|
// SimulatePressureNotificationParams simulate a memory pressure notification
|
||||||
|
@ -161,7 +143,7 @@ func SimulatePressureNotification(level PressureLevel) *SimulatePressureNotifica
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Memory.simulatePressureNotification.
|
// Do executes Memory.simulatePressureNotification.
|
||||||
func (p *SimulatePressureNotificationParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SimulatePressureNotificationParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -173,13 +155,13 @@ func (p *SimulatePressureNotificationParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandMemorySimulatePressureNotification, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandMemorySimulatePressureNotification, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -191,8 +173,8 @@ func (p *SimulatePressureNotificationParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
package memory
|
package memory
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// PressureLevel memory pressure level.
|
// PressureLevel memory pressure level.
|
||||||
type PressureLevel string
|
type PressureLevel string
|
||||||
|
|
|
@ -3,47 +3,27 @@ package network
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/page"
|
"github.com/knq/chromedp/cdp/page"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EventResourceChangedPriority fired when resource loading priority is
|
// EventResourceChangedPriority fired when resource loading priority is
|
||||||
// changed.
|
// changed.
|
||||||
type EventResourceChangedPriority struct {
|
type EventResourceChangedPriority struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
NewPriority ResourcePriority `json:"newPriority,omitempty"` // New priority
|
NewPriority ResourcePriority `json:"newPriority,omitempty"` // New priority
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventRequestWillBeSent fired when page is about to send HTTP request.
|
// EventRequestWillBeSent fired when page is about to send HTTP request.
|
||||||
type EventRequestWillBeSent struct {
|
type EventRequestWillBeSent struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Frame identifier.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier.
|
||||||
LoaderID LoaderID `json:"loaderId,omitempty"` // Loader identifier.
|
LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // Loader identifier.
|
||||||
DocumentURL string `json:"documentURL,omitempty"` // URL of the document this request is loaded for.
|
DocumentURL string `json:"documentURL,omitempty"` // URL of the document this request is loaded for.
|
||||||
Request *Request `json:"request,omitempty"` // Request data.
|
Request *Request `json:"request,omitempty"` // Request data.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
WallTime Timestamp `json:"wallTime,omitempty"` // UTC Timestamp.
|
WallTime cdp.Timestamp `json:"wallTime,omitempty"` // UTC Timestamp.
|
||||||
Initiator *Initiator `json:"initiator,omitempty"` // Request initiator.
|
Initiator *Initiator `json:"initiator,omitempty"` // Request initiator.
|
||||||
RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data.
|
RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data.
|
||||||
Type page.ResourceType `json:"type,omitempty"` // Type of this resource.
|
Type page.ResourceType `json:"type,omitempty"` // Type of this resource.
|
||||||
|
@ -57,32 +37,32 @@ type EventRequestServedFromCache struct {
|
||||||
// EventResponseReceived fired when HTTP response is available.
|
// EventResponseReceived fired when HTTP response is available.
|
||||||
type EventResponseReceived struct {
|
type EventResponseReceived struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Frame identifier.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier.
|
||||||
LoaderID LoaderID `json:"loaderId,omitempty"` // Loader identifier.
|
LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // Loader identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
Type page.ResourceType `json:"type,omitempty"` // Resource type.
|
Type page.ResourceType `json:"type,omitempty"` // Resource type.
|
||||||
Response *Response `json:"response,omitempty"` // Response data.
|
Response *Response `json:"response,omitempty"` // Response data.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventDataReceived fired when data chunk was received over the network.
|
// EventDataReceived fired when data chunk was received over the network.
|
||||||
type EventDataReceived struct {
|
type EventDataReceived struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
DataLength int64 `json:"dataLength,omitempty"` // Data chunk length.
|
DataLength int64 `json:"dataLength,omitempty"` // Data chunk length.
|
||||||
EncodedDataLength int64 `json:"encodedDataLength,omitempty"` // Actual bytes received (might be less than dataLength for compressed encodings).
|
EncodedDataLength int64 `json:"encodedDataLength,omitempty"` // Actual bytes received (might be less than dataLength for compressed encodings).
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventLoadingFinished fired when HTTP request has finished loading.
|
// EventLoadingFinished fired when HTTP request has finished loading.
|
||||||
type EventLoadingFinished struct {
|
type EventLoadingFinished struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
EncodedDataLength float64 `json:"encodedDataLength,omitempty"` // Total number of bytes received for this request.
|
EncodedDataLength float64 `json:"encodedDataLength,omitempty"` // Total number of bytes received for this request.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventLoadingFailed fired when HTTP request has failed to load.
|
// EventLoadingFailed fired when HTTP request has failed to load.
|
||||||
type EventLoadingFailed struct {
|
type EventLoadingFailed struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
Type page.ResourceType `json:"type,omitempty"` // Resource type.
|
Type page.ResourceType `json:"type,omitempty"` // Resource type.
|
||||||
ErrorText string `json:"errorText,omitempty"` // User friendly error message.
|
ErrorText string `json:"errorText,omitempty"` // User friendly error message.
|
||||||
Canceled bool `json:"canceled,omitempty"` // True if loading was canceled.
|
Canceled bool `json:"canceled,omitempty"` // True if loading was canceled.
|
||||||
|
@ -93,8 +73,8 @@ type EventLoadingFailed struct {
|
||||||
// initiate handshake.
|
// initiate handshake.
|
||||||
type EventWebSocketWillSendHandshakeRequest struct {
|
type EventWebSocketWillSendHandshakeRequest struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
WallTime Timestamp `json:"wallTime,omitempty"` // UTC Timestamp.
|
WallTime cdp.Timestamp `json:"wallTime,omitempty"` // UTC Timestamp.
|
||||||
Request *WebSocketRequest `json:"request,omitempty"` // WebSocket request data.
|
Request *WebSocketRequest `json:"request,omitempty"` // WebSocket request data.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +82,7 @@ type EventWebSocketWillSendHandshakeRequest struct {
|
||||||
// response becomes available.
|
// response becomes available.
|
||||||
type EventWebSocketHandshakeResponseReceived struct {
|
type EventWebSocketHandshakeResponseReceived struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
Response *WebSocketResponse `json:"response,omitempty"` // WebSocket response data.
|
Response *WebSocketResponse `json:"response,omitempty"` // WebSocket response data.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,56 +95,56 @@ type EventWebSocketCreated struct {
|
||||||
|
|
||||||
// EventWebSocketClosed fired when WebSocket is closed.
|
// EventWebSocketClosed fired when WebSocket is closed.
|
||||||
type EventWebSocketClosed struct {
|
type EventWebSocketClosed struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventWebSocketFrameReceived fired when WebSocket frame is received.
|
// EventWebSocketFrameReceived fired when WebSocket frame is received.
|
||||||
type EventWebSocketFrameReceived struct {
|
type EventWebSocketFrameReceived struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data.
|
Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventWebSocketFrameError fired when WebSocket frame error occurs.
|
// EventWebSocketFrameError fired when WebSocket frame error occurs.
|
||||||
type EventWebSocketFrameError struct {
|
type EventWebSocketFrameError struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
ErrorMessage string `json:"errorMessage,omitempty"` // WebSocket frame error message.
|
ErrorMessage string `json:"errorMessage,omitempty"` // WebSocket frame error message.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventWebSocketFrameSent fired when WebSocket frame is sent.
|
// EventWebSocketFrameSent fired when WebSocket frame is sent.
|
||||||
type EventWebSocketFrameSent struct {
|
type EventWebSocketFrameSent struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data.
|
Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventEventSourceMessageReceived fired when EventSource message is
|
// EventEventSourceMessageReceived fired when EventSource message is
|
||||||
// received.
|
// received.
|
||||||
type EventEventSourceMessageReceived struct {
|
type EventEventSourceMessageReceived struct {
|
||||||
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
|
||||||
EventName string `json:"eventName,omitempty"` // Message type.
|
EventName string `json:"eventName,omitempty"` // Message type.
|
||||||
EventID string `json:"eventId,omitempty"` // Message identifier.
|
EventID string `json:"eventId,omitempty"` // Message identifier.
|
||||||
Data string `json:"data,omitempty"` // Message content.
|
Data string `json:"data,omitempty"` // Message content.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventNetworkResourceChangedPriority,
|
cdp.EventNetworkResourceChangedPriority,
|
||||||
EventNetworkRequestWillBeSent,
|
cdp.EventNetworkRequestWillBeSent,
|
||||||
EventNetworkRequestServedFromCache,
|
cdp.EventNetworkRequestServedFromCache,
|
||||||
EventNetworkResponseReceived,
|
cdp.EventNetworkResponseReceived,
|
||||||
EventNetworkDataReceived,
|
cdp.EventNetworkDataReceived,
|
||||||
EventNetworkLoadingFinished,
|
cdp.EventNetworkLoadingFinished,
|
||||||
EventNetworkLoadingFailed,
|
cdp.EventNetworkLoadingFailed,
|
||||||
EventNetworkWebSocketWillSendHandshakeRequest,
|
cdp.EventNetworkWebSocketWillSendHandshakeRequest,
|
||||||
EventNetworkWebSocketHandshakeResponseReceived,
|
cdp.EventNetworkWebSocketHandshakeResponseReceived,
|
||||||
EventNetworkWebSocketCreated,
|
cdp.EventNetworkWebSocketCreated,
|
||||||
EventNetworkWebSocketClosed,
|
cdp.EventNetworkWebSocketClosed,
|
||||||
EventNetworkWebSocketFrameReceived,
|
cdp.EventNetworkWebSocketFrameReceived,
|
||||||
EventNetworkWebSocketFrameError,
|
cdp.EventNetworkWebSocketFrameError,
|
||||||
EventNetworkWebSocketFrameSent,
|
cdp.EventNetworkWebSocketFrameSent,
|
||||||
EventNetworkEventSourceMessageReceived,
|
cdp.EventNetworkEventSourceMessageReceived,
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,30 +14,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables network tracking, network events will now be
|
// EnableParams enables network tracking, network events will now be
|
||||||
// delivered to the client.
|
// delivered to the client.
|
||||||
type EnableParams struct {
|
type EnableParams struct {
|
||||||
|
@ -68,7 +48,7 @@ func (p EnableParams) WithMaxResourceBufferSize(maxResourceBufferSize int64) *En
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.enable.
|
// Do executes Network.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -80,13 +60,13 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkEnable, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkEnable, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -98,10 +78,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables network tracking, prevents network events from
|
// DisableParams disables network tracking, prevents network events from
|
||||||
|
@ -115,19 +95,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.disable.
|
// Do executes Network.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandNetworkDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -139,10 +119,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetUserAgentOverrideParams allows overriding user agent with the given
|
// SetUserAgentOverrideParams allows overriding user agent with the given
|
||||||
|
@ -162,7 +142,7 @@ func SetUserAgentOverride(userAgent string) *SetUserAgentOverrideParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.setUserAgentOverride.
|
// Do executes Network.setUserAgentOverride.
|
||||||
func (p *SetUserAgentOverrideParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetUserAgentOverrideParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -174,13 +154,13 @@ func (p *SetUserAgentOverrideParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkSetUserAgentOverride, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkSetUserAgentOverride, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -192,10 +172,10 @@ func (p *SetUserAgentOverrideParams) Do(ctxt context.Context, h FrameHandler) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetExtraHTTPHeadersParams specifies whether to always send extra HTTP
|
// SetExtraHTTPHeadersParams specifies whether to always send extra HTTP
|
||||||
|
@ -216,7 +196,7 @@ func SetExtraHTTPHeaders(headers *Headers) *SetExtraHTTPHeadersParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.setExtraHTTPHeaders.
|
// Do executes Network.setExtraHTTPHeaders.
|
||||||
func (p *SetExtraHTTPHeadersParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetExtraHTTPHeadersParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -228,13 +208,13 @@ func (p *SetExtraHTTPHeadersParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkSetExtraHTTPHeaders, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkSetExtraHTTPHeaders, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -246,10 +226,10 @@ func (p *SetExtraHTTPHeadersParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetResponseBodyParams returns content served for the given request.
|
// GetResponseBodyParams returns content served for the given request.
|
||||||
|
@ -260,10 +240,10 @@ type GetResponseBodyParams struct {
|
||||||
// GetResponseBody returns content served for the given request.
|
// GetResponseBody returns content served for the given request.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// requestId - Identifier of the network request to get content for.
|
// requestID - Identifier of the network request to get content for.
|
||||||
func GetResponseBody(requestId RequestID) *GetResponseBodyParams {
|
func GetResponseBody(requestID RequestID) *GetResponseBodyParams {
|
||||||
return &GetResponseBodyParams{
|
return &GetResponseBodyParams{
|
||||||
RequestID: requestId,
|
RequestID: requestID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +257,7 @@ type GetResponseBodyReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// body - Response body.
|
// body - Response body.
|
||||||
func (p *GetResponseBodyParams) Do(ctxt context.Context, h FrameHandler) (body []byte, err error) {
|
func (p *GetResponseBodyParams) Do(ctxt context.Context, h cdp.FrameHandler) (body []byte, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -289,13 +269,13 @@ func (p *GetResponseBodyParams) Do(ctxt context.Context, h FrameHandler) (body [
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkGetResponseBody, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkGetResponseBody, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -304,7 +284,7 @@ func (p *GetResponseBodyParams) Do(ctxt context.Context, h FrameHandler) (body [
|
||||||
var r GetResponseBodyReturns
|
var r GetResponseBodyReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// decode
|
// decode
|
||||||
|
@ -325,10 +305,10 @@ func (p *GetResponseBodyParams) Do(ctxt context.Context, h FrameHandler) (body [
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddBlockedURLParams blocks specific URL from loading.
|
// AddBlockedURLParams blocks specific URL from loading.
|
||||||
|
@ -347,7 +327,7 @@ func AddBlockedURL(url string) *AddBlockedURLParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.addBlockedURL.
|
// Do executes Network.addBlockedURL.
|
||||||
func (p *AddBlockedURLParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *AddBlockedURLParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -359,13 +339,13 @@ func (p *AddBlockedURLParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkAddBlockedURL, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkAddBlockedURL, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -377,10 +357,10 @@ func (p *AddBlockedURLParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveBlockedURLParams cancels blocking of a specific URL from loading.
|
// RemoveBlockedURLParams cancels blocking of a specific URL from loading.
|
||||||
|
@ -399,7 +379,7 @@ func RemoveBlockedURL(url string) *RemoveBlockedURLParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.removeBlockedURL.
|
// Do executes Network.removeBlockedURL.
|
||||||
func (p *RemoveBlockedURLParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RemoveBlockedURLParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -411,13 +391,13 @@ func (p *RemoveBlockedURLParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkRemoveBlockedURL, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkRemoveBlockedURL, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -429,10 +409,10 @@ func (p *RemoveBlockedURLParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReplayXHRParams this method sends a new XMLHttpRequest which is identical
|
// ReplayXHRParams this method sends a new XMLHttpRequest which is identical
|
||||||
|
@ -449,15 +429,15 @@ type ReplayXHRParams struct {
|
||||||
// password.
|
// password.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// requestId - Identifier of XHR to replay.
|
// requestID - Identifier of XHR to replay.
|
||||||
func ReplayXHR(requestId RequestID) *ReplayXHRParams {
|
func ReplayXHR(requestID RequestID) *ReplayXHRParams {
|
||||||
return &ReplayXHRParams{
|
return &ReplayXHRParams{
|
||||||
RequestID: requestId,
|
RequestID: requestID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.replayXHR.
|
// Do executes Network.replayXHR.
|
||||||
func (p *ReplayXHRParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ReplayXHRParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -469,13 +449,13 @@ func (p *ReplayXHRParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkReplayXHR, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkReplayXHR, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -487,10 +467,10 @@ func (p *ReplayXHRParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetMonitoringXHREnabledParams toggles monitoring of XMLHttpRequest. If
|
// SetMonitoringXHREnabledParams toggles monitoring of XMLHttpRequest. If
|
||||||
|
@ -511,7 +491,7 @@ func SetMonitoringXHREnabled(enabled bool) *SetMonitoringXHREnabledParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.setMonitoringXHREnabled.
|
// Do executes Network.setMonitoringXHREnabled.
|
||||||
func (p *SetMonitoringXHREnabledParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetMonitoringXHREnabledParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -523,13 +503,13 @@ func (p *SetMonitoringXHREnabledParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkSetMonitoringXHREnabled, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkSetMonitoringXHREnabled, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -541,10 +521,10 @@ func (p *SetMonitoringXHREnabledParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanClearBrowserCacheParams tells whether clearing browser cache is
|
// CanClearBrowserCacheParams tells whether clearing browser cache is
|
||||||
|
@ -565,19 +545,19 @@ type CanClearBrowserCacheReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// result - True if browser cache can be cleared.
|
// result - True if browser cache can be cleared.
|
||||||
func (p *CanClearBrowserCacheParams) Do(ctxt context.Context, h FrameHandler) (result bool, err error) {
|
func (p *CanClearBrowserCacheParams) Do(ctxt context.Context, h cdp.FrameHandler) (result bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkCanClearBrowserCache, Empty)
|
ch := h.Execute(ctxt, cdp.CommandNetworkCanClearBrowserCache, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -586,7 +566,7 @@ func (p *CanClearBrowserCacheParams) Do(ctxt context.Context, h FrameHandler) (r
|
||||||
var r CanClearBrowserCacheReturns
|
var r CanClearBrowserCacheReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, nil
|
return r.Result, nil
|
||||||
|
@ -596,10 +576,10 @@ func (p *CanClearBrowserCacheParams) Do(ctxt context.Context, h FrameHandler) (r
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearBrowserCacheParams clears browser cache.
|
// ClearBrowserCacheParams clears browser cache.
|
||||||
|
@ -611,19 +591,19 @@ func ClearBrowserCache() *ClearBrowserCacheParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.clearBrowserCache.
|
// Do executes Network.clearBrowserCache.
|
||||||
func (p *ClearBrowserCacheParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearBrowserCacheParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkClearBrowserCache, Empty)
|
ch := h.Execute(ctxt, cdp.CommandNetworkClearBrowserCache, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -635,10 +615,10 @@ func (p *ClearBrowserCacheParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanClearBrowserCookiesParams tells whether clearing browser cookies is
|
// CanClearBrowserCookiesParams tells whether clearing browser cookies is
|
||||||
|
@ -660,19 +640,19 @@ type CanClearBrowserCookiesReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// result - True if browser cookies can be cleared.
|
// result - True if browser cookies can be cleared.
|
||||||
func (p *CanClearBrowserCookiesParams) Do(ctxt context.Context, h FrameHandler) (result bool, err error) {
|
func (p *CanClearBrowserCookiesParams) Do(ctxt context.Context, h cdp.FrameHandler) (result bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkCanClearBrowserCookies, Empty)
|
ch := h.Execute(ctxt, cdp.CommandNetworkCanClearBrowserCookies, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -681,7 +661,7 @@ func (p *CanClearBrowserCookiesParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
var r CanClearBrowserCookiesReturns
|
var r CanClearBrowserCookiesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, nil
|
return r.Result, nil
|
||||||
|
@ -691,10 +671,10 @@ func (p *CanClearBrowserCookiesParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearBrowserCookiesParams clears browser cookies.
|
// ClearBrowserCookiesParams clears browser cookies.
|
||||||
|
@ -706,19 +686,19 @@ func ClearBrowserCookies() *ClearBrowserCookiesParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.clearBrowserCookies.
|
// Do executes Network.clearBrowserCookies.
|
||||||
func (p *ClearBrowserCookiesParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearBrowserCookiesParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkClearBrowserCookies, Empty)
|
ch := h.Execute(ctxt, cdp.CommandNetworkClearBrowserCookies, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -730,10 +710,10 @@ func (p *ClearBrowserCookiesParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCookiesParams returns all browser cookies for the current URL.
|
// GetCookiesParams returns all browser cookies for the current URL.
|
||||||
|
@ -767,7 +747,7 @@ type GetCookiesReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// cookies - Array of cookie objects.
|
// cookies - Array of cookie objects.
|
||||||
func (p *GetCookiesParams) Do(ctxt context.Context, h FrameHandler) (cookies []*Cookie, err error) {
|
func (p *GetCookiesParams) Do(ctxt context.Context, h cdp.FrameHandler) (cookies []*Cookie, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -779,13 +759,13 @@ func (p *GetCookiesParams) Do(ctxt context.Context, h FrameHandler) (cookies []*
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkGetCookies, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkGetCookies, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -794,7 +774,7 @@ func (p *GetCookiesParams) Do(ctxt context.Context, h FrameHandler) (cookies []*
|
||||||
var r GetCookiesReturns
|
var r GetCookiesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Cookies, nil
|
return r.Cookies, nil
|
||||||
|
@ -804,10 +784,10 @@ func (p *GetCookiesParams) Do(ctxt context.Context, h FrameHandler) (cookies []*
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAllCookiesParams returns all browser cookies. Depending on the backend
|
// GetAllCookiesParams returns all browser cookies. Depending on the backend
|
||||||
|
@ -829,19 +809,19 @@ type GetAllCookiesReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// cookies - Array of cookie objects.
|
// cookies - Array of cookie objects.
|
||||||
func (p *GetAllCookiesParams) Do(ctxt context.Context, h FrameHandler) (cookies []*Cookie, err error) {
|
func (p *GetAllCookiesParams) Do(ctxt context.Context, h cdp.FrameHandler) (cookies []*Cookie, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkGetAllCookies, Empty)
|
ch := h.Execute(ctxt, cdp.CommandNetworkGetAllCookies, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -850,7 +830,7 @@ func (p *GetAllCookiesParams) Do(ctxt context.Context, h FrameHandler) (cookies
|
||||||
var r GetAllCookiesReturns
|
var r GetAllCookiesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Cookies, nil
|
return r.Cookies, nil
|
||||||
|
@ -860,10 +840,10 @@ func (p *GetAllCookiesParams) Do(ctxt context.Context, h FrameHandler) (cookies
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteCookieParams deletes browser cookie with given name, domain and
|
// DeleteCookieParams deletes browser cookie with given name, domain and
|
||||||
|
@ -886,7 +866,7 @@ func DeleteCookie(cookieName string, url string) *DeleteCookieParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.deleteCookie.
|
// Do executes Network.deleteCookie.
|
||||||
func (p *DeleteCookieParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DeleteCookieParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -898,13 +878,13 @@ func (p *DeleteCookieParams) Do(ctxt context.Context, h FrameHandler) (err error
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkDeleteCookie, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkDeleteCookie, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -916,10 +896,10 @@ func (p *DeleteCookieParams) Do(ctxt context.Context, h FrameHandler) (err error
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCookieParams sets a cookie with the given cookie data; may overwrite
|
// SetCookieParams sets a cookie with the given cookie data; may overwrite
|
||||||
|
@ -933,7 +913,7 @@ type SetCookieParams struct {
|
||||||
Secure bool `json:"secure,omitempty"` // Defaults ot false.
|
Secure bool `json:"secure,omitempty"` // Defaults ot false.
|
||||||
HTTPOnly bool `json:"httpOnly,omitempty"` // Defaults to false.
|
HTTPOnly bool `json:"httpOnly,omitempty"` // Defaults to false.
|
||||||
SameSite CookieSameSite `json:"sameSite,omitempty"` // Defaults to browser default behavior.
|
SameSite CookieSameSite `json:"sameSite,omitempty"` // Defaults to browser default behavior.
|
||||||
ExpirationDate Timestamp `json:"expirationDate,omitempty"` // If omitted, the cookie becomes a session cookie.
|
ExpirationDate cdp.Timestamp `json:"expirationDate,omitempty"` // If omitted, the cookie becomes a session cookie.
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCookie sets a cookie with the given cookie data; may overwrite
|
// SetCookie sets a cookie with the given cookie data; may overwrite
|
||||||
|
@ -982,7 +962,7 @@ func (p SetCookieParams) WithSameSite(sameSite CookieSameSite) *SetCookieParams
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithExpirationDate if omitted, the cookie becomes a session cookie.
|
// WithExpirationDate if omitted, the cookie becomes a session cookie.
|
||||||
func (p SetCookieParams) WithExpirationDate(expirationDate Timestamp) *SetCookieParams {
|
func (p SetCookieParams) WithExpirationDate(expirationDate cdp.Timestamp) *SetCookieParams {
|
||||||
p.ExpirationDate = expirationDate
|
p.ExpirationDate = expirationDate
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
@ -996,7 +976,7 @@ type SetCookieReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// success - True if successfully set cookie.
|
// success - True if successfully set cookie.
|
||||||
func (p *SetCookieParams) Do(ctxt context.Context, h FrameHandler) (success bool, err error) {
|
func (p *SetCookieParams) Do(ctxt context.Context, h cdp.FrameHandler) (success bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -1008,13 +988,13 @@ func (p *SetCookieParams) Do(ctxt context.Context, h FrameHandler) (success bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkSetCookie, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkSetCookie, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -1023,7 +1003,7 @@ func (p *SetCookieParams) Do(ctxt context.Context, h FrameHandler) (success bool
|
||||||
var r SetCookieReturns
|
var r SetCookieReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Success, nil
|
return r.Success, nil
|
||||||
|
@ -1033,10 +1013,10 @@ func (p *SetCookieParams) Do(ctxt context.Context, h FrameHandler) (success bool
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanEmulateNetworkConditionsParams tells whether emulation of network
|
// CanEmulateNetworkConditionsParams tells whether emulation of network
|
||||||
|
@ -1058,19 +1038,19 @@ type CanEmulateNetworkConditionsReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// result - True if emulation of network conditions is supported.
|
// result - True if emulation of network conditions is supported.
|
||||||
func (p *CanEmulateNetworkConditionsParams) Do(ctxt context.Context, h FrameHandler) (result bool, err error) {
|
func (p *CanEmulateNetworkConditionsParams) Do(ctxt context.Context, h cdp.FrameHandler) (result bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkCanEmulateNetworkConditions, Empty)
|
ch := h.Execute(ctxt, cdp.CommandNetworkCanEmulateNetworkConditions, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -1079,7 +1059,7 @@ func (p *CanEmulateNetworkConditionsParams) Do(ctxt context.Context, h FrameHand
|
||||||
var r CanEmulateNetworkConditionsReturns
|
var r CanEmulateNetworkConditionsReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, nil
|
return r.Result, nil
|
||||||
|
@ -1089,10 +1069,10 @@ func (p *CanEmulateNetworkConditionsParams) Do(ctxt context.Context, h FrameHand
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmulateNetworkConditionsParams activates emulation of network conditions.
|
// EmulateNetworkConditionsParams activates emulation of network conditions.
|
||||||
|
@ -1127,7 +1107,7 @@ func (p EmulateNetworkConditionsParams) WithConnectionType(connectionType Connec
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.emulateNetworkConditions.
|
// Do executes Network.emulateNetworkConditions.
|
||||||
func (p *EmulateNetworkConditionsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EmulateNetworkConditionsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -1139,13 +1119,13 @@ func (p *EmulateNetworkConditionsParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkEmulateNetworkConditions, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkEmulateNetworkConditions, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -1157,10 +1137,10 @@ func (p *EmulateNetworkConditionsParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCacheDisabledParams toggles ignoring cache for each request. If true,
|
// SetCacheDisabledParams toggles ignoring cache for each request. If true,
|
||||||
|
@ -1181,7 +1161,7 @@ func SetCacheDisabled(cacheDisabled bool) *SetCacheDisabledParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.setCacheDisabled.
|
// Do executes Network.setCacheDisabled.
|
||||||
func (p *SetCacheDisabledParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetCacheDisabledParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -1193,13 +1173,13 @@ func (p *SetCacheDisabledParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkSetCacheDisabled, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkSetCacheDisabled, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -1211,10 +1191,10 @@ func (p *SetCacheDisabledParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetBypassServiceWorkerParams toggles ignoring of service worker for each
|
// SetBypassServiceWorkerParams toggles ignoring of service worker for each
|
||||||
|
@ -1235,7 +1215,7 @@ func SetBypassServiceWorker(bypass bool) *SetBypassServiceWorkerParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.setBypassServiceWorker.
|
// Do executes Network.setBypassServiceWorker.
|
||||||
func (p *SetBypassServiceWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetBypassServiceWorkerParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -1247,13 +1227,13 @@ func (p *SetBypassServiceWorkerParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkSetBypassServiceWorker, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkSetBypassServiceWorker, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -1265,10 +1245,10 @@ func (p *SetBypassServiceWorkerParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDataSizeLimitsForTestParams for testing.
|
// SetDataSizeLimitsForTestParams for testing.
|
||||||
|
@ -1290,7 +1270,7 @@ func SetDataSizeLimitsForTest(maxTotalSize int64, maxResourceSize int64) *SetDat
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Network.setDataSizeLimitsForTest.
|
// Do executes Network.setDataSizeLimitsForTest.
|
||||||
func (p *SetDataSizeLimitsForTestParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetDataSizeLimitsForTestParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -1302,13 +1282,13 @@ func (p *SetDataSizeLimitsForTestParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkSetDataSizeLimitsForTest, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkSetDataSizeLimitsForTest, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -1320,10 +1300,10 @@ func (p *SetDataSizeLimitsForTestParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCertificateParams returns the DER-encoded certificate.
|
// GetCertificateParams returns the DER-encoded certificate.
|
||||||
|
@ -1350,7 +1330,7 @@ type GetCertificateReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// tableNames
|
// tableNames
|
||||||
func (p *GetCertificateParams) Do(ctxt context.Context, h FrameHandler) (tableNames []string, err error) {
|
func (p *GetCertificateParams) Do(ctxt context.Context, h cdp.FrameHandler) (tableNames []string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -1362,13 +1342,13 @@ func (p *GetCertificateParams) Do(ctxt context.Context, h FrameHandler) (tableNa
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandNetworkGetCertificate, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandNetworkGetCertificate, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -1377,7 +1357,7 @@ func (p *GetCertificateParams) Do(ctxt context.Context, h FrameHandler) (tableNa
|
||||||
var r GetCertificateReturns
|
var r GetCertificateReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.TableNames, nil
|
return r.TableNames, nil
|
||||||
|
@ -1387,8 +1367,8 @@ func (p *GetCertificateParams) Do(ctxt context.Context, h FrameHandler) (tableNa
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ package network
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/page"
|
"github.com/knq/chromedp/cdp/page"
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
"github.com/knq/chromedp/cdp/runtime"
|
||||||
"github.com/knq/chromedp/cdp/security"
|
"github.com/knq/chromedp/cdp/security"
|
||||||
|
@ -14,26 +14,6 @@ import (
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// RequestID unique request identifier.
|
// RequestID unique request identifier.
|
||||||
type RequestID string
|
type RequestID string
|
||||||
|
|
||||||
|
@ -236,14 +216,14 @@ type Request struct {
|
||||||
// SignedCertificateTimestamp details of a signed certificate timestamp
|
// SignedCertificateTimestamp details of a signed certificate timestamp
|
||||||
// (SCT).
|
// (SCT).
|
||||||
type SignedCertificateTimestamp struct {
|
type SignedCertificateTimestamp struct {
|
||||||
Status string `json:"status,omitempty"` // Validation status.
|
Status string `json:"status,omitempty"` // Validation status.
|
||||||
Origin string `json:"origin,omitempty"` // Origin.
|
Origin string `json:"origin,omitempty"` // Origin.
|
||||||
LogDescription string `json:"logDescription,omitempty"` // Log name / description.
|
LogDescription string `json:"logDescription,omitempty"` // Log name / description.
|
||||||
LogID string `json:"logId,omitempty"` // Log ID.
|
LogID string `json:"logId,omitempty"` // Log ID.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Issuance date.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Issuance date.
|
||||||
HashAlgorithm string `json:"hashAlgorithm,omitempty"` // Hash algorithm.
|
HashAlgorithm string `json:"hashAlgorithm,omitempty"` // Hash algorithm.
|
||||||
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Signature algorithm.
|
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Signature algorithm.
|
||||||
SignatureData string `json:"signatureData,omitempty"` // Signature data.
|
SignatureData string `json:"signatureData,omitempty"` // Signature data.
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecurityDetails security details about a request.
|
// SecurityDetails security details about a request.
|
||||||
|
@ -257,8 +237,8 @@ type SecurityDetails struct {
|
||||||
SubjectName string `json:"subjectName,omitempty"` // Certificate subject name.
|
SubjectName string `json:"subjectName,omitempty"` // Certificate subject name.
|
||||||
SanList []string `json:"sanList,omitempty"` // Subject Alternative Name (SAN) DNS names and IP addresses.
|
SanList []string `json:"sanList,omitempty"` // Subject Alternative Name (SAN) DNS names and IP addresses.
|
||||||
Issuer string `json:"issuer,omitempty"` // Name of the issuing CA.
|
Issuer string `json:"issuer,omitempty"` // Name of the issuing CA.
|
||||||
ValidFrom Timestamp `json:"validFrom,omitempty"` // Certificate valid from date.
|
ValidFrom cdp.Timestamp `json:"validFrom,omitempty"` // Certificate valid from date.
|
||||||
ValidTo Timestamp `json:"validTo,omitempty"` // Certificate valid to (expiration) date
|
ValidTo cdp.Timestamp `json:"validTo,omitempty"` // Certificate valid to (expiration) date
|
||||||
SignedCertificateTimestampList []*SignedCertificateTimestamp `json:"signedCertificateTimestampList,omitempty"` // List of signed certificate timestamps (SCTs).
|
SignedCertificateTimestampList []*SignedCertificateTimestamp `json:"signedCertificateTimestampList,omitempty"` // List of signed certificate timestamps (SCTs).
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,25 +298,25 @@ func (t *BlockedReason) UnmarshalJSON(buf []byte) error {
|
||||||
|
|
||||||
// Response hTTP response data.
|
// Response hTTP response data.
|
||||||
type Response struct {
|
type Response struct {
|
||||||
URL string `json:"url,omitempty"` // Response URL. This URL can be different from CachedResource.url in case of redirect.
|
URL string `json:"url,omitempty"` // Response URL. This URL can be different from CachedResource.url in case of redirect.
|
||||||
Status float64 `json:"status,omitempty"` // HTTP response status code.
|
Status float64 `json:"status,omitempty"` // HTTP response status code.
|
||||||
StatusText string `json:"statusText,omitempty"` // HTTP response status text.
|
StatusText string `json:"statusText,omitempty"` // HTTP response status text.
|
||||||
Headers *Headers `json:"headers,omitempty"` // HTTP response headers.
|
Headers *Headers `json:"headers,omitempty"` // HTTP response headers.
|
||||||
HeadersText string `json:"headersText,omitempty"` // HTTP response headers text.
|
HeadersText string `json:"headersText,omitempty"` // HTTP response headers text.
|
||||||
MimeType string `json:"mimeType,omitempty"` // Resource mimeType as determined by the browser.
|
MimeType string `json:"mimeType,omitempty"` // Resource mimeType as determined by the browser.
|
||||||
RequestHeaders *Headers `json:"requestHeaders,omitempty"` // Refined HTTP request headers that were actually transmitted over the network.
|
RequestHeaders *Headers `json:"requestHeaders,omitempty"` // Refined HTTP request headers that were actually transmitted over the network.
|
||||||
RequestHeadersText string `json:"requestHeadersText,omitempty"` // HTTP request headers text.
|
RequestHeadersText string `json:"requestHeadersText,omitempty"` // HTTP request headers text.
|
||||||
ConnectionReused bool `json:"connectionReused,omitempty"` // Specifies whether physical connection was actually reused for this request.
|
ConnectionReused bool `json:"connectionReused,omitempty"` // Specifies whether physical connection was actually reused for this request.
|
||||||
ConnectionID float64 `json:"connectionId,omitempty"` // Physical connection id that was actually used for this request.
|
ConnectionID float64 `json:"connectionId,omitempty"` // Physical connection id that was actually used for this request.
|
||||||
RemoteIPAddress string `json:"remoteIPAddress,omitempty"` // Remote IP address.
|
RemoteIPAddress string `json:"remoteIPAddress,omitempty"` // Remote IP address.
|
||||||
RemotePort int64 `json:"remotePort,omitempty"` // Remote port.
|
RemotePort int64 `json:"remotePort,omitempty"` // Remote port.
|
||||||
FromDiskCache bool `json:"fromDiskCache,omitempty"` // Specifies that the request was served from the disk cache.
|
FromDiskCache bool `json:"fromDiskCache,omitempty"` // Specifies that the request was served from the disk cache.
|
||||||
FromServiceWorker bool `json:"fromServiceWorker,omitempty"` // Specifies that the request was served from the ServiceWorker.
|
FromServiceWorker bool `json:"fromServiceWorker,omitempty"` // Specifies that the request was served from the ServiceWorker.
|
||||||
EncodedDataLength float64 `json:"encodedDataLength,omitempty"` // Total number of bytes received for this request so far.
|
EncodedDataLength float64 `json:"encodedDataLength,omitempty"` // Total number of bytes received for this request so far.
|
||||||
Timing *ResourceTiming `json:"timing,omitempty"` // Timing information for the given request.
|
Timing *ResourceTiming `json:"timing,omitempty"` // Timing information for the given request.
|
||||||
Protocol string `json:"protocol,omitempty"` // Protocol used to fetch this request.
|
Protocol string `json:"protocol,omitempty"` // Protocol used to fetch this request.
|
||||||
SecurityState security.SecurityState `json:"securityState,omitempty"` // Security state of the request resource.
|
SecurityState security.State `json:"securityState,omitempty"` // Security state of the request resource.
|
||||||
SecurityDetails *SecurityDetails `json:"securityDetails,omitempty"` // Security details for the request.
|
SecurityDetails *SecurityDetails `json:"securityDetails,omitempty"` // Security details for the request.
|
||||||
}
|
}
|
||||||
|
|
||||||
// WebSocketRequest webSocket request data.
|
// WebSocketRequest webSocket request data.
|
||||||
|
|
|
@ -3,77 +3,60 @@ package page
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventDomContentEventFired [no description].
|
||||||
type EventDomContentEventFired struct {
|
type EventDomContentEventFired struct {
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"`
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventLoadEventFired [no description].
|
||||||
type EventLoadEventFired struct {
|
type EventLoadEventFired struct {
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"`
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventFrameAttached fired when frame has been attached to its parent.
|
// EventFrameAttached fired when frame has been attached to its parent.
|
||||||
type EventFrameAttached struct {
|
type EventFrameAttached struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Id of the frame that has been attached.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Id of the frame that has been attached.
|
||||||
ParentFrameID FrameID `json:"parentFrameId,omitempty"` // Parent frame identifier.
|
ParentFrameID cdp.FrameID `json:"parentFrameId,omitempty"` // Parent frame identifier.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventFrameNavigated fired once navigation of the frame has completed.
|
// EventFrameNavigated fired once navigation of the frame has completed.
|
||||||
// Frame is now associated with the new loader.
|
// Frame is now associated with the new loader.
|
||||||
type EventFrameNavigated struct {
|
type EventFrameNavigated struct {
|
||||||
Frame *Frame `json:"frame,omitempty"` // Frame object.
|
Frame *cdp.Frame `json:"frame,omitempty"` // Frame object.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventFrameDetached fired when frame has been detached from its parent.
|
// EventFrameDetached fired when frame has been detached from its parent.
|
||||||
type EventFrameDetached struct {
|
type EventFrameDetached struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Id of the frame that has been detached.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Id of the frame that has been detached.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventFrameStartedLoading fired when frame has started loading.
|
// EventFrameStartedLoading fired when frame has started loading.
|
||||||
type EventFrameStartedLoading struct {
|
type EventFrameStartedLoading struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Id of the frame that has started loading.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Id of the frame that has started loading.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventFrameStoppedLoading fired when frame has stopped loading.
|
// EventFrameStoppedLoading fired when frame has stopped loading.
|
||||||
type EventFrameStoppedLoading struct {
|
type EventFrameStoppedLoading struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Id of the frame that has stopped loading.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Id of the frame that has stopped loading.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventFrameScheduledNavigation fired when frame schedules a potential
|
// EventFrameScheduledNavigation fired when frame schedules a potential
|
||||||
// navigation.
|
// navigation.
|
||||||
type EventFrameScheduledNavigation struct {
|
type EventFrameScheduledNavigation struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Id of the frame that has scheduled a navigation.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Id of the frame that has scheduled a navigation.
|
||||||
Delay float64 `json:"delay,omitempty"` // Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start.
|
Delay float64 `json:"delay,omitempty"` // Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventFrameClearedScheduledNavigation fired when frame no longer has a
|
// EventFrameClearedScheduledNavigation fired when frame no longer has a
|
||||||
// scheduled navigation.
|
// scheduled navigation.
|
||||||
type EventFrameClearedScheduledNavigation struct {
|
type EventFrameClearedScheduledNavigation struct {
|
||||||
FrameID FrameID `json:"frameId,omitempty"` // Id of the frame that has cleared its scheduled navigation.
|
FrameID cdp.FrameID `json:"frameId,omitempty"` // Id of the frame that has cleared its scheduled navigation.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventFrameResized [no description].
|
||||||
type EventFrameResized struct{}
|
type EventFrameResized struct{}
|
||||||
|
|
||||||
// EventJavascriptDialogOpening fired when a JavaScript initiated dialog
|
// EventJavascriptDialogOpening fired when a JavaScript initiated dialog
|
||||||
|
@ -105,7 +88,7 @@ type EventScreencastVisibilityChanged struct {
|
||||||
|
|
||||||
// EventColorPicked fired when a color has been picked.
|
// EventColorPicked fired when a color has been picked.
|
||||||
type EventColorPicked struct {
|
type EventColorPicked struct {
|
||||||
Color *RGBA `json:"color,omitempty"` // RGBA of the picked color.
|
Color *cdp.RGBA `json:"color,omitempty"` // RGBA of the picked color.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventInterstitialShown fired when interstitial page was shown.
|
// EventInterstitialShown fired when interstitial page was shown.
|
||||||
|
@ -124,24 +107,24 @@ type EventNavigationRequested struct {
|
||||||
URL string `json:"url,omitempty"` // URL of requested navigation.
|
URL string `json:"url,omitempty"` // URL of requested navigation.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventPageDomContentEventFired,
|
cdp.EventPageDomContentEventFired,
|
||||||
EventPageLoadEventFired,
|
cdp.EventPageLoadEventFired,
|
||||||
EventPageFrameAttached,
|
cdp.EventPageFrameAttached,
|
||||||
EventPageFrameNavigated,
|
cdp.EventPageFrameNavigated,
|
||||||
EventPageFrameDetached,
|
cdp.EventPageFrameDetached,
|
||||||
EventPageFrameStartedLoading,
|
cdp.EventPageFrameStartedLoading,
|
||||||
EventPageFrameStoppedLoading,
|
cdp.EventPageFrameStoppedLoading,
|
||||||
EventPageFrameScheduledNavigation,
|
cdp.EventPageFrameScheduledNavigation,
|
||||||
EventPageFrameClearedScheduledNavigation,
|
cdp.EventPageFrameClearedScheduledNavigation,
|
||||||
EventPageFrameResized,
|
cdp.EventPageFrameResized,
|
||||||
EventPageJavascriptDialogOpening,
|
cdp.EventPageJavascriptDialogOpening,
|
||||||
EventPageJavascriptDialogClosed,
|
cdp.EventPageJavascriptDialogClosed,
|
||||||
EventPageScreencastFrame,
|
cdp.EventPageScreencastFrame,
|
||||||
EventPageScreencastVisibilityChanged,
|
cdp.EventPageScreencastVisibilityChanged,
|
||||||
EventPageColorPicked,
|
cdp.EventPageColorPicked,
|
||||||
EventPageInterstitialShown,
|
cdp.EventPageInterstitialShown,
|
||||||
EventPageInterstitialHidden,
|
cdp.EventPageInterstitialHidden,
|
||||||
EventPageNavigationRequested,
|
cdp.EventPageNavigationRequested,
|
||||||
}
|
}
|
||||||
|
|
368
cdp/page/page.go
368
cdp/page/page.go
File diff suppressed because it is too large
Load Diff
|
@ -5,32 +5,12 @@ package page
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ResourceType resource type as it was perceived by the rendering engine.
|
// ResourceType resource type as it was perceived by the rendering engine.
|
||||||
type ResourceType string
|
type ResourceType string
|
||||||
|
|
||||||
|
@ -108,19 +88,19 @@ func (t *ResourceType) UnmarshalJSON(buf []byte) error {
|
||||||
|
|
||||||
// FrameResource information about the Resource on the page.
|
// FrameResource information about the Resource on the page.
|
||||||
type FrameResource struct {
|
type FrameResource struct {
|
||||||
URL string `json:"url,omitempty"` // Resource URL.
|
URL string `json:"url,omitempty"` // Resource URL.
|
||||||
Type ResourceType `json:"type,omitempty"` // Type of this resource.
|
Type ResourceType `json:"type,omitempty"` // Type of this resource.
|
||||||
MimeType string `json:"mimeType,omitempty"` // Resource mimeType as determined by the browser.
|
MimeType string `json:"mimeType,omitempty"` // Resource mimeType as determined by the browser.
|
||||||
LastModified Timestamp `json:"lastModified,omitempty"` // last-modified timestamp as reported by server.
|
LastModified cdp.Timestamp `json:"lastModified,omitempty"` // last-modified timestamp as reported by server.
|
||||||
ContentSize float64 `json:"contentSize,omitempty"` // Resource content size.
|
ContentSize float64 `json:"contentSize,omitempty"` // Resource content size.
|
||||||
Failed bool `json:"failed,omitempty"` // True if the resource failed to load.
|
Failed bool `json:"failed,omitempty"` // True if the resource failed to load.
|
||||||
Canceled bool `json:"canceled,omitempty"` // True if the resource was canceled during loading.
|
Canceled bool `json:"canceled,omitempty"` // True if the resource was canceled during loading.
|
||||||
}
|
}
|
||||||
|
|
||||||
// FrameResourceTree information about the Frame hierarchy along with their
|
// FrameResourceTree information about the Frame hierarchy along with their
|
||||||
// cached resources.
|
// cached resources.
|
||||||
type FrameResourceTree struct {
|
type FrameResourceTree struct {
|
||||||
Frame *Frame `json:"frame,omitempty"` // Frame information for this tree item.
|
Frame *cdp.Frame `json:"frame,omitempty"` // Frame information for this tree item.
|
||||||
ChildFrames []*FrameResourceTree `json:"childFrames,omitempty"` // Child frames.
|
ChildFrames []*FrameResourceTree `json:"childFrames,omitempty"` // Child frames.
|
||||||
Resources []*FrameResource `json:"resources,omitempty"` // Information about frame resources.
|
Resources []*FrameResource `json:"resources,omitempty"` // Information about frame resources.
|
||||||
}
|
}
|
||||||
|
@ -142,13 +122,13 @@ type NavigationEntry struct {
|
||||||
|
|
||||||
// ScreencastFrameMetadata screencast frame metadata.
|
// ScreencastFrameMetadata screencast frame metadata.
|
||||||
type ScreencastFrameMetadata struct {
|
type ScreencastFrameMetadata struct {
|
||||||
OffsetTop float64 `json:"offsetTop,omitempty"` // Top offset in DIP.
|
OffsetTop float64 `json:"offsetTop,omitempty"` // Top offset in DIP.
|
||||||
PageScaleFactor float64 `json:"pageScaleFactor,omitempty"` // Page scale factor.
|
PageScaleFactor float64 `json:"pageScaleFactor,omitempty"` // Page scale factor.
|
||||||
DeviceWidth float64 `json:"deviceWidth,omitempty"` // Device screen width in DIP.
|
DeviceWidth float64 `json:"deviceWidth,omitempty"` // Device screen width in DIP.
|
||||||
DeviceHeight float64 `json:"deviceHeight,omitempty"` // Device screen height in DIP.
|
DeviceHeight float64 `json:"deviceHeight,omitempty"` // Device screen height in DIP.
|
||||||
ScrollOffsetX float64 `json:"scrollOffsetX,omitempty"` // Position of horizontal scroll in CSS pixels.
|
ScrollOffsetX float64 `json:"scrollOffsetX,omitempty"` // Position of horizontal scroll in CSS pixels.
|
||||||
ScrollOffsetY float64 `json:"scrollOffsetY,omitempty"` // Position of vertical scroll in CSS pixels.
|
ScrollOffsetY float64 `json:"scrollOffsetY,omitempty"` // Position of vertical scroll in CSS pixels.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Frame swap timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Frame swap timestamp.
|
||||||
}
|
}
|
||||||
|
|
||||||
// DialogType javascript dialog type.
|
// DialogType javascript dialog type.
|
||||||
|
|
|
@ -3,30 +3,10 @@ package profiler
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/debugger"
|
"github.com/knq/chromedp/cdp/debugger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EventConsoleProfileStarted sent when new profile recodring is started
|
// EventConsoleProfileStarted sent when new profile recodring is started
|
||||||
// using console.profile() call.
|
// using console.profile() call.
|
||||||
type EventConsoleProfileStarted struct {
|
type EventConsoleProfileStarted struct {
|
||||||
|
@ -35,6 +15,7 @@ type EventConsoleProfileStarted struct {
|
||||||
Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile().
|
Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile().
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventConsoleProfileFinished [no description].
|
||||||
type EventConsoleProfileFinished struct {
|
type EventConsoleProfileFinished struct {
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
Location *debugger.Location `json:"location,omitempty"` // Location of console.profileEnd().
|
Location *debugger.Location `json:"location,omitempty"` // Location of console.profileEnd().
|
||||||
|
@ -42,8 +23,8 @@ type EventConsoleProfileFinished struct {
|
||||||
Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile().
|
Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile().
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventProfilerConsoleProfileStarted,
|
cdp.EventProfilerConsoleProfileStarted,
|
||||||
EventProfilerConsoleProfileFinished,
|
cdp.EventProfilerConsoleProfileFinished,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,50 +9,32 @@ package profiler
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// EnableParams [no description].
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
// Enable [no description].
|
||||||
func Enable() *EnableParams {
|
func Enable() *EnableParams {
|
||||||
return &EnableParams{}
|
return &EnableParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Profiler.enable.
|
// Do executes Profiler.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandProfilerEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandProfilerEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -64,32 +46,34 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DisableParams [no description].
|
||||||
type DisableParams struct{}
|
type DisableParams struct{}
|
||||||
|
|
||||||
|
// Disable [no description].
|
||||||
func Disable() *DisableParams {
|
func Disable() *DisableParams {
|
||||||
return &DisableParams{}
|
return &DisableParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Profiler.disable.
|
// Do executes Profiler.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandProfilerDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandProfilerDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -101,10 +85,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetSamplingIntervalParams changes CPU profiler sampling interval. Must be
|
// SetSamplingIntervalParams changes CPU profiler sampling interval. Must be
|
||||||
|
@ -125,7 +109,7 @@ func SetSamplingInterval(interval int64) *SetSamplingIntervalParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Profiler.setSamplingInterval.
|
// Do executes Profiler.setSamplingInterval.
|
||||||
func (p *SetSamplingIntervalParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetSamplingIntervalParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -137,13 +121,13 @@ func (p *SetSamplingIntervalParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandProfilerSetSamplingInterval, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandProfilerSetSamplingInterval, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -155,32 +139,34 @@ func (p *SetSamplingIntervalParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartParams [no description].
|
||||||
type StartParams struct{}
|
type StartParams struct{}
|
||||||
|
|
||||||
|
// Start [no description].
|
||||||
func Start() *StartParams {
|
func Start() *StartParams {
|
||||||
return &StartParams{}
|
return &StartParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Profiler.start.
|
// Do executes Profiler.start.
|
||||||
func (p *StartParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StartParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandProfilerStart, Empty)
|
ch := h.Execute(ctxt, cdp.CommandProfilerStart, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -192,14 +178,16 @@ func (p *StartParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StopParams [no description].
|
||||||
type StopParams struct{}
|
type StopParams struct{}
|
||||||
|
|
||||||
|
// Stop [no description].
|
||||||
func Stop() *StopParams {
|
func Stop() *StopParams {
|
||||||
return &StopParams{}
|
return &StopParams{}
|
||||||
}
|
}
|
||||||
|
@ -213,19 +201,19 @@ type StopReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// profile - Recorded profile.
|
// profile - Recorded profile.
|
||||||
func (p *StopParams) Do(ctxt context.Context, h FrameHandler) (profile *Profile, err error) {
|
func (p *StopParams) Do(ctxt context.Context, h cdp.FrameHandler) (profile *Profile, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandProfilerStop, Empty)
|
ch := h.Execute(ctxt, cdp.CommandProfilerStop, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -234,7 +222,7 @@ func (p *StopParams) Do(ctxt context.Context, h FrameHandler) (profile *Profile,
|
||||||
var r StopReturns
|
var r StopReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Profile, nil
|
return r.Profile, nil
|
||||||
|
@ -244,8 +232,8 @@ func (p *StopParams) Do(ctxt context.Context, h FrameHandler) (profile *Profile,
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,9 @@
|
||||||
package profiler
|
package profiler
|
||||||
|
|
||||||
|
import "github.com/knq/chromedp/cdp/runtime"
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/knq/chromedp/cdp/runtime"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ProfileNode profile node. Holds callsite information, execution statistics
|
// ProfileNode profile node. Holds callsite information, execution statistics
|
||||||
// and child nodes.
|
// and child nodes.
|
||||||
type ProfileNode struct {
|
type ProfileNode struct {
|
||||||
|
|
|
@ -11,30 +11,10 @@ package rendering
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// SetShowPaintRectsParams requests that backend shows paint rectangles.
|
// SetShowPaintRectsParams requests that backend shows paint rectangles.
|
||||||
type SetShowPaintRectsParams struct {
|
type SetShowPaintRectsParams struct {
|
||||||
Result bool `json:"result"` // True for showing paint rectangles
|
Result bool `json:"result"` // True for showing paint rectangles
|
||||||
|
@ -51,7 +31,7 @@ func SetShowPaintRects(result bool) *SetShowPaintRectsParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Rendering.setShowPaintRects.
|
// Do executes Rendering.setShowPaintRects.
|
||||||
func (p *SetShowPaintRectsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetShowPaintRectsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -63,13 +43,13 @@ func (p *SetShowPaintRectsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRenderingSetShowPaintRects, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRenderingSetShowPaintRects, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -81,10 +61,10 @@ func (p *SetShowPaintRectsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetShowDebugBordersParams requests that backend shows debug borders on
|
// SetShowDebugBordersParams requests that backend shows debug borders on
|
||||||
|
@ -104,7 +84,7 @@ func SetShowDebugBorders(show bool) *SetShowDebugBordersParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Rendering.setShowDebugBorders.
|
// Do executes Rendering.setShowDebugBorders.
|
||||||
func (p *SetShowDebugBordersParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetShowDebugBordersParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -116,13 +96,13 @@ func (p *SetShowDebugBordersParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRenderingSetShowDebugBorders, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRenderingSetShowDebugBorders, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -134,10 +114,10 @@ func (p *SetShowDebugBordersParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetShowFPSCounterParams requests that backend shows the FPS counter.
|
// SetShowFPSCounterParams requests that backend shows the FPS counter.
|
||||||
|
@ -156,7 +136,7 @@ func SetShowFPSCounter(show bool) *SetShowFPSCounterParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Rendering.setShowFPSCounter.
|
// Do executes Rendering.setShowFPSCounter.
|
||||||
func (p *SetShowFPSCounterParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetShowFPSCounterParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -168,13 +148,13 @@ func (p *SetShowFPSCounterParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRenderingSetShowFPSCounter, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRenderingSetShowFPSCounter, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -186,10 +166,10 @@ func (p *SetShowFPSCounterParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetShowScrollBottleneckRectsParams requests that backend shows scroll
|
// SetShowScrollBottleneckRectsParams requests that backend shows scroll
|
||||||
|
@ -210,7 +190,7 @@ func SetShowScrollBottleneckRects(show bool) *SetShowScrollBottleneckRectsParams
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Rendering.setShowScrollBottleneckRects.
|
// Do executes Rendering.setShowScrollBottleneckRects.
|
||||||
func (p *SetShowScrollBottleneckRectsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetShowScrollBottleneckRectsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -222,13 +202,13 @@ func (p *SetShowScrollBottleneckRectsParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRenderingSetShowScrollBottleneckRects, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRenderingSetShowScrollBottleneckRects, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -240,10 +220,10 @@ func (p *SetShowScrollBottleneckRectsParams) Do(ctxt context.Context, h FrameHan
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetShowViewportSizeOnResizeParams paints viewport size upon main frame
|
// SetShowViewportSizeOnResizeParams paints viewport size upon main frame
|
||||||
|
@ -263,7 +243,7 @@ func SetShowViewportSizeOnResize(show bool) *SetShowViewportSizeOnResizeParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Rendering.setShowViewportSizeOnResize.
|
// Do executes Rendering.setShowViewportSizeOnResize.
|
||||||
func (p *SetShowViewportSizeOnResizeParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetShowViewportSizeOnResizeParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -275,13 +255,13 @@ func (p *SetShowViewportSizeOnResizeParams) Do(ctxt context.Context, h FrameHand
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRenderingSetShowViewportSizeOnResize, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRenderingSetShowViewportSizeOnResize, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -293,8 +273,8 @@ func (p *SetShowViewportSizeOnResizeParams) Do(ctxt context.Context, h FrameHand
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,30 +3,10 @@ package runtime
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EventExecutionContextCreated issued when new execution context is created.
|
// EventExecutionContextCreated issued when new execution context is created.
|
||||||
type EventExecutionContextCreated struct {
|
type EventExecutionContextCreated struct {
|
||||||
Context *ExecutionContextDescription `json:"context,omitempty"` // A newly created execution contex.
|
Context *ExecutionContextDescription `json:"context,omitempty"` // A newly created execution contex.
|
||||||
|
@ -43,7 +23,7 @@ type EventExecutionContextsCleared struct{}
|
||||||
|
|
||||||
// EventExceptionThrown issued when exception was thrown and unhandled.
|
// EventExceptionThrown issued when exception was thrown and unhandled.
|
||||||
type EventExceptionThrown struct {
|
type EventExceptionThrown struct {
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp of the exception.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp of the exception.
|
||||||
ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"`
|
ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +38,7 @@ type EventConsoleAPICalled struct {
|
||||||
Type APIType `json:"type,omitempty"` // Type of the call.
|
Type APIType `json:"type,omitempty"` // Type of the call.
|
||||||
Args []*RemoteObject `json:"args,omitempty"` // Call arguments.
|
Args []*RemoteObject `json:"args,omitempty"` // Call arguments.
|
||||||
ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where the call was made.
|
ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where the call was made.
|
||||||
Timestamp Timestamp `json:"timestamp,omitempty"` // Call timestamp.
|
Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Call timestamp.
|
||||||
StackTrace *StackTrace `json:"stackTrace,omitempty"` // Stack trace captured when the call was made.
|
StackTrace *StackTrace `json:"stackTrace,omitempty"` // Stack trace captured when the call was made.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,13 +49,13 @@ type EventInspectRequested struct {
|
||||||
Hints easyjson.RawMessage `json:"hints,omitempty"`
|
Hints easyjson.RawMessage `json:"hints,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventRuntimeExecutionContextCreated,
|
cdp.EventRuntimeExecutionContextCreated,
|
||||||
EventRuntimeExecutionContextDestroyed,
|
cdp.EventRuntimeExecutionContextDestroyed,
|
||||||
EventRuntimeExecutionContextsCleared,
|
cdp.EventRuntimeExecutionContextsCleared,
|
||||||
EventRuntimeExceptionThrown,
|
cdp.EventRuntimeExceptionThrown,
|
||||||
EventRuntimeExceptionRevoked,
|
cdp.EventRuntimeExceptionRevoked,
|
||||||
EventRuntimeConsoleAPICalled,
|
cdp.EventRuntimeConsoleAPICalled,
|
||||||
EventRuntimeInspectRequested,
|
cdp.EventRuntimeInspectRequested,
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,30 +16,10 @@ package runtime
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EvaluateParams evaluates expression on global object.
|
// EvaluateParams evaluates expression on global object.
|
||||||
type EvaluateParams struct {
|
type EvaluateParams struct {
|
||||||
Expression string `json:"expression"` // Expression to evaluate.
|
Expression string `json:"expression"` // Expression to evaluate.
|
||||||
|
@ -87,8 +67,8 @@ func (p EvaluateParams) WithSilent(silent bool) *EvaluateParams {
|
||||||
// WithContextID specifies in which execution context to perform evaluation.
|
// WithContextID specifies in which execution context to perform evaluation.
|
||||||
// If the parameter is omitted the evaluation will be performed in the context
|
// If the parameter is omitted the evaluation will be performed in the context
|
||||||
// of the inspected page.
|
// of the inspected page.
|
||||||
func (p EvaluateParams) WithContextID(contextId ExecutionContextID) *EvaluateParams {
|
func (p EvaluateParams) WithContextID(contextID ExecutionContextID) *EvaluateParams {
|
||||||
p.ContextID = contextId
|
p.ContextID = contextID
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +110,7 @@ type EvaluateReturns struct {
|
||||||
// returns:
|
// returns:
|
||||||
// result - Evaluation result.
|
// result - Evaluation result.
|
||||||
// exceptionDetails - Exception details.
|
// exceptionDetails - Exception details.
|
||||||
func (p *EvaluateParams) Do(ctxt context.Context, h FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
func (p *EvaluateParams) Do(ctxt context.Context, h cdp.FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -142,13 +122,13 @@ func (p *EvaluateParams) Do(ctxt context.Context, h FrameHandler) (result *Remot
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeEvaluate, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeEvaluate, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, nil, ErrChannelClosed
|
return nil, nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -157,7 +137,7 @@ func (p *EvaluateParams) Do(ctxt context.Context, h FrameHandler) (result *Remot
|
||||||
var r EvaluateReturns
|
var r EvaluateReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, ErrInvalidResult
|
return nil, nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, r.ExceptionDetails, nil
|
return r.Result, r.ExceptionDetails, nil
|
||||||
|
@ -167,10 +147,10 @@ func (p *EvaluateParams) Do(ctxt context.Context, h FrameHandler) (result *Remot
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, nil, ErrContextDone
|
return nil, nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil, ErrUnknownResult
|
return nil, nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// AwaitPromiseParams add handler to promise with given promise object id.
|
// AwaitPromiseParams add handler to promise with given promise object id.
|
||||||
|
@ -183,10 +163,10 @@ type AwaitPromiseParams struct {
|
||||||
// AwaitPromise add handler to promise with given promise object id.
|
// AwaitPromise add handler to promise with given promise object id.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// promiseObjectId - Identifier of the promise.
|
// promiseObjectID - Identifier of the promise.
|
||||||
func AwaitPromise(promiseObjectId RemoteObjectID) *AwaitPromiseParams {
|
func AwaitPromise(promiseObjectID RemoteObjectID) *AwaitPromiseParams {
|
||||||
return &AwaitPromiseParams{
|
return &AwaitPromiseParams{
|
||||||
PromiseObjectID: promiseObjectId,
|
PromiseObjectID: promiseObjectID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +194,7 @@ type AwaitPromiseReturns struct {
|
||||||
// returns:
|
// returns:
|
||||||
// result - Promise result. Will contain rejected value if promise was rejected.
|
// result - Promise result. Will contain rejected value if promise was rejected.
|
||||||
// exceptionDetails - Exception details if stack strace is available.
|
// exceptionDetails - Exception details if stack strace is available.
|
||||||
func (p *AwaitPromiseParams) Do(ctxt context.Context, h FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
func (p *AwaitPromiseParams) Do(ctxt context.Context, h cdp.FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -226,13 +206,13 @@ func (p *AwaitPromiseParams) Do(ctxt context.Context, h FrameHandler) (result *R
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeAwaitPromise, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeAwaitPromise, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, nil, ErrChannelClosed
|
return nil, nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -241,7 +221,7 @@ func (p *AwaitPromiseParams) Do(ctxt context.Context, h FrameHandler) (result *R
|
||||||
var r AwaitPromiseReturns
|
var r AwaitPromiseReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, ErrInvalidResult
|
return nil, nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, r.ExceptionDetails, nil
|
return r.Result, r.ExceptionDetails, nil
|
||||||
|
@ -251,10 +231,10 @@ func (p *AwaitPromiseParams) Do(ctxt context.Context, h FrameHandler) (result *R
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, nil, ErrContextDone
|
return nil, nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil, ErrUnknownResult
|
return nil, nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CallFunctionOnParams calls function with given declaration on the given
|
// CallFunctionOnParams calls function with given declaration on the given
|
||||||
|
@ -274,11 +254,11 @@ type CallFunctionOnParams struct {
|
||||||
// Object group of the result is inherited from the target object.
|
// Object group of the result is inherited from the target object.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// objectId - Identifier of the object to call function on.
|
// objectID - Identifier of the object to call function on.
|
||||||
// functionDeclaration - Declaration of the function to call.
|
// functionDeclaration - Declaration of the function to call.
|
||||||
func CallFunctionOn(objectId RemoteObjectID, functionDeclaration string) *CallFunctionOnParams {
|
func CallFunctionOn(objectID RemoteObjectID, functionDeclaration string) *CallFunctionOnParams {
|
||||||
return &CallFunctionOnParams{
|
return &CallFunctionOnParams{
|
||||||
ObjectID: objectId,
|
ObjectID: objectID,
|
||||||
FunctionDeclaration: functionDeclaration,
|
FunctionDeclaration: functionDeclaration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -335,7 +315,7 @@ type CallFunctionOnReturns struct {
|
||||||
// returns:
|
// returns:
|
||||||
// result - Call result.
|
// result - Call result.
|
||||||
// exceptionDetails - Exception details.
|
// exceptionDetails - Exception details.
|
||||||
func (p *CallFunctionOnParams) Do(ctxt context.Context, h FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
func (p *CallFunctionOnParams) Do(ctxt context.Context, h cdp.FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -347,13 +327,13 @@ func (p *CallFunctionOnParams) Do(ctxt context.Context, h FrameHandler) (result
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeCallFunctionOn, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeCallFunctionOn, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, nil, ErrChannelClosed
|
return nil, nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -362,7 +342,7 @@ func (p *CallFunctionOnParams) Do(ctxt context.Context, h FrameHandler) (result
|
||||||
var r CallFunctionOnReturns
|
var r CallFunctionOnReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, ErrInvalidResult
|
return nil, nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, r.ExceptionDetails, nil
|
return r.Result, r.ExceptionDetails, nil
|
||||||
|
@ -372,10 +352,10 @@ func (p *CallFunctionOnParams) Do(ctxt context.Context, h FrameHandler) (result
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, nil, ErrContextDone
|
return nil, nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil, ErrUnknownResult
|
return nil, nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPropertiesParams returns properties of a given object. Object group of
|
// GetPropertiesParams returns properties of a given object. Object group of
|
||||||
|
@ -391,10 +371,10 @@ type GetPropertiesParams struct {
|
||||||
// result is inherited from the target object.
|
// result is inherited from the target object.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// objectId - Identifier of the object to return properties for.
|
// objectID - Identifier of the object to return properties for.
|
||||||
func GetProperties(objectId RemoteObjectID) *GetPropertiesParams {
|
func GetProperties(objectID RemoteObjectID) *GetPropertiesParams {
|
||||||
return &GetPropertiesParams{
|
return &GetPropertiesParams{
|
||||||
ObjectID: objectId,
|
ObjectID: objectID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,7 +411,7 @@ type GetPropertiesReturns struct {
|
||||||
// result - Object properties.
|
// result - Object properties.
|
||||||
// internalProperties - Internal object properties (only of the element itself).
|
// internalProperties - Internal object properties (only of the element itself).
|
||||||
// exceptionDetails - Exception details.
|
// exceptionDetails - Exception details.
|
||||||
func (p *GetPropertiesParams) Do(ctxt context.Context, h FrameHandler) (result []*PropertyDescriptor, internalProperties []*InternalPropertyDescriptor, exceptionDetails *ExceptionDetails, err error) {
|
func (p *GetPropertiesParams) Do(ctxt context.Context, h cdp.FrameHandler) (result []*PropertyDescriptor, internalProperties []*InternalPropertyDescriptor, exceptionDetails *ExceptionDetails, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -443,13 +423,13 @@ func (p *GetPropertiesParams) Do(ctxt context.Context, h FrameHandler) (result [
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeGetProperties, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeGetProperties, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, nil, nil, ErrChannelClosed
|
return nil, nil, nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -458,7 +438,7 @@ func (p *GetPropertiesParams) Do(ctxt context.Context, h FrameHandler) (result [
|
||||||
var r GetPropertiesReturns
|
var r GetPropertiesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, ErrInvalidResult
|
return nil, nil, nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, r.InternalProperties, r.ExceptionDetails, nil
|
return r.Result, r.InternalProperties, r.ExceptionDetails, nil
|
||||||
|
@ -468,10 +448,10 @@ func (p *GetPropertiesParams) Do(ctxt context.Context, h FrameHandler) (result [
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, nil, nil, ErrContextDone
|
return nil, nil, nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil, nil, ErrUnknownResult
|
return nil, nil, nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReleaseObjectParams releases remote object with given id.
|
// ReleaseObjectParams releases remote object with given id.
|
||||||
|
@ -482,15 +462,15 @@ type ReleaseObjectParams struct {
|
||||||
// ReleaseObject releases remote object with given id.
|
// ReleaseObject releases remote object with given id.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// objectId - Identifier of the object to release.
|
// objectID - Identifier of the object to release.
|
||||||
func ReleaseObject(objectId RemoteObjectID) *ReleaseObjectParams {
|
func ReleaseObject(objectID RemoteObjectID) *ReleaseObjectParams {
|
||||||
return &ReleaseObjectParams{
|
return &ReleaseObjectParams{
|
||||||
ObjectID: objectId,
|
ObjectID: objectID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Runtime.releaseObject.
|
// Do executes Runtime.releaseObject.
|
||||||
func (p *ReleaseObjectParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ReleaseObjectParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -502,13 +482,13 @@ func (p *ReleaseObjectParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeReleaseObject, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeReleaseObject, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -520,10 +500,10 @@ func (p *ReleaseObjectParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReleaseObjectGroupParams releases all remote objects that belong to a
|
// ReleaseObjectGroupParams releases all remote objects that belong to a
|
||||||
|
@ -544,7 +524,7 @@ func ReleaseObjectGroup(objectGroup string) *ReleaseObjectGroupParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Runtime.releaseObjectGroup.
|
// Do executes Runtime.releaseObjectGroup.
|
||||||
func (p *ReleaseObjectGroupParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ReleaseObjectGroupParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -556,13 +536,13 @@ func (p *ReleaseObjectGroupParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeReleaseObjectGroup, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeReleaseObjectGroup, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -574,10 +554,10 @@ func (p *ReleaseObjectGroupParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunIfWaitingForDebuggerParams tells inspected instance to run if it was
|
// RunIfWaitingForDebuggerParams tells inspected instance to run if it was
|
||||||
|
@ -591,19 +571,19 @@ func RunIfWaitingForDebugger() *RunIfWaitingForDebuggerParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Runtime.runIfWaitingForDebugger.
|
// Do executes Runtime.runIfWaitingForDebugger.
|
||||||
func (p *RunIfWaitingForDebuggerParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RunIfWaitingForDebuggerParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeRunIfWaitingForDebugger, Empty)
|
ch := h.Execute(ctxt, cdp.CommandRuntimeRunIfWaitingForDebugger, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -615,10 +595,10 @@ func (p *RunIfWaitingForDebuggerParams) Do(ctxt context.Context, h FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableParams enables reporting of execution contexts creation by means of
|
// EnableParams enables reporting of execution contexts creation by means of
|
||||||
|
@ -634,19 +614,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Runtime.enable.
|
// Do executes Runtime.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandRuntimeEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -658,10 +638,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables reporting of execution contexts creation.
|
// DisableParams disables reporting of execution contexts creation.
|
||||||
|
@ -673,19 +653,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Runtime.disable.
|
// Do executes Runtime.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandRuntimeDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -697,10 +677,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DiscardConsoleEntriesParams discards collected exceptions and console API
|
// DiscardConsoleEntriesParams discards collected exceptions and console API
|
||||||
|
@ -713,19 +693,19 @@ func DiscardConsoleEntries() *DiscardConsoleEntriesParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Runtime.discardConsoleEntries.
|
// Do executes Runtime.discardConsoleEntries.
|
||||||
func (p *DiscardConsoleEntriesParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DiscardConsoleEntriesParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeDiscardConsoleEntries, Empty)
|
ch := h.Execute(ctxt, cdp.CommandRuntimeDiscardConsoleEntries, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -737,16 +717,19 @@ func (p *DiscardConsoleEntriesParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetCustomObjectFormatterEnabledParams [no description].
|
||||||
type SetCustomObjectFormatterEnabledParams struct {
|
type SetCustomObjectFormatterEnabledParams struct {
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetCustomObjectFormatterEnabled [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// enabled
|
// enabled
|
||||||
func SetCustomObjectFormatterEnabled(enabled bool) *SetCustomObjectFormatterEnabledParams {
|
func SetCustomObjectFormatterEnabled(enabled bool) *SetCustomObjectFormatterEnabledParams {
|
||||||
|
@ -756,7 +739,7 @@ func SetCustomObjectFormatterEnabled(enabled bool) *SetCustomObjectFormatterEnab
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Runtime.setCustomObjectFormatterEnabled.
|
// Do executes Runtime.setCustomObjectFormatterEnabled.
|
||||||
func (p *SetCustomObjectFormatterEnabledParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetCustomObjectFormatterEnabledParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -768,13 +751,13 @@ func (p *SetCustomObjectFormatterEnabledParams) Do(ctxt context.Context, h Frame
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeSetCustomObjectFormatterEnabled, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeSetCustomObjectFormatterEnabled, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -786,10 +769,10 @@ func (p *SetCustomObjectFormatterEnabledParams) Do(ctxt context.Context, h Frame
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompileScriptParams compiles expression.
|
// CompileScriptParams compiles expression.
|
||||||
|
@ -817,8 +800,8 @@ func CompileScript(expression string, sourceURL string, persistScript bool) *Com
|
||||||
// WithExecutionContextID specifies in which execution context to perform
|
// WithExecutionContextID specifies in which execution context to perform
|
||||||
// script run. If the parameter is omitted the evaluation will be performed in
|
// script run. If the parameter is omitted the evaluation will be performed in
|
||||||
// the context of the inspected page.
|
// the context of the inspected page.
|
||||||
func (p CompileScriptParams) WithExecutionContextID(executionContextId ExecutionContextID) *CompileScriptParams {
|
func (p CompileScriptParams) WithExecutionContextID(executionContextID ExecutionContextID) *CompileScriptParams {
|
||||||
p.ExecutionContextID = executionContextId
|
p.ExecutionContextID = executionContextID
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,9 +814,9 @@ type CompileScriptReturns struct {
|
||||||
// Do executes Runtime.compileScript.
|
// Do executes Runtime.compileScript.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// scriptId - Id of the script.
|
// scriptID - Id of the script.
|
||||||
// exceptionDetails - Exception details.
|
// exceptionDetails - Exception details.
|
||||||
func (p *CompileScriptParams) Do(ctxt context.Context, h FrameHandler) (scriptId ScriptID, exceptionDetails *ExceptionDetails, err error) {
|
func (p *CompileScriptParams) Do(ctxt context.Context, h cdp.FrameHandler) (scriptID ScriptID, exceptionDetails *ExceptionDetails, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -845,13 +828,13 @@ func (p *CompileScriptParams) Do(ctxt context.Context, h FrameHandler) (scriptId
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeCompileScript, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeCompileScript, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", nil, ErrChannelClosed
|
return "", nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -860,7 +843,7 @@ func (p *CompileScriptParams) Do(ctxt context.Context, h FrameHandler) (scriptId
|
||||||
var r CompileScriptReturns
|
var r CompileScriptReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil, ErrInvalidResult
|
return "", nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.ScriptID, r.ExceptionDetails, nil
|
return r.ScriptID, r.ExceptionDetails, nil
|
||||||
|
@ -870,10 +853,10 @@ func (p *CompileScriptParams) Do(ctxt context.Context, h FrameHandler) (scriptId
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", nil, ErrContextDone
|
return "", nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", nil, ErrUnknownResult
|
return "", nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunScriptParams runs script with given id in a given context.
|
// RunScriptParams runs script with given id in a given context.
|
||||||
|
@ -891,18 +874,18 @@ type RunScriptParams struct {
|
||||||
// RunScript runs script with given id in a given context.
|
// RunScript runs script with given id in a given context.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// scriptId - Id of the script to run.
|
// scriptID - Id of the script to run.
|
||||||
func RunScript(scriptId ScriptID) *RunScriptParams {
|
func RunScript(scriptID ScriptID) *RunScriptParams {
|
||||||
return &RunScriptParams{
|
return &RunScriptParams{
|
||||||
ScriptID: scriptId,
|
ScriptID: scriptID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithExecutionContextID specifies in which execution context to perform
|
// WithExecutionContextID specifies in which execution context to perform
|
||||||
// script run. If the parameter is omitted the evaluation will be performed in
|
// script run. If the parameter is omitted the evaluation will be performed in
|
||||||
// the context of the inspected page.
|
// the context of the inspected page.
|
||||||
func (p RunScriptParams) WithExecutionContextID(executionContextId ExecutionContextID) *RunScriptParams {
|
func (p RunScriptParams) WithExecutionContextID(executionContextID ExecutionContextID) *RunScriptParams {
|
||||||
p.ExecutionContextID = executionContextId
|
p.ExecutionContextID = executionContextID
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -958,7 +941,7 @@ type RunScriptReturns struct {
|
||||||
// returns:
|
// returns:
|
||||||
// result - Run result.
|
// result - Run result.
|
||||||
// exceptionDetails - Exception details.
|
// exceptionDetails - Exception details.
|
||||||
func (p *RunScriptParams) Do(ctxt context.Context, h FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
func (p *RunScriptParams) Do(ctxt context.Context, h cdp.FrameHandler) (result *RemoteObject, exceptionDetails *ExceptionDetails, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -970,13 +953,13 @@ func (p *RunScriptParams) Do(ctxt context.Context, h FrameHandler) (result *Remo
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandRuntimeRunScript, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandRuntimeRunScript, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, nil, ErrChannelClosed
|
return nil, nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -985,7 +968,7 @@ func (p *RunScriptParams) Do(ctxt context.Context, h FrameHandler) (result *Remo
|
||||||
var r RunScriptReturns
|
var r RunScriptReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, ErrInvalidResult
|
return nil, nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Result, r.ExceptionDetails, nil
|
return r.Result, r.ExceptionDetails, nil
|
||||||
|
@ -995,8 +978,8 @@ func (p *RunScriptParams) Do(ctxt context.Context, h FrameHandler) (result *Remo
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, nil, ErrContextDone
|
return nil, nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil, ErrUnknownResult
|
return nil, nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ScriptID unique script identifier.
|
// ScriptID unique script identifier.
|
||||||
type ScriptID string
|
type ScriptID string
|
||||||
|
@ -108,6 +87,7 @@ type RemoteObject struct {
|
||||||
CustomPreview *CustomPreview `json:"customPreview,omitempty"`
|
CustomPreview *CustomPreview `json:"customPreview,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CustomPreview [no description].
|
||||||
type CustomPreview struct {
|
type CustomPreview struct {
|
||||||
Header string `json:"header,omitempty"`
|
Header string `json:"header,omitempty"`
|
||||||
HasBody bool `json:"hasBody,omitempty"`
|
HasBody bool `json:"hasBody,omitempty"`
|
||||||
|
@ -126,6 +106,7 @@ type ObjectPreview struct {
|
||||||
Entries []*EntryPreview `json:"entries,omitempty"` // List of the entries. Specified for map and set subtype values only.
|
Entries []*EntryPreview `json:"entries,omitempty"` // List of the entries. Specified for map and set subtype values only.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PropertyPreview [no description].
|
||||||
type PropertyPreview struct {
|
type PropertyPreview struct {
|
||||||
Name string `json:"name,omitempty"` // Property name.
|
Name string `json:"name,omitempty"` // Property name.
|
||||||
Type Type `json:"type,omitempty"` // Object type. Accessor means that the property itself is an accessor property.
|
Type Type `json:"type,omitempty"` // Object type. Accessor means that the property itself is an accessor property.
|
||||||
|
@ -134,6 +115,7 @@ type PropertyPreview struct {
|
||||||
Subtype Subtype `json:"subtype,omitempty"` // Object subtype hint. Specified for object type values only.
|
Subtype Subtype `json:"subtype,omitempty"` // Object subtype hint. Specified for object type values only.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EntryPreview [no description].
|
||||||
type EntryPreview struct {
|
type EntryPreview struct {
|
||||||
Key *ObjectPreview `json:"key,omitempty"` // Preview of the key. Specified for map-like collection entries.
|
Key *ObjectPreview `json:"key,omitempty"` // Preview of the key. Specified for map-like collection entries.
|
||||||
Value *ObjectPreview `json:"value,omitempty"` // Preview of the value.
|
Value *ObjectPreview `json:"value,omitempty"` // Preview of the value.
|
||||||
|
|
|
@ -11,30 +11,10 @@ package schema
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetDomainsParams returns supported domains.
|
// GetDomainsParams returns supported domains.
|
||||||
type GetDomainsParams struct{}
|
type GetDomainsParams struct{}
|
||||||
|
|
||||||
|
@ -52,19 +32,19 @@ type GetDomainsReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// domains - List of supported domains.
|
// domains - List of supported domains.
|
||||||
func (p *GetDomainsParams) Do(ctxt context.Context, h FrameHandler) (domains []*Domain, err error) {
|
func (p *GetDomainsParams) Do(ctxt context.Context, h cdp.FrameHandler) (domains []*Domain, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandSchemaGetDomains, Empty)
|
ch := h.Execute(ctxt, cdp.CommandSchemaGetDomains, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -73,7 +53,7 @@ func (p *GetDomainsParams) Do(ctxt context.Context, h FrameHandler) (domains []*
|
||||||
var r GetDomainsReturns
|
var r GetDomainsReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Domains, nil
|
return r.Domains, nil
|
||||||
|
@ -83,8 +63,8 @@ func (p *GetDomainsParams) Do(ctxt context.Context, h FrameHandler) (domains []*
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,30 +2,6 @@ package schema
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// Domain description of the protocol domain.
|
// Domain description of the protocol domain.
|
||||||
type Domain struct {
|
type Domain struct {
|
||||||
Name string `json:"name,omitempty"` // Domain name.
|
Name string `json:"name,omitempty"` // Domain name.
|
||||||
|
|
|
@ -17,66 +17,7 @@ var (
|
||||||
_ easyjson.Marshaler
|
_ easyjson.Marshaler
|
||||||
)
|
)
|
||||||
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(in *jlexer.Lexer, out *ShowCertificateViewerParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(in *jlexer.Lexer, out *StateExplanation) {
|
||||||
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 {
|
|
||||||
default:
|
|
||||||
in.SkipRecursive()
|
|
||||||
}
|
|
||||||
in.WantComma()
|
|
||||||
}
|
|
||||||
in.Delim('}')
|
|
||||||
if isTopLevel {
|
|
||||||
in.Consumed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity(out *jwriter.Writer, in ShowCertificateViewerParams) {
|
|
||||||
out.RawByte('{')
|
|
||||||
first := true
|
|
||||||
_ = first
|
|
||||||
out.RawByte('}')
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
|
||||||
func (v ShowCertificateViewerParams) MarshalJSON() ([]byte, error) {
|
|
||||||
w := jwriter.Writer{}
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity(&w, v)
|
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
||||||
func (v ShowCertificateViewerParams) MarshalEasyJSON(w *jwriter.Writer) {
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity(w, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
|
||||||
func (v *ShowCertificateViewerParams) UnmarshalJSON(data []byte) error {
|
|
||||||
r := jlexer.Lexer{Data: data}
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(&r, v)
|
|
||||||
return r.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
||||||
func (v *ShowCertificateViewerParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(l, v)
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(in *jlexer.Lexer, out *SecurityStateExplanation) {
|
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -113,7 +54,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(in *jlexer.Lexer, ou
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(out *jwriter.Writer, in SecurityStateExplanation) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity(out *jwriter.Writer, in StateExplanation) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -153,26 +94,85 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(out *jwriter.Writer,
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v SecurityStateExplanation) MarshalJSON() ([]byte, error) {
|
func (v StateExplanation) MarshalJSON() ([]byte, error) {
|
||||||
|
w := jwriter.Writer{}
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity(&w, v)
|
||||||
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
|
func (v StateExplanation) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity(w, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
|
func (v *StateExplanation) UnmarshalJSON(data []byte) error {
|
||||||
|
r := jlexer.Lexer{Data: data}
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(&r, v)
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
|
func (v *StateExplanation) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(l, v)
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(in *jlexer.Lexer, out *ShowCertificateViewerParams) {
|
||||||
|
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 {
|
||||||
|
default:
|
||||||
|
in.SkipRecursive()
|
||||||
|
}
|
||||||
|
in.WantComma()
|
||||||
|
}
|
||||||
|
in.Delim('}')
|
||||||
|
if isTopLevel {
|
||||||
|
in.Consumed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(out *jwriter.Writer, in ShowCertificateViewerParams) {
|
||||||
|
out.RawByte('{')
|
||||||
|
first := true
|
||||||
|
_ = first
|
||||||
|
out.RawByte('}')
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON supports json.Marshaler interface
|
||||||
|
func (v ShowCertificateViewerParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v SecurityStateExplanation) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v ShowCertificateViewerParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *SecurityStateExplanation) UnmarshalJSON(data []byte) error {
|
func (v *ShowCertificateViewerParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *SecurityStateExplanation) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *ShowCertificateViewerParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity2(in *jlexer.Lexer, out *InsecureContentStatus) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity2(in *jlexer.Lexer, out *InsecureContentStatus) {
|
||||||
|
@ -324,18 +324,18 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity3(in *jlexer.Lexer, ou
|
||||||
} else {
|
} else {
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
if !in.IsDelim(']') {
|
if !in.IsDelim(']') {
|
||||||
out.Explanations = make([]*SecurityStateExplanation, 0, 8)
|
out.Explanations = make([]*StateExplanation, 0, 8)
|
||||||
} else {
|
} else {
|
||||||
out.Explanations = []*SecurityStateExplanation{}
|
out.Explanations = []*StateExplanation{}
|
||||||
}
|
}
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
var v1 *SecurityStateExplanation
|
var v1 *StateExplanation
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
in.Skip()
|
in.Skip()
|
||||||
v1 = nil
|
v1 = nil
|
||||||
} else {
|
} else {
|
||||||
if v1 == nil {
|
if v1 == nil {
|
||||||
v1 = new(SecurityStateExplanation)
|
v1 = new(StateExplanation)
|
||||||
}
|
}
|
||||||
(*v1).UnmarshalEasyJSON(in)
|
(*v1).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,39 +3,19 @@ package security
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventSecurityStateChanged the security state of the page changed.
|
// EventSecurityStateChanged the security state of the page changed.
|
||||||
type EventSecurityStateChanged struct {
|
type EventSecurityStateChanged struct {
|
||||||
SecurityState SecurityState `json:"securityState,omitempty"` // Security state.
|
SecurityState State `json:"securityState,omitempty"` // Security state.
|
||||||
SchemeIsCryptographic bool `json:"schemeIsCryptographic,omitempty"` // True if the page was loaded over cryptographic transport such as HTTPS.
|
SchemeIsCryptographic bool `json:"schemeIsCryptographic,omitempty"` // True if the page was loaded over cryptographic transport such as HTTPS.
|
||||||
Explanations []*SecurityStateExplanation `json:"explanations,omitempty"` // List of explanations for the security state. If the overall security state is `insecure` or `warning`, at least one corresponding explanation should be included.
|
Explanations []*StateExplanation `json:"explanations,omitempty"` // 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,omitempty"` // Information about insecure content on the page.
|
InsecureContentStatus *InsecureContentStatus `json:"insecureContentStatus,omitempty"` // Information about insecure content on the page.
|
||||||
Summary string `json:"summary,omitempty"` // Overrides user-visible description of the state.
|
Summary string `json:"summary,omitempty"` // Overrides user-visible description of the state.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventSecuritySecurityStateChanged,
|
cdp.EventSecuritySecurityStateChanged,
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,30 +11,10 @@ package security
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EnableParams enables tracking security state changes.
|
// EnableParams enables tracking security state changes.
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
@ -44,19 +24,19 @@ func Enable() *EnableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Security.enable.
|
// Do executes Security.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandSecurityEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandSecurityEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -68,10 +48,10 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableParams disables tracking security state changes.
|
// DisableParams disables tracking security state changes.
|
||||||
|
@ -83,19 +63,19 @@ func Disable() *DisableParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Security.disable.
|
// Do executes Security.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandSecurityDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandSecurityDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -107,10 +87,10 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShowCertificateViewerParams displays native dialog with the certificate
|
// ShowCertificateViewerParams displays native dialog with the certificate
|
||||||
|
@ -123,19 +103,19 @@ func ShowCertificateViewer() *ShowCertificateViewerParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Security.showCertificateViewer.
|
// Do executes Security.showCertificateViewer.
|
||||||
func (p *ShowCertificateViewerParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ShowCertificateViewerParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandSecurityShowCertificateViewer, Empty)
|
ch := h.Execute(ctxt, cdp.CommandSecurityShowCertificateViewer, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -147,8 +127,8 @@ func (p *ShowCertificateViewerParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
package security
|
package security
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// CertificateID an internal certificate ID value.
|
// CertificateID an internal certificate ID value.
|
||||||
type CertificateID int64
|
type CertificateID int64
|
||||||
|
@ -39,75 +18,75 @@ func (t CertificateID) Int64() int64 {
|
||||||
return int64(t)
|
return int64(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecurityState the security level of a page or resource.
|
// State the security level of a page or resource.
|
||||||
type SecurityState string
|
type State string
|
||||||
|
|
||||||
// String returns the SecurityState as string value.
|
// String returns the State as string value.
|
||||||
func (t SecurityState) String() string {
|
func (t State) String() string {
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecurityState values.
|
// State values.
|
||||||
const (
|
const (
|
||||||
SecurityStateUnknown SecurityState = "unknown"
|
StateUnknown State = "unknown"
|
||||||
SecurityStateNeutral SecurityState = "neutral"
|
StateNeutral State = "neutral"
|
||||||
SecurityStateInsecure SecurityState = "insecure"
|
StateInsecure State = "insecure"
|
||||||
SecurityStateWarning SecurityState = "warning"
|
StateWarning State = "warning"
|
||||||
SecurityStateSecure SecurityState = "secure"
|
StateSecure State = "secure"
|
||||||
SecurityStateInfo SecurityState = "info"
|
StateInfo State = "info"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
||||||
func (t SecurityState) MarshalEasyJSON(out *jwriter.Writer) {
|
func (t State) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.String(string(t))
|
out.String(string(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON satisfies json.Marshaler.
|
// MarshalJSON satisfies json.Marshaler.
|
||||||
func (t SecurityState) MarshalJSON() ([]byte, error) {
|
func (t State) MarshalJSON() ([]byte, error) {
|
||||||
return easyjson.Marshal(t)
|
return easyjson.Marshal(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
||||||
func (t *SecurityState) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
func (t *State) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
switch SecurityState(in.String()) {
|
switch State(in.String()) {
|
||||||
case SecurityStateUnknown:
|
case StateUnknown:
|
||||||
*t = SecurityStateUnknown
|
*t = StateUnknown
|
||||||
case SecurityStateNeutral:
|
case StateNeutral:
|
||||||
*t = SecurityStateNeutral
|
*t = StateNeutral
|
||||||
case SecurityStateInsecure:
|
case StateInsecure:
|
||||||
*t = SecurityStateInsecure
|
*t = StateInsecure
|
||||||
case SecurityStateWarning:
|
case StateWarning:
|
||||||
*t = SecurityStateWarning
|
*t = StateWarning
|
||||||
case SecurityStateSecure:
|
case StateSecure:
|
||||||
*t = SecurityStateSecure
|
*t = StateSecure
|
||||||
case SecurityStateInfo:
|
case StateInfo:
|
||||||
*t = SecurityStateInfo
|
*t = StateInfo
|
||||||
|
|
||||||
default:
|
default:
|
||||||
in.AddError(errors.New("unknown SecurityState value"))
|
in.AddError(errors.New("unknown State value"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON satisfies json.Unmarshaler.
|
// UnmarshalJSON satisfies json.Unmarshaler.
|
||||||
func (t *SecurityState) UnmarshalJSON(buf []byte) error {
|
func (t *State) UnmarshalJSON(buf []byte) error {
|
||||||
return easyjson.Unmarshal(buf, t)
|
return easyjson.Unmarshal(buf, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecurityStateExplanation an explanation of an factor contributing to the
|
// StateExplanation an explanation of an factor contributing to the security
|
||||||
// security state.
|
// state.
|
||||||
type SecurityStateExplanation struct {
|
type StateExplanation struct {
|
||||||
SecurityState SecurityState `json:"securityState,omitempty"` // Security state representing the severity of the factor being explained.
|
SecurityState State `json:"securityState,omitempty"` // Security state representing the severity of the factor being explained.
|
||||||
Summary string `json:"summary,omitempty"` // Short phrase describing the type of factor.
|
Summary string `json:"summary,omitempty"` // Short phrase describing the type of factor.
|
||||||
Description string `json:"description,omitempty"` // Full text explanation of the factor.
|
Description string `json:"description,omitempty"` // Full text explanation of the factor.
|
||||||
HasCertificate bool `json:"hasCertificate,omitempty"` // True if the page has a certificate.
|
HasCertificate bool `json:"hasCertificate,omitempty"` // True if the page has a certificate.
|
||||||
}
|
}
|
||||||
|
|
||||||
// InsecureContentStatus information about insecure content on the page.
|
// InsecureContentStatus information about insecure content on the page.
|
||||||
type InsecureContentStatus struct {
|
type InsecureContentStatus struct {
|
||||||
RanMixedContent bool `json:"ranMixedContent,omitempty"` // True if the page was loaded over HTTPS and ran mixed (HTTP) content such as scripts.
|
RanMixedContent bool `json:"ranMixedContent,omitempty"` // True if the page was loaded over HTTPS and ran mixed (HTTP) content such as scripts.
|
||||||
DisplayedMixedContent bool `json:"displayedMixedContent,omitempty"` // True if the page was loaded over HTTPS and displayed mixed (HTTP) content such as images.
|
DisplayedMixedContent bool `json:"displayedMixedContent,omitempty"` // True if the page was loaded over HTTPS and displayed mixed (HTTP) content such as images.
|
||||||
RanContentWithCertErrors bool `json:"ranContentWithCertErrors,omitempty"` // True if the page was loaded over HTTPS without certificate errors, and ran content such as scripts that were loaded with certificate errors.
|
RanContentWithCertErrors bool `json:"ranContentWithCertErrors,omitempty"` // True if the page was loaded over HTTPS without certificate errors, and ran content such as scripts that were loaded with certificate errors.
|
||||||
DisplayedContentWithCertErrors bool `json:"displayedContentWithCertErrors,omitempty"` // True if the page was loaded over HTTPS without certificate errors, and displayed content such as images that were loaded with certificate errors.
|
DisplayedContentWithCertErrors bool `json:"displayedContentWithCertErrors,omitempty"` // True if the page was loaded over HTTPS without certificate errors, and displayed content such as images that were loaded with certificate errors.
|
||||||
RanInsecureContentStyle SecurityState `json:"ranInsecureContentStyle,omitempty"` // Security state representing a page that ran insecure content.
|
RanInsecureContentStyle State `json:"ranInsecureContentStyle,omitempty"` // Security state representing a page that ran insecure content.
|
||||||
DisplayedInsecureContentStyle SecurityState `json:"displayedInsecureContentStyle,omitempty"` // Security state representing a page that displayed insecure content.
|
DisplayedInsecureContentStyle State `json:"displayedInsecureContentStyle,omitempty"` // Security state representing a page that displayed insecure content.
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,44 +3,27 @@ package serviceworker
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventWorkerRegistrationUpdated [no description].
|
||||||
type EventWorkerRegistrationUpdated struct {
|
type EventWorkerRegistrationUpdated struct {
|
||||||
Registrations []*ServiceWorkerRegistration `json:"registrations,omitempty"`
|
Registrations []*Registration `json:"registrations,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventWorkerVersionUpdated [no description].
|
||||||
type EventWorkerVersionUpdated struct {
|
type EventWorkerVersionUpdated struct {
|
||||||
Versions []*ServiceWorkerVersion `json:"versions,omitempty"`
|
Versions []*Version `json:"versions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventWorkerErrorReported [no description].
|
||||||
type EventWorkerErrorReported struct {
|
type EventWorkerErrorReported struct {
|
||||||
ErrorMessage *ServiceWorkerErrorMessage `json:"errorMessage,omitempty"`
|
ErrorMessage *ErrorMessage `json:"errorMessage,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventServiceWorkerWorkerRegistrationUpdated,
|
cdp.EventServiceWorkerWorkerRegistrationUpdated,
|
||||||
EventServiceWorkerWorkerVersionUpdated,
|
cdp.EventServiceWorkerWorkerVersionUpdated,
|
||||||
EventServiceWorkerWorkerErrorReported,
|
cdp.EventServiceWorkerWorkerErrorReported,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,50 +9,32 @@ package serviceworker
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// EnableParams [no description].
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type EnableParams struct{}
|
type EnableParams struct{}
|
||||||
|
|
||||||
|
// Enable [no description].
|
||||||
func Enable() *EnableParams {
|
func Enable() *EnableParams {
|
||||||
return &EnableParams{}
|
return &EnableParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.enable.
|
// Do executes ServiceWorker.enable.
|
||||||
func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerEnable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerEnable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -64,32 +46,34 @@ func (p *EnableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DisableParams [no description].
|
||||||
type DisableParams struct{}
|
type DisableParams struct{}
|
||||||
|
|
||||||
|
// Disable [no description].
|
||||||
func Disable() *DisableParams {
|
func Disable() *DisableParams {
|
||||||
return &DisableParams{}
|
return &DisableParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.disable.
|
// Do executes ServiceWorker.disable.
|
||||||
func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerDisable, Empty)
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerDisable, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -101,16 +85,19 @@ func (p *DisableParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnregisterParams [no description].
|
||||||
type UnregisterParams struct {
|
type UnregisterParams struct {
|
||||||
ScopeURL string `json:"scopeURL"`
|
ScopeURL string `json:"scopeURL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unregister [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// scopeURL
|
// scopeURL
|
||||||
func Unregister(scopeURL string) *UnregisterParams {
|
func Unregister(scopeURL string) *UnregisterParams {
|
||||||
|
@ -120,7 +107,7 @@ func Unregister(scopeURL string) *UnregisterParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.unregister.
|
// Do executes ServiceWorker.unregister.
|
||||||
func (p *UnregisterParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *UnregisterParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -132,13 +119,13 @@ func (p *UnregisterParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerUnregister, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerUnregister, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -150,16 +137,19 @@ func (p *UnregisterParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateRegistrationParams [no description].
|
||||||
type UpdateRegistrationParams struct {
|
type UpdateRegistrationParams struct {
|
||||||
ScopeURL string `json:"scopeURL"`
|
ScopeURL string `json:"scopeURL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateRegistration [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// scopeURL
|
// scopeURL
|
||||||
func UpdateRegistration(scopeURL string) *UpdateRegistrationParams {
|
func UpdateRegistration(scopeURL string) *UpdateRegistrationParams {
|
||||||
|
@ -169,7 +159,7 @@ func UpdateRegistration(scopeURL string) *UpdateRegistrationParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.updateRegistration.
|
// Do executes ServiceWorker.updateRegistration.
|
||||||
func (p *UpdateRegistrationParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *UpdateRegistrationParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -181,13 +171,13 @@ func (p *UpdateRegistrationParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerUpdateRegistration, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerUpdateRegistration, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -199,16 +189,19 @@ func (p *UpdateRegistrationParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartWorkerParams [no description].
|
||||||
type StartWorkerParams struct {
|
type StartWorkerParams struct {
|
||||||
ScopeURL string `json:"scopeURL"`
|
ScopeURL string `json:"scopeURL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartWorker [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// scopeURL
|
// scopeURL
|
||||||
func StartWorker(scopeURL string) *StartWorkerParams {
|
func StartWorker(scopeURL string) *StartWorkerParams {
|
||||||
|
@ -218,7 +211,7 @@ func StartWorker(scopeURL string) *StartWorkerParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.startWorker.
|
// Do executes ServiceWorker.startWorker.
|
||||||
func (p *StartWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StartWorkerParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -230,13 +223,13 @@ func (p *StartWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerStartWorker, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerStartWorker, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -248,16 +241,19 @@ func (p *StartWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SkipWaitingParams [no description].
|
||||||
type SkipWaitingParams struct {
|
type SkipWaitingParams struct {
|
||||||
ScopeURL string `json:"scopeURL"`
|
ScopeURL string `json:"scopeURL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SkipWaiting [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// scopeURL
|
// scopeURL
|
||||||
func SkipWaiting(scopeURL string) *SkipWaitingParams {
|
func SkipWaiting(scopeURL string) *SkipWaitingParams {
|
||||||
|
@ -267,7 +263,7 @@ func SkipWaiting(scopeURL string) *SkipWaitingParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.skipWaiting.
|
// Do executes ServiceWorker.skipWaiting.
|
||||||
func (p *SkipWaitingParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SkipWaitingParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -279,13 +275,13 @@ func (p *SkipWaitingParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerSkipWaiting, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerSkipWaiting, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -297,26 +293,29 @@ func (p *SkipWaitingParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StopWorkerParams [no description].
|
||||||
type StopWorkerParams struct {
|
type StopWorkerParams struct {
|
||||||
VersionID string `json:"versionId"`
|
VersionID string `json:"versionId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StopWorker [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// versionId
|
// versionID
|
||||||
func StopWorker(versionId string) *StopWorkerParams {
|
func StopWorker(versionID string) *StopWorkerParams {
|
||||||
return &StopWorkerParams{
|
return &StopWorkerParams{
|
||||||
VersionID: versionId,
|
VersionID: versionID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.stopWorker.
|
// Do executes ServiceWorker.stopWorker.
|
||||||
func (p *StopWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StopWorkerParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -328,13 +327,13 @@ func (p *StopWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerStopWorker, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerStopWorker, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -346,26 +345,29 @@ func (p *StopWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InspectWorkerParams [no description].
|
||||||
type InspectWorkerParams struct {
|
type InspectWorkerParams struct {
|
||||||
VersionID string `json:"versionId"`
|
VersionID string `json:"versionId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InspectWorker [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// versionId
|
// versionID
|
||||||
func InspectWorker(versionId string) *InspectWorkerParams {
|
func InspectWorker(versionID string) *InspectWorkerParams {
|
||||||
return &InspectWorkerParams{
|
return &InspectWorkerParams{
|
||||||
VersionID: versionId,
|
VersionID: versionID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.inspectWorker.
|
// Do executes ServiceWorker.inspectWorker.
|
||||||
func (p *InspectWorkerParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *InspectWorkerParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -377,13 +379,13 @@ func (p *InspectWorkerParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerInspectWorker, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerInspectWorker, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -395,16 +397,19 @@ func (p *InspectWorkerParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetForceUpdateOnPageLoadParams [no description].
|
||||||
type SetForceUpdateOnPageLoadParams struct {
|
type SetForceUpdateOnPageLoadParams struct {
|
||||||
ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"`
|
ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetForceUpdateOnPageLoad [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// forceUpdateOnPageLoad
|
// forceUpdateOnPageLoad
|
||||||
func SetForceUpdateOnPageLoad(forceUpdateOnPageLoad bool) *SetForceUpdateOnPageLoadParams {
|
func SetForceUpdateOnPageLoad(forceUpdateOnPageLoad bool) *SetForceUpdateOnPageLoadParams {
|
||||||
|
@ -414,7 +419,7 @@ func SetForceUpdateOnPageLoad(forceUpdateOnPageLoad bool) *SetForceUpdateOnPageL
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.setForceUpdateOnPageLoad.
|
// Do executes ServiceWorker.setForceUpdateOnPageLoad.
|
||||||
func (p *SetForceUpdateOnPageLoadParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetForceUpdateOnPageLoadParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -426,13 +431,13 @@ func (p *SetForceUpdateOnPageLoadParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerSetForceUpdateOnPageLoad, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerSetForceUpdateOnPageLoad, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -444,32 +449,35 @@ func (p *SetForceUpdateOnPageLoadParams) Do(ctxt context.Context, h FrameHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeliverPushMessageParams [no description].
|
||||||
type DeliverPushMessageParams struct {
|
type DeliverPushMessageParams struct {
|
||||||
Origin string `json:"origin"`
|
Origin string `json:"origin"`
|
||||||
RegistrationID string `json:"registrationId"`
|
RegistrationID string `json:"registrationId"`
|
||||||
Data string `json:"data"`
|
Data string `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeliverPushMessage [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// origin
|
// origin
|
||||||
// registrationId
|
// registrationID
|
||||||
// data
|
// data
|
||||||
func DeliverPushMessage(origin string, registrationId string, data string) *DeliverPushMessageParams {
|
func DeliverPushMessage(origin string, registrationID string, data string) *DeliverPushMessageParams {
|
||||||
return &DeliverPushMessageParams{
|
return &DeliverPushMessageParams{
|
||||||
Origin: origin,
|
Origin: origin,
|
||||||
RegistrationID: registrationId,
|
RegistrationID: registrationID,
|
||||||
Data: data,
|
Data: data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.deliverPushMessage.
|
// Do executes ServiceWorker.deliverPushMessage.
|
||||||
func (p *DeliverPushMessageParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DeliverPushMessageParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -481,13 +489,13 @@ func (p *DeliverPushMessageParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerDeliverPushMessage, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerDeliverPushMessage, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -499,12 +507,13 @@ func (p *DeliverPushMessageParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DispatchSyncEventParams [no description].
|
||||||
type DispatchSyncEventParams struct {
|
type DispatchSyncEventParams struct {
|
||||||
Origin string `json:"origin"`
|
Origin string `json:"origin"`
|
||||||
RegistrationID string `json:"registrationId"`
|
RegistrationID string `json:"registrationId"`
|
||||||
|
@ -512,22 +521,24 @@ type DispatchSyncEventParams struct {
|
||||||
LastChance bool `json:"lastChance"`
|
LastChance bool `json:"lastChance"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DispatchSyncEvent [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// origin
|
// origin
|
||||||
// registrationId
|
// registrationID
|
||||||
// tag
|
// tag
|
||||||
// lastChance
|
// lastChance
|
||||||
func DispatchSyncEvent(origin string, registrationId string, tag string, lastChance bool) *DispatchSyncEventParams {
|
func DispatchSyncEvent(origin string, registrationID string, tag string, lastChance bool) *DispatchSyncEventParams {
|
||||||
return &DispatchSyncEventParams{
|
return &DispatchSyncEventParams{
|
||||||
Origin: origin,
|
Origin: origin,
|
||||||
RegistrationID: registrationId,
|
RegistrationID: registrationID,
|
||||||
Tag: tag,
|
Tag: tag,
|
||||||
LastChance: lastChance,
|
LastChance: lastChance,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes ServiceWorker.dispatchSyncEvent.
|
// Do executes ServiceWorker.dispatchSyncEvent.
|
||||||
func (p *DispatchSyncEventParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DispatchSyncEventParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -539,13 +550,13 @@ func (p *DispatchSyncEventParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandServiceWorkerDispatchSyncEvent, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandServiceWorkerDispatchSyncEvent, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -557,8 +568,8 @@ func (p *DispatchSyncEventParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,159 +1,140 @@
|
||||||
package serviceworker
|
package serviceworker
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/knq/chromedp/cdp/target"
|
"github.com/knq/chromedp/cdp/target"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ServiceWorkerRegistration serviceWorker registration.
|
// Registration serviceWorker registration.
|
||||||
type ServiceWorkerRegistration struct {
|
type Registration struct {
|
||||||
RegistrationID string `json:"registrationId,omitempty"`
|
RegistrationID string `json:"registrationId,omitempty"`
|
||||||
ScopeURL string `json:"scopeURL,omitempty"`
|
ScopeURL string `json:"scopeURL,omitempty"`
|
||||||
IsDeleted bool `json:"isDeleted,omitempty"`
|
IsDeleted bool `json:"isDeleted,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServiceWorkerVersionRunningStatus string
|
// VersionRunningStatus [no description].
|
||||||
|
type VersionRunningStatus string
|
||||||
|
|
||||||
// String returns the ServiceWorkerVersionRunningStatus as string value.
|
// String returns the VersionRunningStatus as string value.
|
||||||
func (t ServiceWorkerVersionRunningStatus) String() string {
|
func (t VersionRunningStatus) String() string {
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceWorkerVersionRunningStatus values.
|
// VersionRunningStatus values.
|
||||||
const (
|
const (
|
||||||
ServiceWorkerVersionRunningStatusStopped ServiceWorkerVersionRunningStatus = "stopped"
|
VersionRunningStatusStopped VersionRunningStatus = "stopped"
|
||||||
ServiceWorkerVersionRunningStatusStarting ServiceWorkerVersionRunningStatus = "starting"
|
VersionRunningStatusStarting VersionRunningStatus = "starting"
|
||||||
ServiceWorkerVersionRunningStatusRunning ServiceWorkerVersionRunningStatus = "running"
|
VersionRunningStatusRunning VersionRunningStatus = "running"
|
||||||
ServiceWorkerVersionRunningStatusStopping ServiceWorkerVersionRunningStatus = "stopping"
|
VersionRunningStatusStopping VersionRunningStatus = "stopping"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
||||||
func (t ServiceWorkerVersionRunningStatus) MarshalEasyJSON(out *jwriter.Writer) {
|
func (t VersionRunningStatus) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.String(string(t))
|
out.String(string(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON satisfies json.Marshaler.
|
// MarshalJSON satisfies json.Marshaler.
|
||||||
func (t ServiceWorkerVersionRunningStatus) MarshalJSON() ([]byte, error) {
|
func (t VersionRunningStatus) MarshalJSON() ([]byte, error) {
|
||||||
return easyjson.Marshal(t)
|
return easyjson.Marshal(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
||||||
func (t *ServiceWorkerVersionRunningStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
func (t *VersionRunningStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
switch ServiceWorkerVersionRunningStatus(in.String()) {
|
switch VersionRunningStatus(in.String()) {
|
||||||
case ServiceWorkerVersionRunningStatusStopped:
|
case VersionRunningStatusStopped:
|
||||||
*t = ServiceWorkerVersionRunningStatusStopped
|
*t = VersionRunningStatusStopped
|
||||||
case ServiceWorkerVersionRunningStatusStarting:
|
case VersionRunningStatusStarting:
|
||||||
*t = ServiceWorkerVersionRunningStatusStarting
|
*t = VersionRunningStatusStarting
|
||||||
case ServiceWorkerVersionRunningStatusRunning:
|
case VersionRunningStatusRunning:
|
||||||
*t = ServiceWorkerVersionRunningStatusRunning
|
*t = VersionRunningStatusRunning
|
||||||
case ServiceWorkerVersionRunningStatusStopping:
|
case VersionRunningStatusStopping:
|
||||||
*t = ServiceWorkerVersionRunningStatusStopping
|
*t = VersionRunningStatusStopping
|
||||||
|
|
||||||
default:
|
default:
|
||||||
in.AddError(errors.New("unknown ServiceWorkerVersionRunningStatus value"))
|
in.AddError(errors.New("unknown VersionRunningStatus value"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON satisfies json.Unmarshaler.
|
// UnmarshalJSON satisfies json.Unmarshaler.
|
||||||
func (t *ServiceWorkerVersionRunningStatus) UnmarshalJSON(buf []byte) error {
|
func (t *VersionRunningStatus) UnmarshalJSON(buf []byte) error {
|
||||||
return easyjson.Unmarshal(buf, t)
|
return easyjson.Unmarshal(buf, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServiceWorkerVersionStatus string
|
// VersionStatus [no description].
|
||||||
|
type VersionStatus string
|
||||||
|
|
||||||
// String returns the ServiceWorkerVersionStatus as string value.
|
// String returns the VersionStatus as string value.
|
||||||
func (t ServiceWorkerVersionStatus) String() string {
|
func (t VersionStatus) String() string {
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceWorkerVersionStatus values.
|
// VersionStatus values.
|
||||||
const (
|
const (
|
||||||
ServiceWorkerVersionStatusNew ServiceWorkerVersionStatus = "new"
|
VersionStatusNew VersionStatus = "new"
|
||||||
ServiceWorkerVersionStatusInstalling ServiceWorkerVersionStatus = "installing"
|
VersionStatusInstalling VersionStatus = "installing"
|
||||||
ServiceWorkerVersionStatusInstalled ServiceWorkerVersionStatus = "installed"
|
VersionStatusInstalled VersionStatus = "installed"
|
||||||
ServiceWorkerVersionStatusActivating ServiceWorkerVersionStatus = "activating"
|
VersionStatusActivating VersionStatus = "activating"
|
||||||
ServiceWorkerVersionStatusActivated ServiceWorkerVersionStatus = "activated"
|
VersionStatusActivated VersionStatus = "activated"
|
||||||
ServiceWorkerVersionStatusRedundant ServiceWorkerVersionStatus = "redundant"
|
VersionStatusRedundant VersionStatus = "redundant"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
||||||
func (t ServiceWorkerVersionStatus) MarshalEasyJSON(out *jwriter.Writer) {
|
func (t VersionStatus) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.String(string(t))
|
out.String(string(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON satisfies json.Marshaler.
|
// MarshalJSON satisfies json.Marshaler.
|
||||||
func (t ServiceWorkerVersionStatus) MarshalJSON() ([]byte, error) {
|
func (t VersionStatus) MarshalJSON() ([]byte, error) {
|
||||||
return easyjson.Marshal(t)
|
return easyjson.Marshal(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
||||||
func (t *ServiceWorkerVersionStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
func (t *VersionStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
switch ServiceWorkerVersionStatus(in.String()) {
|
switch VersionStatus(in.String()) {
|
||||||
case ServiceWorkerVersionStatusNew:
|
case VersionStatusNew:
|
||||||
*t = ServiceWorkerVersionStatusNew
|
*t = VersionStatusNew
|
||||||
case ServiceWorkerVersionStatusInstalling:
|
case VersionStatusInstalling:
|
||||||
*t = ServiceWorkerVersionStatusInstalling
|
*t = VersionStatusInstalling
|
||||||
case ServiceWorkerVersionStatusInstalled:
|
case VersionStatusInstalled:
|
||||||
*t = ServiceWorkerVersionStatusInstalled
|
*t = VersionStatusInstalled
|
||||||
case ServiceWorkerVersionStatusActivating:
|
case VersionStatusActivating:
|
||||||
*t = ServiceWorkerVersionStatusActivating
|
*t = VersionStatusActivating
|
||||||
case ServiceWorkerVersionStatusActivated:
|
case VersionStatusActivated:
|
||||||
*t = ServiceWorkerVersionStatusActivated
|
*t = VersionStatusActivated
|
||||||
case ServiceWorkerVersionStatusRedundant:
|
case VersionStatusRedundant:
|
||||||
*t = ServiceWorkerVersionStatusRedundant
|
*t = VersionStatusRedundant
|
||||||
|
|
||||||
default:
|
default:
|
||||||
in.AddError(errors.New("unknown ServiceWorkerVersionStatus value"))
|
in.AddError(errors.New("unknown VersionStatus value"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON satisfies json.Unmarshaler.
|
// UnmarshalJSON satisfies json.Unmarshaler.
|
||||||
func (t *ServiceWorkerVersionStatus) UnmarshalJSON(buf []byte) error {
|
func (t *VersionStatus) UnmarshalJSON(buf []byte) error {
|
||||||
return easyjson.Unmarshal(buf, t)
|
return easyjson.Unmarshal(buf, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceWorkerVersion serviceWorker version.
|
// Version serviceWorker version.
|
||||||
type ServiceWorkerVersion struct {
|
type Version struct {
|
||||||
VersionID string `json:"versionId,omitempty"`
|
VersionID string `json:"versionId,omitempty"`
|
||||||
RegistrationID string `json:"registrationId,omitempty"`
|
RegistrationID string `json:"registrationId,omitempty"`
|
||||||
ScriptURL string `json:"scriptURL,omitempty"`
|
ScriptURL string `json:"scriptURL,omitempty"`
|
||||||
RunningStatus ServiceWorkerVersionRunningStatus `json:"runningStatus,omitempty"`
|
RunningStatus VersionRunningStatus `json:"runningStatus,omitempty"`
|
||||||
Status ServiceWorkerVersionStatus `json:"status,omitempty"`
|
Status VersionStatus `json:"status,omitempty"`
|
||||||
ScriptLastModified float64 `json:"scriptLastModified,omitempty"` // The Last-Modified header value of the main script.
|
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.TargetID `json:"controlledClients,omitempty"`
|
ControlledClients []target.ID `json:"controlledClients,omitempty"`
|
||||||
TargetID target.TargetID `json:"targetId,omitempty"`
|
TargetID target.ID `json:"targetId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceWorkerErrorMessage serviceWorker error message.
|
// ErrorMessage serviceWorker error message.
|
||||||
type ServiceWorkerErrorMessage struct {
|
type ErrorMessage struct {
|
||||||
ErrorMessage string `json:"errorMessage,omitempty"`
|
ErrorMessage string `json:"errorMessage,omitempty"`
|
||||||
RegistrationID string `json:"registrationId,omitempty"`
|
RegistrationID string `json:"registrationId,omitempty"`
|
||||||
VersionID string `json:"versionId,omitempty"`
|
VersionID string `json:"versionId,omitempty"`
|
||||||
|
|
|
@ -9,30 +9,10 @@ package storage
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// ClearDataForOriginParams clears storage for origin.
|
// ClearDataForOriginParams clears storage for origin.
|
||||||
type ClearDataForOriginParams struct {
|
type ClearDataForOriginParams struct {
|
||||||
Origin string `json:"origin"` // Security origin.
|
Origin string `json:"origin"` // Security origin.
|
||||||
|
@ -52,7 +32,7 @@ func ClearDataForOrigin(origin string, storageTypes string) *ClearDataForOriginP
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Storage.clearDataForOrigin.
|
// Do executes Storage.clearDataForOrigin.
|
||||||
func (p *ClearDataForOriginParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ClearDataForOriginParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -64,13 +44,13 @@ func (p *ClearDataForOriginParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandStorageClearDataForOrigin, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandStorageClearDataForOrigin, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -82,8 +62,8 @@ func (p *ClearDataForOriginParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,98 +1,77 @@
|
||||||
package storage
|
package storage
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// StorageType enum of possible storage types.
|
// Type enum of possible storage types.
|
||||||
type StorageType string
|
type Type string
|
||||||
|
|
||||||
// String returns the StorageType as string value.
|
// String returns the Type as string value.
|
||||||
func (t StorageType) String() string {
|
func (t Type) String() string {
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// StorageType values.
|
// Type values.
|
||||||
const (
|
const (
|
||||||
StorageTypeAppcache StorageType = "appcache"
|
TypeAppcache Type = "appcache"
|
||||||
StorageTypeCookies StorageType = "cookies"
|
TypeCookies Type = "cookies"
|
||||||
StorageTypeFileSystems StorageType = "file_systems"
|
TypeFileSystems Type = "file_systems"
|
||||||
StorageTypeIndexeddb StorageType = "indexeddb"
|
TypeIndexeddb Type = "indexeddb"
|
||||||
StorageTypeLocalStorage StorageType = "local_storage"
|
TypeLocalStorage Type = "local_storage"
|
||||||
StorageTypeShaderCache StorageType = "shader_cache"
|
TypeShaderCache Type = "shader_cache"
|
||||||
StorageTypeWebsql StorageType = "websql"
|
TypeWebsql Type = "websql"
|
||||||
StorageTypeServiceWorkers StorageType = "service_workers"
|
TypeServiceWorkers Type = "service_workers"
|
||||||
StorageTypeCacheStorage StorageType = "cache_storage"
|
TypeCacheStorage Type = "cache_storage"
|
||||||
StorageTypeAll StorageType = "all"
|
TypeAll Type = "all"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
||||||
func (t StorageType) MarshalEasyJSON(out *jwriter.Writer) {
|
func (t Type) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.String(string(t))
|
out.String(string(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON satisfies json.Marshaler.
|
// MarshalJSON satisfies json.Marshaler.
|
||||||
func (t StorageType) MarshalJSON() ([]byte, error) {
|
func (t Type) MarshalJSON() ([]byte, error) {
|
||||||
return easyjson.Marshal(t)
|
return easyjson.Marshal(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
||||||
func (t *StorageType) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
func (t *Type) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
switch StorageType(in.String()) {
|
switch Type(in.String()) {
|
||||||
case StorageTypeAppcache:
|
case TypeAppcache:
|
||||||
*t = StorageTypeAppcache
|
*t = TypeAppcache
|
||||||
case StorageTypeCookies:
|
case TypeCookies:
|
||||||
*t = StorageTypeCookies
|
*t = TypeCookies
|
||||||
case StorageTypeFileSystems:
|
case TypeFileSystems:
|
||||||
*t = StorageTypeFileSystems
|
*t = TypeFileSystems
|
||||||
case StorageTypeIndexeddb:
|
case TypeIndexeddb:
|
||||||
*t = StorageTypeIndexeddb
|
*t = TypeIndexeddb
|
||||||
case StorageTypeLocalStorage:
|
case TypeLocalStorage:
|
||||||
*t = StorageTypeLocalStorage
|
*t = TypeLocalStorage
|
||||||
case StorageTypeShaderCache:
|
case TypeShaderCache:
|
||||||
*t = StorageTypeShaderCache
|
*t = TypeShaderCache
|
||||||
case StorageTypeWebsql:
|
case TypeWebsql:
|
||||||
*t = StorageTypeWebsql
|
*t = TypeWebsql
|
||||||
case StorageTypeServiceWorkers:
|
case TypeServiceWorkers:
|
||||||
*t = StorageTypeServiceWorkers
|
*t = TypeServiceWorkers
|
||||||
case StorageTypeCacheStorage:
|
case TypeCacheStorage:
|
||||||
*t = StorageTypeCacheStorage
|
*t = TypeCacheStorage
|
||||||
case StorageTypeAll:
|
case TypeAll:
|
||||||
*t = StorageTypeAll
|
*t = TypeAll
|
||||||
|
|
||||||
default:
|
default:
|
||||||
in.AddError(errors.New("unknown StorageType value"))
|
in.AddError(errors.New("unknown Type value"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON satisfies json.Unmarshaler.
|
// UnmarshalJSON satisfies json.Unmarshaler.
|
||||||
func (t *StorageType) UnmarshalJSON(buf []byte) error {
|
func (t *Type) UnmarshalJSON(buf []byte) error {
|
||||||
return easyjson.Unmarshal(buf, t)
|
return easyjson.Unmarshal(buf, t)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,30 +12,10 @@ package systeminfo
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetInfoParams returns information about the system.
|
// GetInfoParams returns information about the system.
|
||||||
type GetInfoParams struct{}
|
type GetInfoParams struct{}
|
||||||
|
|
||||||
|
@ -57,19 +37,19 @@ type GetInfoReturns struct {
|
||||||
// gpu - Information about the GPUs on the system.
|
// gpu - Information about the GPUs on the system.
|
||||||
// modelName - 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.
|
// modelName - 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.
|
||||||
// modelVersion - 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.
|
// modelVersion - 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.
|
||||||
func (p *GetInfoParams) Do(ctxt context.Context, h FrameHandler) (gpu *GPUInfo, modelName string, modelVersion string, err error) {
|
func (p *GetInfoParams) Do(ctxt context.Context, h cdp.FrameHandler) (gpu *GPUInfo, modelName string, modelVersion string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandSystemInfoGetInfo, Empty)
|
ch := h.Execute(ctxt, cdp.CommandSystemInfoGetInfo, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, "", "", ErrChannelClosed
|
return nil, "", "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -78,7 +58,7 @@ func (p *GetInfoParams) Do(ctxt context.Context, h FrameHandler) (gpu *GPUInfo,
|
||||||
var r GetInfoReturns
|
var r GetInfoReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", "", ErrInvalidResult
|
return nil, "", "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Gpu, r.ModelName, r.ModelVersion, nil
|
return r.Gpu, r.ModelName, r.ModelVersion, nil
|
||||||
|
@ -88,8 +68,8 @@ func (p *GetInfoParams) Do(ctxt context.Context, h FrameHandler) (gpu *GPUInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, "", "", ErrContextDone
|
return nil, "", "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, "", "", ErrUnknownResult
|
return nil, "", "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,9 @@
|
||||||
package systeminfo
|
package systeminfo
|
||||||
|
|
||||||
|
import "github.com/mailru/easyjson"
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// GPUDevice describes a single graphics processor (GPU).
|
// GPUDevice describes a single graphics processor (GPU).
|
||||||
type GPUDevice struct {
|
type GPUDevice struct {
|
||||||
VendorID float64 `json:"vendorId,omitempty"` // PCI ID of the GPU vendor, if available; 0 otherwise.
|
VendorID float64 `json:"vendorId,omitempty"` // PCI ID of the GPU vendor, if available; 0 otherwise.
|
||||||
|
|
|
@ -17,106 +17,7 @@ var (
|
||||||
_ easyjson.Marshaler
|
_ easyjson.Marshaler
|
||||||
)
|
)
|
||||||
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget(in *jlexer.Lexer, out *TargetInfo) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget(in *jlexer.Lexer, out *SetRemoteLocationsParams) {
|
||||||
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 "targetId":
|
|
||||||
out.TargetID = TargetID(in.String())
|
|
||||||
case "type":
|
|
||||||
out.Type = string(in.String())
|
|
||||||
case "title":
|
|
||||||
out.Title = string(in.String())
|
|
||||||
case "url":
|
|
||||||
out.URL = string(in.String())
|
|
||||||
default:
|
|
||||||
in.SkipRecursive()
|
|
||||||
}
|
|
||||||
in.WantComma()
|
|
||||||
}
|
|
||||||
in.Delim('}')
|
|
||||||
if isTopLevel {
|
|
||||||
in.Consumed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget(out *jwriter.Writer, in TargetInfo) {
|
|
||||||
out.RawByte('{')
|
|
||||||
first := true
|
|
||||||
_ = first
|
|
||||||
if in.TargetID != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"targetId\":")
|
|
||||||
out.String(string(in.TargetID))
|
|
||||||
}
|
|
||||||
if in.Type != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"type\":")
|
|
||||||
out.String(string(in.Type))
|
|
||||||
}
|
|
||||||
if in.Title != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"title\":")
|
|
||||||
out.String(string(in.Title))
|
|
||||||
}
|
|
||||||
if in.URL != "" {
|
|
||||||
if !first {
|
|
||||||
out.RawByte(',')
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
out.RawString("\"url\":")
|
|
||||||
out.String(string(in.URL))
|
|
||||||
}
|
|
||||||
out.RawByte('}')
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalJSON supports json.Marshaler interface
|
|
||||||
func (v TargetInfo) MarshalJSON() ([]byte, error) {
|
|
||||||
w := jwriter.Writer{}
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget(&w, v)
|
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
||||||
func (v TargetInfo) MarshalEasyJSON(w *jwriter.Writer) {
|
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget(w, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
|
||||||
func (v *TargetInfo) UnmarshalJSON(data []byte) error {
|
|
||||||
r := jlexer.Lexer{Data: data}
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget(&r, v)
|
|
||||||
return r.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
||||||
func (v *TargetInfo) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget(l, v)
|
|
||||||
}
|
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget1(in *jlexer.Lexer, out *SetRemoteLocationsParams) {
|
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -172,7 +73,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget1(in *jlexer.Lexer, out
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget1(out *jwriter.Writer, in SetRemoteLocationsParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget(out *jwriter.Writer, in SetRemoteLocationsParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -203,27 +104,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget1(out *jwriter.Writer, i
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v SetRemoteLocationsParams) MarshalJSON() ([]byte, error) {
|
func (v SetRemoteLocationsParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget1(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v SetRemoteLocationsParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v SetRemoteLocationsParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget1(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *SetRemoteLocationsParams) UnmarshalJSON(data []byte) error {
|
func (v *SetRemoteLocationsParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget1(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *SetRemoteLocationsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *SetRemoteLocationsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget1(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget2(in *jlexer.Lexer, out *SetDiscoverTargetsParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget1(in *jlexer.Lexer, out *SetDiscoverTargetsParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -254,7 +155,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget2(in *jlexer.Lexer, out
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget2(out *jwriter.Writer, in SetDiscoverTargetsParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget1(out *jwriter.Writer, in SetDiscoverTargetsParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -270,27 +171,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget2(out *jwriter.Writer, i
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v SetDiscoverTargetsParams) MarshalJSON() ([]byte, error) {
|
func (v SetDiscoverTargetsParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget2(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget1(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v SetDiscoverTargetsParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v SetDiscoverTargetsParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget2(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget1(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *SetDiscoverTargetsParams) UnmarshalJSON(data []byte) error {
|
func (v *SetDiscoverTargetsParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget2(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget1(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *SetDiscoverTargetsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *SetDiscoverTargetsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget2(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget1(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget3(in *jlexer.Lexer, out *SetAutoAttachParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget2(in *jlexer.Lexer, out *SetAutoAttachParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -323,7 +224,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget3(in *jlexer.Lexer, out
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget3(out *jwriter.Writer, in SetAutoAttachParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget2(out *jwriter.Writer, in SetAutoAttachParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -345,27 +246,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget3(out *jwriter.Writer, i
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v SetAutoAttachParams) MarshalJSON() ([]byte, error) {
|
func (v SetAutoAttachParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget3(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget2(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v SetAutoAttachParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v SetAutoAttachParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget3(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget2(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *SetAutoAttachParams) UnmarshalJSON(data []byte) error {
|
func (v *SetAutoAttachParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget3(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget2(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *SetAutoAttachParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *SetAutoAttachParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget3(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget2(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget4(in *jlexer.Lexer, out *SetAttachToFramesParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget3(in *jlexer.Lexer, out *SetAttachToFramesParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -396,7 +297,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget4(in *jlexer.Lexer, out
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget4(out *jwriter.Writer, in SetAttachToFramesParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget3(out *jwriter.Writer, in SetAttachToFramesParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -412,27 +313,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget4(out *jwriter.Writer, i
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v SetAttachToFramesParams) MarshalJSON() ([]byte, error) {
|
func (v SetAttachToFramesParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget4(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget3(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v SetAttachToFramesParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v SetAttachToFramesParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget4(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget3(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *SetAttachToFramesParams) UnmarshalJSON(data []byte) error {
|
func (v *SetAttachToFramesParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget4(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget3(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *SetAttachToFramesParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *SetAttachToFramesParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget4(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget3(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget5(in *jlexer.Lexer, out *SendMessageToTargetParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget4(in *jlexer.Lexer, out *SendMessageToTargetParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -465,7 +366,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget5(in *jlexer.Lexer, out
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget5(out *jwriter.Writer, in SendMessageToTargetParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget4(out *jwriter.Writer, in SendMessageToTargetParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -487,27 +388,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget5(out *jwriter.Writer, i
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v SendMessageToTargetParams) MarshalJSON() ([]byte, error) {
|
func (v SendMessageToTargetParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget5(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget4(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v SendMessageToTargetParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v SendMessageToTargetParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget5(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget4(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *SendMessageToTargetParams) UnmarshalJSON(data []byte) error {
|
func (v *SendMessageToTargetParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget5(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget4(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *SendMessageToTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *SendMessageToTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget5(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget4(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget6(in *jlexer.Lexer, out *RemoteLocation) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget5(in *jlexer.Lexer, out *RemoteLocation) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -540,7 +441,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget6(in *jlexer.Lexer, out
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget6(out *jwriter.Writer, in RemoteLocation) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget5(out *jwriter.Writer, in RemoteLocation) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -566,24 +467,123 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget6(out *jwriter.Writer, i
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v RemoteLocation) MarshalJSON() ([]byte, error) {
|
func (v RemoteLocation) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget6(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget5(&w, v)
|
||||||
return w.Buffer.BuildBytes(), w.Error
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
func (v RemoteLocation) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v RemoteLocation) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget6(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget5(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *RemoteLocation) UnmarshalJSON(data []byte) error {
|
func (v *RemoteLocation) UnmarshalJSON(data []byte) error {
|
||||||
|
r := jlexer.Lexer{Data: data}
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget5(&r, v)
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
|
func (v *RemoteLocation) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget5(l, v)
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget6(in *jlexer.Lexer, out *Info) {
|
||||||
|
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 "targetId":
|
||||||
|
out.TargetID = ID(in.String())
|
||||||
|
case "type":
|
||||||
|
out.Type = string(in.String())
|
||||||
|
case "title":
|
||||||
|
out.Title = string(in.String())
|
||||||
|
case "url":
|
||||||
|
out.URL = string(in.String())
|
||||||
|
default:
|
||||||
|
in.SkipRecursive()
|
||||||
|
}
|
||||||
|
in.WantComma()
|
||||||
|
}
|
||||||
|
in.Delim('}')
|
||||||
|
if isTopLevel {
|
||||||
|
in.Consumed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget6(out *jwriter.Writer, in Info) {
|
||||||
|
out.RawByte('{')
|
||||||
|
first := true
|
||||||
|
_ = first
|
||||||
|
if in.TargetID != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"targetId\":")
|
||||||
|
out.String(string(in.TargetID))
|
||||||
|
}
|
||||||
|
if in.Type != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"type\":")
|
||||||
|
out.String(string(in.Type))
|
||||||
|
}
|
||||||
|
if in.Title != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"title\":")
|
||||||
|
out.String(string(in.Title))
|
||||||
|
}
|
||||||
|
if in.URL != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"url\":")
|
||||||
|
out.String(string(in.URL))
|
||||||
|
}
|
||||||
|
out.RawByte('}')
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON supports json.Marshaler interface
|
||||||
|
func (v Info) MarshalJSON() ([]byte, error) {
|
||||||
|
w := jwriter.Writer{}
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget6(&w, v)
|
||||||
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
|
func (v Info) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpTarget6(w, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
|
func (v *Info) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget6(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget6(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *RemoteLocation) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *Info) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget6(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget6(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget7(in *jlexer.Lexer, out *GetTargetsReturns) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget7(in *jlexer.Lexer, out *GetTargetsReturns) {
|
||||||
|
@ -612,18 +612,18 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget7(in *jlexer.Lexer, out
|
||||||
} else {
|
} else {
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
if !in.IsDelim(']') {
|
if !in.IsDelim(']') {
|
||||||
out.TargetInfos = make([]*TargetInfo, 0, 8)
|
out.TargetInfos = make([]*Info, 0, 8)
|
||||||
} else {
|
} else {
|
||||||
out.TargetInfos = []*TargetInfo{}
|
out.TargetInfos = []*Info{}
|
||||||
}
|
}
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
var v4 *TargetInfo
|
var v4 *Info
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
in.Skip()
|
in.Skip()
|
||||||
v4 = nil
|
v4 = nil
|
||||||
} else {
|
} else {
|
||||||
if v4 == nil {
|
if v4 == nil {
|
||||||
v4 = new(TargetInfo)
|
v4 = new(Info)
|
||||||
}
|
}
|
||||||
(*v4).UnmarshalEasyJSON(in)
|
(*v4).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
@ -779,7 +779,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget9(in *jlexer.Lexer, out
|
||||||
out.TargetInfo = nil
|
out.TargetInfo = nil
|
||||||
} else {
|
} else {
|
||||||
if out.TargetInfo == nil {
|
if out.TargetInfo == nil {
|
||||||
out.TargetInfo = new(TargetInfo)
|
out.TargetInfo = new(Info)
|
||||||
}
|
}
|
||||||
(*out.TargetInfo).UnmarshalEasyJSON(in)
|
(*out.TargetInfo).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
@ -855,7 +855,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget10(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -922,7 +922,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget11(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -996,7 +996,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget12(in *jlexer.Lexer, out
|
||||||
out.TargetInfo = nil
|
out.TargetInfo = nil
|
||||||
} else {
|
} else {
|
||||||
if out.TargetInfo == nil {
|
if out.TargetInfo == nil {
|
||||||
out.TargetInfo = new(TargetInfo)
|
out.TargetInfo = new(Info)
|
||||||
}
|
}
|
||||||
(*out.TargetInfo).UnmarshalEasyJSON(in)
|
(*out.TargetInfo).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
@ -1072,7 +1072,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget13(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
case "message":
|
case "message":
|
||||||
out.Message = string(in.String())
|
out.Message = string(in.String())
|
||||||
default:
|
default:
|
||||||
|
@ -1151,7 +1151,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget14(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -1225,7 +1225,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget15(in *jlexer.Lexer, out
|
||||||
out.TargetInfo = nil
|
out.TargetInfo = nil
|
||||||
} else {
|
} else {
|
||||||
if out.TargetInfo == nil {
|
if out.TargetInfo == nil {
|
||||||
out.TargetInfo = new(TargetInfo)
|
out.TargetInfo = new(Info)
|
||||||
}
|
}
|
||||||
(*out.TargetInfo).UnmarshalEasyJSON(in)
|
(*out.TargetInfo).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
@ -1447,7 +1447,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget18(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -1514,7 +1514,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget19(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -1877,7 +1877,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget24(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -2013,7 +2013,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget26(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -2080,7 +2080,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpTarget27(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "targetId":
|
case "targetId":
|
||||||
out.TargetID = TargetID(in.String())
|
out.TargetID = ID(in.String())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,64 +3,44 @@ package target
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventTargetCreated issued when a possible inspection target is created.
|
// EventTargetCreated issued when a possible inspection target is created.
|
||||||
type EventTargetCreated struct {
|
type EventTargetCreated struct {
|
||||||
TargetInfo *TargetInfo `json:"targetInfo,omitempty"`
|
TargetInfo *Info `json:"targetInfo,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTargetDestroyed issued when a target is destroyed.
|
// EventTargetDestroyed issued when a target is destroyed.
|
||||||
type EventTargetDestroyed struct {
|
type EventTargetDestroyed struct {
|
||||||
TargetID TargetID `json:"targetId,omitempty"`
|
TargetID ID `json:"targetId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventAttachedToTarget issued when attached to target because of
|
// EventAttachedToTarget issued when attached to target because of
|
||||||
// auto-attach or attachToTarget command.
|
// auto-attach or attachToTarget command.
|
||||||
type EventAttachedToTarget struct {
|
type EventAttachedToTarget struct {
|
||||||
TargetInfo *TargetInfo `json:"targetInfo,omitempty"`
|
TargetInfo *Info `json:"targetInfo,omitempty"`
|
||||||
WaitingForDebugger bool `json:"waitingForDebugger,omitempty"`
|
WaitingForDebugger bool `json:"waitingForDebugger,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventDetachedFromTarget issued when detached from target for any reason
|
// EventDetachedFromTarget issued when detached from target for any reason
|
||||||
// (including detachFromTarget command).
|
// (including detachFromTarget command).
|
||||||
type EventDetachedFromTarget struct {
|
type EventDetachedFromTarget struct {
|
||||||
TargetID TargetID `json:"targetId,omitempty"`
|
TargetID ID `json:"targetId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventReceivedMessageFromTarget notifies about new protocol message from
|
// EventReceivedMessageFromTarget notifies about new protocol message from
|
||||||
// attached target.
|
// attached target.
|
||||||
type EventReceivedMessageFromTarget struct {
|
type EventReceivedMessageFromTarget struct {
|
||||||
TargetID TargetID `json:"targetId,omitempty"`
|
TargetID ID `json:"targetId,omitempty"`
|
||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventTargetTargetCreated,
|
cdp.EventTargetTargetCreated,
|
||||||
EventTargetTargetDestroyed,
|
cdp.EventTargetTargetDestroyed,
|
||||||
EventTargetAttachedToTarget,
|
cdp.EventTargetAttachedToTarget,
|
||||||
EventTargetDetachedFromTarget,
|
cdp.EventTargetDetachedFromTarget,
|
||||||
EventTargetReceivedMessageFromTarget,
|
cdp.EventTargetReceivedMessageFromTarget,
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,30 +11,10 @@ package target
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// SetDiscoverTargetsParams controls whether to discover available targets
|
// SetDiscoverTargetsParams controls whether to discover available targets
|
||||||
// and notify via targetCreated/targetDestroyed events.
|
// and notify via targetCreated/targetDestroyed events.
|
||||||
type SetDiscoverTargetsParams struct {
|
type SetDiscoverTargetsParams struct {
|
||||||
|
@ -53,7 +33,7 @@ func SetDiscoverTargets(discover bool) *SetDiscoverTargetsParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.setDiscoverTargets.
|
// Do executes Target.setDiscoverTargets.
|
||||||
func (p *SetDiscoverTargetsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetDiscoverTargetsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -65,13 +45,13 @@ func (p *SetDiscoverTargetsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetSetDiscoverTargets, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetSetDiscoverTargets, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -83,10 +63,10 @@ func (p *SetDiscoverTargetsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetAutoAttachParams controls whether to automatically attach to new
|
// SetAutoAttachParams controls whether to automatically attach to new
|
||||||
|
@ -114,7 +94,7 @@ func SetAutoAttach(autoAttach bool, waitForDebuggerOnStart bool) *SetAutoAttachP
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.setAutoAttach.
|
// Do executes Target.setAutoAttach.
|
||||||
func (p *SetAutoAttachParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetAutoAttachParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -126,13 +106,13 @@ func (p *SetAutoAttachParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetSetAutoAttach, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetSetAutoAttach, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -144,16 +124,19 @@ func (p *SetAutoAttachParams) Do(ctxt context.Context, h FrameHandler) (err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetAttachToFramesParams [no description].
|
||||||
type SetAttachToFramesParams struct {
|
type SetAttachToFramesParams struct {
|
||||||
Value bool `json:"value"` // Whether to attach to frames.
|
Value bool `json:"value"` // Whether to attach to frames.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetAttachToFrames [no description].
|
||||||
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// value - Whether to attach to frames.
|
// value - Whether to attach to frames.
|
||||||
func SetAttachToFrames(value bool) *SetAttachToFramesParams {
|
func SetAttachToFrames(value bool) *SetAttachToFramesParams {
|
||||||
|
@ -163,7 +146,7 @@ func SetAttachToFrames(value bool) *SetAttachToFramesParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.setAttachToFrames.
|
// Do executes Target.setAttachToFrames.
|
||||||
func (p *SetAttachToFramesParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetAttachToFramesParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -175,13 +158,13 @@ func (p *SetAttachToFramesParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetSetAttachToFrames, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetSetAttachToFrames, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -193,10 +176,10 @@ func (p *SetAttachToFramesParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetRemoteLocationsParams enables target discovery for the specified
|
// SetRemoteLocationsParams enables target discovery for the specified
|
||||||
|
@ -217,7 +200,7 @@ func SetRemoteLocations(locations []*RemoteLocation) *SetRemoteLocationsParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.setRemoteLocations.
|
// Do executes Target.setRemoteLocations.
|
||||||
func (p *SetRemoteLocationsParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SetRemoteLocationsParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -229,13 +212,13 @@ func (p *SetRemoteLocationsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetSetRemoteLocations, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetSetRemoteLocations, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -247,10 +230,10 @@ func (p *SetRemoteLocationsParams) Do(ctxt context.Context, h FrameHandler) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendMessageToTargetParams sends protocol message to the target with given
|
// SendMessageToTargetParams sends protocol message to the target with given
|
||||||
|
@ -263,17 +246,17 @@ type SendMessageToTargetParams struct {
|
||||||
// SendMessageToTarget sends protocol message to the target with given id.
|
// SendMessageToTarget sends protocol message to the target with given id.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// targetId
|
// targetID
|
||||||
// message
|
// message
|
||||||
func SendMessageToTarget(targetId string, message string) *SendMessageToTargetParams {
|
func SendMessageToTarget(targetID string, message string) *SendMessageToTargetParams {
|
||||||
return &SendMessageToTargetParams{
|
return &SendMessageToTargetParams{
|
||||||
TargetID: targetId,
|
TargetID: targetID,
|
||||||
Message: message,
|
Message: message,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.sendMessageToTarget.
|
// Do executes Target.sendMessageToTarget.
|
||||||
func (p *SendMessageToTargetParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *SendMessageToTargetParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -285,13 +268,13 @@ func (p *SendMessageToTargetParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetSendMessageToTarget, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetSendMessageToTarget, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -303,37 +286,37 @@ func (p *SendMessageToTargetParams) Do(ctxt context.Context, h FrameHandler) (er
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTargetInfoParams returns information about a target.
|
// GetTargetInfoParams returns information about a target.
|
||||||
type GetTargetInfoParams struct {
|
type GetTargetInfoParams struct {
|
||||||
TargetID TargetID `json:"targetId"`
|
TargetID ID `json:"targetId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTargetInfo returns information about a target.
|
// GetTargetInfo returns information about a target.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// targetId
|
// targetID
|
||||||
func GetTargetInfo(targetId TargetID) *GetTargetInfoParams {
|
func GetTargetInfo(targetID ID) *GetTargetInfoParams {
|
||||||
return &GetTargetInfoParams{
|
return &GetTargetInfoParams{
|
||||||
TargetID: targetId,
|
TargetID: targetID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTargetInfoReturns return values.
|
// GetTargetInfoReturns return values.
|
||||||
type GetTargetInfoReturns struct {
|
type GetTargetInfoReturns struct {
|
||||||
TargetInfo *TargetInfo `json:"targetInfo,omitempty"`
|
TargetInfo *Info `json:"targetInfo,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.getTargetInfo.
|
// Do executes Target.getTargetInfo.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// targetInfo
|
// targetInfo
|
||||||
func (p *GetTargetInfoParams) Do(ctxt context.Context, h FrameHandler) (targetInfo *TargetInfo, err error) {
|
func (p *GetTargetInfoParams) Do(ctxt context.Context, h cdp.FrameHandler) (targetInfo *Info, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -345,13 +328,13 @@ func (p *GetTargetInfoParams) Do(ctxt context.Context, h FrameHandler) (targetIn
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetGetTargetInfo, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetGetTargetInfo, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -360,7 +343,7 @@ func (p *GetTargetInfoParams) Do(ctxt context.Context, h FrameHandler) (targetIn
|
||||||
var r GetTargetInfoReturns
|
var r GetTargetInfoReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.TargetInfo, nil
|
return r.TargetInfo, nil
|
||||||
|
@ -370,29 +353,29 @@ func (p *GetTargetInfoParams) Do(ctxt context.Context, h FrameHandler) (targetIn
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// ActivateTargetParams activates (focuses) the target.
|
// ActivateTargetParams activates (focuses) the target.
|
||||||
type ActivateTargetParams struct {
|
type ActivateTargetParams struct {
|
||||||
TargetID TargetID `json:"targetId"`
|
TargetID ID `json:"targetId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ActivateTarget activates (focuses) the target.
|
// ActivateTarget activates (focuses) the target.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// targetId
|
// targetID
|
||||||
func ActivateTarget(targetId TargetID) *ActivateTargetParams {
|
func ActivateTarget(targetID ID) *ActivateTargetParams {
|
||||||
return &ActivateTargetParams{
|
return &ActivateTargetParams{
|
||||||
TargetID: targetId,
|
TargetID: targetID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.activateTarget.
|
// Do executes Target.activateTarget.
|
||||||
func (p *ActivateTargetParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *ActivateTargetParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -404,13 +387,13 @@ func (p *ActivateTargetParams) Do(ctxt context.Context, h FrameHandler) (err err
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetActivateTarget, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetActivateTarget, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -422,26 +405,26 @@ func (p *ActivateTargetParams) Do(ctxt context.Context, h FrameHandler) (err err
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloseTargetParams closes the target. If the target is a page that gets
|
// CloseTargetParams closes the target. If the target is a page that gets
|
||||||
// closed too.
|
// closed too.
|
||||||
type CloseTargetParams struct {
|
type CloseTargetParams struct {
|
||||||
TargetID TargetID `json:"targetId"`
|
TargetID ID `json:"targetId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloseTarget closes the target. If the target is a page that gets closed
|
// CloseTarget closes the target. If the target is a page that gets closed
|
||||||
// too.
|
// too.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// targetId
|
// targetID
|
||||||
func CloseTarget(targetId TargetID) *CloseTargetParams {
|
func CloseTarget(targetID ID) *CloseTargetParams {
|
||||||
return &CloseTargetParams{
|
return &CloseTargetParams{
|
||||||
TargetID: targetId,
|
TargetID: targetID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,7 +437,7 @@ type CloseTargetReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// success
|
// success
|
||||||
func (p *CloseTargetParams) Do(ctxt context.Context, h FrameHandler) (success bool, err error) {
|
func (p *CloseTargetParams) Do(ctxt context.Context, h cdp.FrameHandler) (success bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -466,13 +449,13 @@ func (p *CloseTargetParams) Do(ctxt context.Context, h FrameHandler) (success bo
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetCloseTarget, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetCloseTarget, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -481,7 +464,7 @@ func (p *CloseTargetParams) Do(ctxt context.Context, h FrameHandler) (success bo
|
||||||
var r CloseTargetReturns
|
var r CloseTargetReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Success, nil
|
return r.Success, nil
|
||||||
|
@ -491,24 +474,24 @@ func (p *CloseTargetParams) Do(ctxt context.Context, h FrameHandler) (success bo
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// AttachToTargetParams attaches to the target with given id.
|
// AttachToTargetParams attaches to the target with given id.
|
||||||
type AttachToTargetParams struct {
|
type AttachToTargetParams struct {
|
||||||
TargetID TargetID `json:"targetId"`
|
TargetID ID `json:"targetId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AttachToTarget attaches to the target with given id.
|
// AttachToTarget attaches to the target with given id.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// targetId
|
// targetID
|
||||||
func AttachToTarget(targetId TargetID) *AttachToTargetParams {
|
func AttachToTarget(targetID ID) *AttachToTargetParams {
|
||||||
return &AttachToTargetParams{
|
return &AttachToTargetParams{
|
||||||
TargetID: targetId,
|
TargetID: targetID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +504,7 @@ type AttachToTargetReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// success - Whether attach succeeded.
|
// success - Whether attach succeeded.
|
||||||
func (p *AttachToTargetParams) Do(ctxt context.Context, h FrameHandler) (success bool, err error) {
|
func (p *AttachToTargetParams) Do(ctxt context.Context, h cdp.FrameHandler) (success bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -533,13 +516,13 @@ func (p *AttachToTargetParams) Do(ctxt context.Context, h FrameHandler) (success
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetAttachToTarget, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetAttachToTarget, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -548,7 +531,7 @@ func (p *AttachToTargetParams) Do(ctxt context.Context, h FrameHandler) (success
|
||||||
var r AttachToTargetReturns
|
var r AttachToTargetReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Success, nil
|
return r.Success, nil
|
||||||
|
@ -558,29 +541,29 @@ func (p *AttachToTargetParams) Do(ctxt context.Context, h FrameHandler) (success
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DetachFromTargetParams detaches from the target with given id.
|
// DetachFromTargetParams detaches from the target with given id.
|
||||||
type DetachFromTargetParams struct {
|
type DetachFromTargetParams struct {
|
||||||
TargetID TargetID `json:"targetId"`
|
TargetID ID `json:"targetId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DetachFromTarget detaches from the target with given id.
|
// DetachFromTarget detaches from the target with given id.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// targetId
|
// targetID
|
||||||
func DetachFromTarget(targetId TargetID) *DetachFromTargetParams {
|
func DetachFromTarget(targetID ID) *DetachFromTargetParams {
|
||||||
return &DetachFromTargetParams{
|
return &DetachFromTargetParams{
|
||||||
TargetID: targetId,
|
TargetID: targetID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.detachFromTarget.
|
// Do executes Target.detachFromTarget.
|
||||||
func (p *DetachFromTargetParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *DetachFromTargetParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -592,13 +575,13 @@ func (p *DetachFromTargetParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetDetachFromTarget, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetDetachFromTarget, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -610,10 +593,10 @@ func (p *DetachFromTargetParams) Do(ctxt context.Context, h FrameHandler) (err e
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateBrowserContextParams creates a new empty BrowserContext. Similar to
|
// CreateBrowserContextParams creates a new empty BrowserContext. Similar to
|
||||||
|
@ -634,20 +617,20 @@ type CreateBrowserContextReturns struct {
|
||||||
// Do executes Target.createBrowserContext.
|
// Do executes Target.createBrowserContext.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// browserContextId - The id of the context created.
|
// browserContextID - The id of the context created.
|
||||||
func (p *CreateBrowserContextParams) Do(ctxt context.Context, h FrameHandler) (browserContextId BrowserContextID, err error) {
|
func (p *CreateBrowserContextParams) Do(ctxt context.Context, h cdp.FrameHandler) (browserContextID BrowserContextID, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetCreateBrowserContext, Empty)
|
ch := h.Execute(ctxt, cdp.CommandTargetCreateBrowserContext, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", ErrChannelClosed
|
return "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -656,7 +639,7 @@ func (p *CreateBrowserContextParams) Do(ctxt context.Context, h FrameHandler) (b
|
||||||
var r CreateBrowserContextReturns
|
var r CreateBrowserContextReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", ErrInvalidResult
|
return "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.BrowserContextID, nil
|
return r.BrowserContextID, nil
|
||||||
|
@ -666,10 +649,10 @@ func (p *CreateBrowserContextParams) Do(ctxt context.Context, h FrameHandler) (b
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", ErrUnknownResult
|
return "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisposeBrowserContextParams deletes a BrowserContext, will fail of any
|
// DisposeBrowserContextParams deletes a BrowserContext, will fail of any
|
||||||
|
@ -682,10 +665,10 @@ type DisposeBrowserContextParams struct {
|
||||||
// uses it.
|
// uses it.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// browserContextId
|
// browserContextID
|
||||||
func DisposeBrowserContext(browserContextId BrowserContextID) *DisposeBrowserContextParams {
|
func DisposeBrowserContext(browserContextID BrowserContextID) *DisposeBrowserContextParams {
|
||||||
return &DisposeBrowserContextParams{
|
return &DisposeBrowserContextParams{
|
||||||
BrowserContextID: browserContextId,
|
BrowserContextID: browserContextID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,7 +681,7 @@ type DisposeBrowserContextReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// success
|
// success
|
||||||
func (p *DisposeBrowserContextParams) Do(ctxt context.Context, h FrameHandler) (success bool, err error) {
|
func (p *DisposeBrowserContextParams) Do(ctxt context.Context, h cdp.FrameHandler) (success bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -710,13 +693,13 @@ func (p *DisposeBrowserContextParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetDisposeBrowserContext, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetDisposeBrowserContext, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return false, ErrChannelClosed
|
return false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -725,7 +708,7 @@ func (p *DisposeBrowserContextParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
var r DisposeBrowserContextReturns
|
var r DisposeBrowserContextReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, ErrInvalidResult
|
return false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Success, nil
|
return r.Success, nil
|
||||||
|
@ -735,10 +718,10 @@ func (p *DisposeBrowserContextParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return false, ErrContextDone
|
return false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, ErrUnknownResult
|
return false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTargetParams creates a new page.
|
// CreateTargetParams creates a new page.
|
||||||
|
@ -773,21 +756,21 @@ func (p CreateTargetParams) WithHeight(height int64) *CreateTargetParams {
|
||||||
|
|
||||||
// WithBrowserContextID the browser context to create the page in (headless
|
// WithBrowserContextID the browser context to create the page in (headless
|
||||||
// chrome only).
|
// chrome only).
|
||||||
func (p CreateTargetParams) WithBrowserContextID(browserContextId BrowserContextID) *CreateTargetParams {
|
func (p CreateTargetParams) WithBrowserContextID(browserContextID BrowserContextID) *CreateTargetParams {
|
||||||
p.BrowserContextID = browserContextId
|
p.BrowserContextID = browserContextID
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTargetReturns return values.
|
// CreateTargetReturns return values.
|
||||||
type CreateTargetReturns struct {
|
type CreateTargetReturns struct {
|
||||||
TargetID TargetID `json:"targetId,omitempty"` // The id of the page opened.
|
TargetID ID `json:"targetId,omitempty"` // The id of the page opened.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.createTarget.
|
// Do executes Target.createTarget.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// targetId - The id of the page opened.
|
// targetID - The id of the page opened.
|
||||||
func (p *CreateTargetParams) Do(ctxt context.Context, h FrameHandler) (targetId TargetID, err error) {
|
func (p *CreateTargetParams) Do(ctxt context.Context, h cdp.FrameHandler) (targetID ID, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -799,13 +782,13 @@ func (p *CreateTargetParams) Do(ctxt context.Context, h FrameHandler) (targetId
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetCreateTarget, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTargetCreateTarget, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", ErrChannelClosed
|
return "", cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -814,7 +797,7 @@ func (p *CreateTargetParams) Do(ctxt context.Context, h FrameHandler) (targetId
|
||||||
var r CreateTargetReturns
|
var r CreateTargetReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", ErrInvalidResult
|
return "", cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.TargetID, nil
|
return r.TargetID, nil
|
||||||
|
@ -824,10 +807,10 @@ func (p *CreateTargetParams) Do(ctxt context.Context, h FrameHandler) (targetId
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", ErrUnknownResult
|
return "", cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTargetsParams retrieves a list of available targets.
|
// GetTargetsParams retrieves a list of available targets.
|
||||||
|
@ -840,26 +823,26 @@ func GetTargets() *GetTargetsParams {
|
||||||
|
|
||||||
// GetTargetsReturns return values.
|
// GetTargetsReturns return values.
|
||||||
type GetTargetsReturns struct {
|
type GetTargetsReturns struct {
|
||||||
TargetInfos []*TargetInfo `json:"targetInfos,omitempty"` // The list of targets.
|
TargetInfos []*Info `json:"targetInfos,omitempty"` // The list of targets.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Target.getTargets.
|
// Do executes Target.getTargets.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// targetInfos - The list of targets.
|
// targetInfos - The list of targets.
|
||||||
func (p *GetTargetsParams) Do(ctxt context.Context, h FrameHandler) (targetInfos []*TargetInfo, err error) {
|
func (p *GetTargetsParams) Do(ctxt context.Context, h cdp.FrameHandler) (targetInfos []*Info, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTargetGetTargets, Empty)
|
ch := h.Execute(ctxt, cdp.CommandTargetGetTargets, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -868,7 +851,7 @@ func (p *GetTargetsParams) Do(ctxt context.Context, h FrameHandler) (targetInfos
|
||||||
var r GetTargetsReturns
|
var r GetTargetsReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.TargetInfos, nil
|
return r.TargetInfos, nil
|
||||||
|
@ -878,8 +861,8 @@ func (p *GetTargetsParams) Do(ctxt context.Context, h FrameHandler) (targetInfos
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,37 +2,15 @@ package target
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
// ID [no description].
|
||||||
. "github.com/knq/chromedp/cdp"
|
type ID string
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
// String returns the ID as string value.
|
||||||
_ BackendNode
|
func (t ID) String() string {
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
type TargetID string
|
|
||||||
|
|
||||||
// String returns the TargetID as string value.
|
|
||||||
func (t TargetID) String() string {
|
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BrowserContextID [no description].
|
||||||
type BrowserContextID string
|
type BrowserContextID string
|
||||||
|
|
||||||
// String returns the BrowserContextID as string value.
|
// String returns the BrowserContextID as string value.
|
||||||
|
@ -40,13 +18,15 @@ func (t BrowserContextID) String() string {
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TargetInfo struct {
|
// Info [no description].
|
||||||
TargetID TargetID `json:"targetId,omitempty"`
|
type Info struct {
|
||||||
Type string `json:"type,omitempty"`
|
TargetID ID `json:"targetId,omitempty"`
|
||||||
Title string `json:"title,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
URL string `json:"url,omitempty"`
|
Title string `json:"title,omitempty"`
|
||||||
|
URL string `json:"url,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoteLocation [no description].
|
||||||
type RemoteLocation struct {
|
type RemoteLocation struct {
|
||||||
Host string `json:"host,omitempty"`
|
Host string `json:"host,omitempty"`
|
||||||
Port int64 `json:"port,omitempty"`
|
Port int64 `json:"port,omitempty"`
|
||||||
|
|
|
@ -3,27 +3,7 @@ package tethering
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventAccepted informs that port was successfully bound and got a specified
|
// EventAccepted informs that port was successfully bound and got a specified
|
||||||
|
@ -33,7 +13,7 @@ type EventAccepted struct {
|
||||||
ConnectionID string `json:"connectionId,omitempty"` // Connection id to be used.
|
ConnectionID string `json:"connectionId,omitempty"` // Connection id to be used.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventTetheringAccepted,
|
cdp.EventTetheringAccepted,
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,30 +11,10 @@ package tethering
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// BindParams request browser port binding.
|
// BindParams request browser port binding.
|
||||||
type BindParams struct {
|
type BindParams struct {
|
||||||
Port int64 `json:"port"` // Port number to bind.
|
Port int64 `json:"port"` // Port number to bind.
|
||||||
|
@ -51,7 +31,7 @@ func Bind(port int64) *BindParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Tethering.bind.
|
// Do executes Tethering.bind.
|
||||||
func (p *BindParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *BindParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -63,13 +43,13 @@ func (p *BindParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTetheringBind, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTetheringBind, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -81,10 +61,10 @@ func (p *BindParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnbindParams request browser port unbinding.
|
// UnbindParams request browser port unbinding.
|
||||||
|
@ -103,7 +83,7 @@ func Unbind(port int64) *UnbindParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Tethering.unbind.
|
// Do executes Tethering.unbind.
|
||||||
func (p *UnbindParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *UnbindParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -115,13 +95,13 @@ func (p *UnbindParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTetheringUnbind, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTetheringUnbind, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -133,8 +113,8 @@ func (p *UnbindParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,31 +3,11 @@ package tracing
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/cdp/io"
|
"github.com/knq/chromedp/cdp/io"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// EventDataCollected contains an bucket of collected trace events. When
|
// EventDataCollected contains an bucket of collected trace events. When
|
||||||
// tracing is stopped collected events will be send as a sequence of
|
// tracing is stopped collected events will be send as a sequence of
|
||||||
// dataCollected events followed by tracingComplete event.
|
// dataCollected events followed by tracingComplete event.
|
||||||
|
@ -41,15 +21,16 @@ type EventTracingComplete struct {
|
||||||
Stream io.StreamHandle `json:"stream,omitempty"` // A handle of the stream that holds resulting trace data.
|
Stream io.StreamHandle `json:"stream,omitempty"` // A handle of the stream that holds resulting trace data.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventBufferUsage [no description].
|
||||||
type EventBufferUsage struct {
|
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.
|
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.
|
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.
|
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.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventTypes is all event types in the domain.
|
// EventTypes all event types in the domain.
|
||||||
var EventTypes = []MethodType{
|
var EventTypes = []cdp.MethodType{
|
||||||
EventTracingDataCollected,
|
cdp.EventTracingDataCollected,
|
||||||
EventTracingTracingComplete,
|
cdp.EventTracingTracingComplete,
|
||||||
EventTracingBufferUsage,
|
cdp.EventTracingBufferUsage,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,30 +9,10 @@ package tracing
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
cdp "github.com/knq/chromedp/cdp"
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// StartParams start trace events collection.
|
// StartParams start trace events collection.
|
||||||
type StartParams struct {
|
type StartParams struct {
|
||||||
BufferUsageReportingInterval float64 `json:"bufferUsageReportingInterval,omitempty"` // If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
|
BufferUsageReportingInterval float64 `json:"bufferUsageReportingInterval,omitempty"` // If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
|
||||||
|
@ -61,13 +41,14 @@ func (p StartParams) WithTransferMode(transferMode TransferMode) *StartParams {
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithTraceConfig [no description].
|
||||||
func (p StartParams) WithTraceConfig(traceConfig *TraceConfig) *StartParams {
|
func (p StartParams) WithTraceConfig(traceConfig *TraceConfig) *StartParams {
|
||||||
p.TraceConfig = traceConfig
|
p.TraceConfig = traceConfig
|
||||||
return &p
|
return &p
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Tracing.start.
|
// Do executes Tracing.start.
|
||||||
func (p *StartParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *StartParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -79,13 +60,13 @@ func (p *StartParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTracingStart, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTracingStart, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -97,10 +78,10 @@ func (p *StartParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// EndParams stop trace events collection.
|
// EndParams stop trace events collection.
|
||||||
|
@ -112,19 +93,19 @@ func End() *EndParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Tracing.end.
|
// Do executes Tracing.end.
|
||||||
func (p *EndParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *EndParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTracingEnd, Empty)
|
ch := h.Execute(ctxt, cdp.CommandTracingEnd, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -136,10 +117,10 @@ func (p *EndParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCategoriesParams gets supported tracing categories.
|
// GetCategoriesParams gets supported tracing categories.
|
||||||
|
@ -159,19 +140,19 @@ type GetCategoriesReturns struct {
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// categories - A list of supported tracing categories.
|
// categories - A list of supported tracing categories.
|
||||||
func (p *GetCategoriesParams) Do(ctxt context.Context, h FrameHandler) (categories []string, err error) {
|
func (p *GetCategoriesParams) Do(ctxt context.Context, h cdp.FrameHandler) (categories []string, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTracingGetCategories, Empty)
|
ch := h.Execute(ctxt, cdp.CommandTracingGetCategories, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, ErrChannelClosed
|
return nil, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -180,7 +161,7 @@ func (p *GetCategoriesParams) Do(ctxt context.Context, h FrameHandler) (categori
|
||||||
var r GetCategoriesReturns
|
var r GetCategoriesReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidResult
|
return nil, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Categories, nil
|
return r.Categories, nil
|
||||||
|
@ -190,10 +171,10 @@ func (p *GetCategoriesParams) Do(ctxt context.Context, h FrameHandler) (categori
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrUnknownResult
|
return nil, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestMemoryDumpParams request a global memory dump.
|
// RequestMemoryDumpParams request a global memory dump.
|
||||||
|
@ -213,21 +194,21 @@ type RequestMemoryDumpReturns struct {
|
||||||
// Do executes Tracing.requestMemoryDump.
|
// Do executes Tracing.requestMemoryDump.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// dumpGuid - GUID of the resulting global memory dump.
|
// dumpGUID - GUID of the resulting global memory dump.
|
||||||
// success - True iff the global memory dump succeeded.
|
// success - True iff the global memory dump succeeded.
|
||||||
func (p *RequestMemoryDumpParams) Do(ctxt context.Context, h FrameHandler) (dumpGuid string, success bool, err error) {
|
func (p *RequestMemoryDumpParams) Do(ctxt context.Context, h cdp.FrameHandler) (dumpGUID string, success bool, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTracingRequestMemoryDump, Empty)
|
ch := h.Execute(ctxt, cdp.CommandTracingRequestMemoryDump, cdp.Empty)
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return "", false, ErrChannelClosed
|
return "", false, cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -236,7 +217,7 @@ func (p *RequestMemoryDumpParams) Do(ctxt context.Context, h FrameHandler) (dump
|
||||||
var r RequestMemoryDumpReturns
|
var r RequestMemoryDumpReturns
|
||||||
err = easyjson.Unmarshal(v, &r)
|
err = easyjson.Unmarshal(v, &r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", false, ErrInvalidResult
|
return "", false, cdp.ErrInvalidResult
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.DumpGUID, r.Success, nil
|
return r.DumpGUID, r.Success, nil
|
||||||
|
@ -246,10 +227,10 @@ func (p *RequestMemoryDumpParams) Do(ctxt context.Context, h FrameHandler) (dump
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", false, ErrContextDone
|
return "", false, cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", false, ErrUnknownResult
|
return "", false, cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecordClockSyncMarkerParams record a clock sync marker in the trace.
|
// RecordClockSyncMarkerParams record a clock sync marker in the trace.
|
||||||
|
@ -260,15 +241,15 @@ type RecordClockSyncMarkerParams struct {
|
||||||
// RecordClockSyncMarker record a clock sync marker in the trace.
|
// RecordClockSyncMarker record a clock sync marker in the trace.
|
||||||
//
|
//
|
||||||
// parameters:
|
// parameters:
|
||||||
// syncId - The ID of this clock sync marker
|
// syncID - The ID of this clock sync marker
|
||||||
func RecordClockSyncMarker(syncId string) *RecordClockSyncMarkerParams {
|
func RecordClockSyncMarker(syncID string) *RecordClockSyncMarkerParams {
|
||||||
return &RecordClockSyncMarkerParams{
|
return &RecordClockSyncMarkerParams{
|
||||||
SyncID: syncId,
|
SyncID: syncID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Tracing.recordClockSyncMarker.
|
// Do executes Tracing.recordClockSyncMarker.
|
||||||
func (p *RecordClockSyncMarkerParams) Do(ctxt context.Context, h FrameHandler) (err error) {
|
func (p *RecordClockSyncMarkerParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
@ -280,13 +261,13 @@ func (p *RecordClockSyncMarkerParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, CommandTracingRecordClockSyncMarker, easyjson.RawMessage(buf))
|
ch := h.Execute(ctxt, cdp.CommandTracingRecordClockSyncMarker, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
case res := <-ch:
|
case res := <-ch:
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return ErrChannelClosed
|
return cdp.ErrChannelClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
switch v := res.(type) {
|
switch v := res.(type) {
|
||||||
|
@ -298,8 +279,8 @@ func (p *RecordClockSyncMarkerParams) Do(ctxt context.Context, h FrameHandler) (
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return ErrContextDone
|
return cdp.ErrContextDone
|
||||||
}
|
}
|
||||||
|
|
||||||
return ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,20 @@
|
||||||
package tracing
|
package tracing
|
||||||
|
|
||||||
// AUTOGENERATED. DO NOT EDIT.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
// AUTOGENERATED. DO NOT EDIT.
|
||||||
_ BackendNode
|
|
||||||
_ BackendNodeID
|
|
||||||
_ ComputedProperty
|
|
||||||
_ ErrorType
|
|
||||||
_ Frame
|
|
||||||
_ FrameID
|
|
||||||
_ LoaderID
|
|
||||||
_ Message
|
|
||||||
_ MessageError
|
|
||||||
_ MethodType
|
|
||||||
_ Node
|
|
||||||
_ NodeID
|
|
||||||
_ NodeType
|
|
||||||
_ PseudoType
|
|
||||||
_ RGBA
|
|
||||||
_ ShadowRootType
|
|
||||||
_ Timestamp
|
|
||||||
)
|
|
||||||
|
|
||||||
// MemoryDumpConfig configuration for memory dump. Used only when
|
// MemoryDumpConfig configuration for memory dump. Used only when
|
||||||
// "memory-infra" category is enabled.
|
// "memory-infra" category is enabled.
|
||||||
type MemoryDumpConfig struct{}
|
type MemoryDumpConfig struct{}
|
||||||
|
|
||||||
|
// TraceConfig [no description].
|
||||||
type TraceConfig struct {
|
type TraceConfig struct {
|
||||||
RecordMode RecordMode `json:"recordMode,omitempty"` // Controls how the trace buffer stores data.
|
RecordMode RecordMode `json:"recordMode,omitempty"` // Controls how the trace buffer stores data.
|
||||||
EnableSampling bool `json:"enableSampling,omitempty"` // Turns on JavaScript stack sampling.
|
EnableSampling bool `json:"enableSampling,omitempty"` // Turns on JavaScript stack sampling.
|
||||||
|
|
802
cdp/util/util.go
802
cdp/util/util.go
File diff suppressed because it is too large
Load Diff
36
chromedp.go
36
chromedp.go
|
@ -13,7 +13,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cdp"
|
"github.com/knq/chromedp/cdp"
|
||||||
"github.com/knq/chromedp/client"
|
"github.com/knq/chromedp/client"
|
||||||
"github.com/knq/chromedp/runner"
|
"github.com/knq/chromedp/runner"
|
||||||
)
|
)
|
||||||
|
@ -40,10 +40,10 @@ type CDP struct {
|
||||||
watch <-chan client.Target
|
watch <-chan client.Target
|
||||||
|
|
||||||
// cur is the current active target's handler.
|
// cur is the current active target's handler.
|
||||||
cur FrameHandler
|
cur cdp.FrameHandler
|
||||||
|
|
||||||
// handlers is the active handlers.
|
// handlers is the active handlers.
|
||||||
handlers []FrameHandler
|
handlers []cdp.FrameHandler
|
||||||
|
|
||||||
// handlerMap is the map of target IDs to its active handler.
|
// handlerMap is the map of target IDs to its active handler.
|
||||||
handlerMap map[string]int
|
handlerMap map[string]int
|
||||||
|
@ -56,7 +56,7 @@ func New(ctxt context.Context, opts ...Option) (*CDP, error) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
c := &CDP{
|
c := &CDP{
|
||||||
handlers: make([]FrameHandler, 0),
|
handlers: make([]cdp.FrameHandler, 0),
|
||||||
handlerMap: make(map[string]int),
|
handlerMap: make(map[string]int),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ loop:
|
||||||
time.Sleep(DefaultCheckDuration)
|
time.Sleep(DefaultCheckDuration)
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return nil, ErrContextDone
|
return nil, cdp.ErrContextDone
|
||||||
|
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
break loop
|
break loop
|
||||||
|
@ -163,7 +163,7 @@ func (c *CDP) Wait() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown closes all Chrome page handlers.
|
// Shutdown closes all Chrome page handlers.
|
||||||
func (c *CDP) Shutdown(ctxt context.Context, opts ...client.ClientOption) error {
|
func (c *CDP) Shutdown(ctxt context.Context, opts ...client.Option) error {
|
||||||
c.RLock()
|
c.RLock()
|
||||||
defer c.RUnlock()
|
defer c.RUnlock()
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ func (c *CDP) ListTargets() []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetHandlerByIndex retrieves the domains manager for the specified index.
|
// GetHandlerByIndex retrieves the domains manager for the specified index.
|
||||||
func (c *CDP) GetHandlerByIndex(i int) FrameHandler {
|
func (c *CDP) GetHandlerByIndex(i int) cdp.FrameHandler {
|
||||||
c.RLock()
|
c.RLock()
|
||||||
defer c.RUnlock()
|
defer c.RUnlock()
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ func (c *CDP) GetHandlerByIndex(i int) FrameHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetHandlerByID retrieves the domains manager for the specified target ID.
|
// GetHandlerByID retrieves the domains manager for the specified target ID.
|
||||||
func (c *CDP) GetHandlerByID(id string) FrameHandler {
|
func (c *CDP) GetHandlerByID(id string) cdp.FrameHandler {
|
||||||
c.RLock()
|
c.RLock()
|
||||||
defer c.RUnlock()
|
defer c.RUnlock()
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ func (c *CDP) SetHandlerByID(id string) error {
|
||||||
// newTarget creates a new target using supplied context and options, returning
|
// newTarget creates a new target using supplied context and options, returning
|
||||||
// the id of the created target only after the target has been started for
|
// the id of the created target only after the target has been started for
|
||||||
// monitoring.
|
// monitoring.
|
||||||
func (c *CDP) newTarget(ctxt context.Context, opts ...client.ClientOption) (string, error) {
|
func (c *CDP) newTarget(ctxt context.Context, opts ...client.Option) (string, error) {
|
||||||
c.RLock()
|
c.RLock()
|
||||||
cl := c.r.Client(opts...)
|
cl := c.r.Client(opts...)
|
||||||
c.RUnlock()
|
c.RUnlock()
|
||||||
|
@ -267,7 +267,7 @@ loop:
|
||||||
time.Sleep(DefaultCheckDuration)
|
time.Sleep(DefaultCheckDuration)
|
||||||
|
|
||||||
case <-ctxt.Done():
|
case <-ctxt.Done():
|
||||||
return "", ErrContextDone
|
return "", cdp.ErrContextDone
|
||||||
|
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
break loop
|
break loop
|
||||||
|
@ -280,7 +280,7 @@ loop:
|
||||||
// SetTarget is an action that sets the active Chrome handler to the specified
|
// SetTarget is an action that sets the active Chrome handler to the specified
|
||||||
// index i.
|
// index i.
|
||||||
func (c *CDP) SetTarget(i int) Action {
|
func (c *CDP) SetTarget(i int) Action {
|
||||||
return ActionFunc(func(context.Context, FrameHandler) error {
|
return ActionFunc(func(context.Context, cdp.FrameHandler) error {
|
||||||
return c.SetHandler(i)
|
return c.SetHandler(i)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -288,15 +288,15 @@ func (c *CDP) SetTarget(i int) Action {
|
||||||
// SetTargetByID is an action that sets the active Chrome handler to the handler
|
// SetTargetByID is an action that sets the active Chrome handler to the handler
|
||||||
// associated with the specified id.
|
// associated with the specified id.
|
||||||
func (c *CDP) SetTargetByID(id string) Action {
|
func (c *CDP) SetTargetByID(id string) Action {
|
||||||
return ActionFunc(func(context.Context, FrameHandler) error {
|
return ActionFunc(func(context.Context, cdp.FrameHandler) error {
|
||||||
return c.SetHandlerByID(id)
|
return c.SetHandlerByID(id)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTarget is an action that creates a new Chrome target, and sets it as the
|
// NewTarget is an action that creates a new Chrome target, and sets it as the
|
||||||
// active target.
|
// active target.
|
||||||
func (c *CDP) NewTarget(id *string, opts ...client.ClientOption) Action {
|
func (c *CDP) NewTarget(id *string, opts ...client.Option) Action {
|
||||||
return ActionFunc(func(ctxt context.Context, h FrameHandler) error {
|
return ActionFunc(func(ctxt context.Context, h cdp.FrameHandler) error {
|
||||||
n, err := c.newTarget(ctxt, opts...)
|
n, err := c.newTarget(ctxt, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -312,8 +312,8 @@ func (c *CDP) NewTarget(id *string, opts ...client.ClientOption) Action {
|
||||||
|
|
||||||
// NewTargetWithURL creates a new Chrome target, sets it as the active target,
|
// NewTargetWithURL creates a new Chrome target, sets it as the active target,
|
||||||
// and then navigates to the specified url.
|
// and then navigates to the specified url.
|
||||||
func (c *CDP) NewTargetWithURL(urlstr string, id *string, opts ...client.ClientOption) Action {
|
func (c *CDP) NewTargetWithURL(urlstr string, id *string, opts ...client.Option) Action {
|
||||||
return ActionFunc(func(ctxt context.Context, h FrameHandler) error {
|
return ActionFunc(func(ctxt context.Context, h cdp.FrameHandler) error {
|
||||||
n, err := c.newTarget(ctxt, opts...)
|
n, err := c.newTarget(ctxt, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -339,14 +339,14 @@ func (c *CDP) NewTargetWithURL(urlstr string, id *string, opts ...client.ClientO
|
||||||
|
|
||||||
// CloseByIndex closes the Chrome target with specified index i.
|
// CloseByIndex closes the Chrome target with specified index i.
|
||||||
func (c *CDP) CloseByIndex(i int) Action {
|
func (c *CDP) CloseByIndex(i int) Action {
|
||||||
return ActionFunc(func(ctxt context.Context, h FrameHandler) error {
|
return ActionFunc(func(ctxt context.Context, h cdp.FrameHandler) error {
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloseByID closes the Chrome target with the specified id.
|
// CloseByID closes the Chrome target with the specified id.
|
||||||
func (c *CDP) CloseByID(id string) Action {
|
func (c *CDP) CloseByID(id string) Action {
|
||||||
return ActionFunc(func(ctxt context.Context, h FrameHandler) error {
|
return ActionFunc(func(ctxt context.Context, h cdp.FrameHandler) error {
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ type Client struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new Chrome Debugging Protocol client.
|
// New creates a new Chrome Debugging Protocol client.
|
||||||
func New(opts ...ClientOption) *Client {
|
func New(opts ...Option) *Client {
|
||||||
c := &Client{
|
c := &Client{
|
||||||
url: DefaultURL,
|
url: DefaultURL,
|
||||||
check: DefaultWatchInterval,
|
check: DefaultWatchInterval,
|
||||||
|
@ -294,25 +294,25 @@ func (c *Client) WatchPageTargets(ctxt context.Context) <-chan Target {
|
||||||
return ch
|
return ch
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientOption is a Chrome Debugging Protocol client option.
|
// Option is a Chrome Debugging Protocol client option.
|
||||||
type ClientOption func(*Client)
|
type Option func(*Client)
|
||||||
|
|
||||||
// URL is a client option to specify the remote Chrome instance to connect to.
|
// URL is a client option to specify the remote Chrome instance to connect to.
|
||||||
func URL(url string) ClientOption {
|
func URL(url string) Option {
|
||||||
return func(c *Client) {
|
return func(c *Client) {
|
||||||
c.url = url
|
c.url = url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WatchInterval is a client option that specifies the check interval duration.
|
// WatchInterval is a client option that specifies the check interval duration.
|
||||||
func WatchInterval(check time.Duration) ClientOption {
|
func WatchInterval(check time.Duration) Option {
|
||||||
return func(c *Client) {
|
return func(c *Client) {
|
||||||
c.check = check
|
c.check = check
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WatchTimeout is a client option that specifies the watch timeout duration.
|
// WatchTimeout is a client option that specifies the watch timeout duration.
|
||||||
func WatchTimeout(timeout time.Duration) ClientOption {
|
func WatchTimeout(timeout time.Duration) Option {
|
||||||
return func(c *Client) {
|
return func(c *Client) {
|
||||||
c.timeout = timeout
|
c.timeout = timeout
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cmd/chromedp-gen/internal"
|
"github.com/knq/chromedp/cmd/chromedp-gen/internal"
|
||||||
"github.com/knq/chromedp/cmd/chromedp-gen/templates"
|
"github.com/knq/chromedp/cmd/chromedp-gen/templates"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// set the internal types
|
// set the internal types
|
||||||
SetInternalTypes(map[string]bool{
|
internal.SetCDPTypes(map[string]bool{
|
||||||
"CSS.ComputedProperty": true,
|
|
||||||
"DOM.BackendNodeId": true,
|
"DOM.BackendNodeId": true,
|
||||||
"DOM.BackendNode": true,
|
"DOM.BackendNode": true,
|
||||||
"DOM.NodeId": true,
|
"DOM.NodeId": true,
|
||||||
|
@ -33,9 +32,8 @@ func init() {
|
||||||
|
|
||||||
// if the internal type locations change above, these will also need to change:
|
// if the internal type locations change above, these will also need to change:
|
||||||
const (
|
const (
|
||||||
domNodeIDRef = "NodeID"
|
domNodeIDRef = "NodeID"
|
||||||
domNodeRef = "*Node"
|
domNodeRef = "*Node"
|
||||||
cssComputedStylePropertyRef = "*ComputedProperty"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// FixupDomains changes types in the domains, so that the generated code is
|
// FixupDomains changes types in the domains, so that the generated code is
|
||||||
|
@ -58,30 +56,30 @@ const (
|
||||||
// - add special unmarshaler to NodeId, BackendNodeId, FrameId to handle values from older (v1.1) protocol versions. -- NOTE: this might need to be applied to more types, such as network.LoaderId
|
// - add special unmarshaler to NodeId, BackendNodeId, FrameId to handle values from older (v1.1) protocol versions. -- NOTE: this might need to be applied to more types, such as network.LoaderId
|
||||||
// - rename 'Input.GestureSourceType' -> 'Input.GestureType'.
|
// - rename 'Input.GestureSourceType' -> 'Input.GestureType'.
|
||||||
// - rename CSS.CSS* types.
|
// - rename CSS.CSS* types.
|
||||||
func FixupDomains(domains []*Domain) {
|
func FixupDomains(domains []*internal.Domain) {
|
||||||
// method type
|
// method type
|
||||||
methodType := &Type{
|
methodType := &internal.Type{
|
||||||
ID: "MethodType",
|
ID: "MethodType",
|
||||||
Type: TypeString,
|
Type: internal.TypeString,
|
||||||
Description: "Chrome Debugging Protocol method type (ie, event and command names).",
|
Description: "Chrome Debugging Protocol method type (ie, event and command names).",
|
||||||
EnumValueNameMap: make(map[string]string),
|
EnumValueNameMap: make(map[string]string),
|
||||||
Extra: templates.ExtraMethodTypeDomainDecoder(),
|
Extra: templates.ExtraMethodTypeDomainDecoder(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// message error type
|
// message error type
|
||||||
messageErrorType := &Type{
|
messageErrorType := &internal.Type{
|
||||||
ID: "MessageError",
|
ID: "MessageError",
|
||||||
Type: TypeObject,
|
Type: internal.TypeObject,
|
||||||
Description: "Message error type.",
|
Description: "Message error type.",
|
||||||
Properties: []*Type{
|
Properties: []*internal.Type{
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "code",
|
Name: "code",
|
||||||
Type: TypeInteger,
|
Type: internal.TypeInteger,
|
||||||
Description: "Error code.",
|
Description: "Error code.",
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "message",
|
Name: "message",
|
||||||
Type: TypeString,
|
Type: internal.TypeString,
|
||||||
Description: "Error message.",
|
Description: "Error message.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -89,32 +87,32 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// message type
|
// message type
|
||||||
messageType := &Type{
|
messageType := &internal.Type{
|
||||||
ID: "Message",
|
ID: "Message",
|
||||||
Type: TypeObject,
|
Type: internal.TypeObject,
|
||||||
Description: "Chrome Debugging Protocol message sent to/read over websocket connection.",
|
Description: "Chrome Debugging Protocol message sent to/read over websocket connection.",
|
||||||
Properties: []*Type{
|
Properties: []*internal.Type{
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "id",
|
Name: "id",
|
||||||
Type: TypeInteger,
|
Type: internal.TypeInteger,
|
||||||
Description: "Unique message identifier.",
|
Description: "Unique message identifier.",
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "method",
|
Name: "method",
|
||||||
Ref: "Inspector.MethodType",
|
Ref: "Inspector.MethodType",
|
||||||
Description: "Event or command type.",
|
Description: "Event or command type.",
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "params",
|
Name: "params",
|
||||||
Type: TypeAny,
|
Type: internal.TypeAny,
|
||||||
Description: "Event or command parameters.",
|
Description: "Event or command parameters.",
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "result",
|
Name: "result",
|
||||||
Type: TypeAny,
|
Type: internal.TypeAny,
|
||||||
Description: "Command return values.",
|
Description: "Command return values.",
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "error",
|
Name: "error",
|
||||||
Ref: "MessageError",
|
Ref: "MessageError",
|
||||||
Description: "Error message.",
|
Description: "Error message.",
|
||||||
|
@ -123,9 +121,9 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// detach reason type
|
// detach reason type
|
||||||
detachReasonType := &Type{
|
detachReasonType := &internal.Type{
|
||||||
ID: "DetachReason",
|
ID: "DetachReason",
|
||||||
Type: TypeString,
|
Type: internal.TypeString,
|
||||||
Enum: []string{"target_closed", "canceled_by_user", "replaced_with_devtools", "Render process gone."},
|
Enum: []string{"target_closed", "canceled_by_user", "replaced_with_devtools", "Render process gone."},
|
||||||
Description: "Detach reason.",
|
Description: "Detach reason.",
|
||||||
}
|
}
|
||||||
|
@ -134,21 +132,21 @@ func FixupDomains(domains []*Domain) {
|
||||||
errorValues := []string{"context done", "channel closed", "invalid result", "unknown result"}
|
errorValues := []string{"context done", "channel closed", "invalid result", "unknown result"}
|
||||||
errorValueNameMap := make(map[string]string)
|
errorValueNameMap := make(map[string]string)
|
||||||
for _, e := range errorValues {
|
for _, e := range errorValues {
|
||||||
errorValueNameMap[e] = "Err" + ForceCamel(e)
|
errorValueNameMap[e] = "Err" + internal.ForceCamel(e)
|
||||||
}
|
}
|
||||||
errorType := &Type{
|
errorType := &internal.Type{
|
||||||
ID: "ErrorType",
|
ID: "ErrorType",
|
||||||
Type: TypeString,
|
Type: internal.TypeString,
|
||||||
Enum: errorValues,
|
Enum: errorValues,
|
||||||
EnumValueNameMap: errorValueNameMap,
|
EnumValueNameMap: errorValueNameMap,
|
||||||
Description: "Error type.",
|
Description: "Error type.",
|
||||||
Extra: templates.ExtraInternalTypes(),
|
Extra: templates.ExtraCDPTypes(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// modifier type
|
// modifier type
|
||||||
modifierType := &Type{
|
modifierType := &internal.Type{
|
||||||
ID: "Modifier",
|
ID: "Modifier",
|
||||||
Type: TypeInteger,
|
Type: internal.TypeInteger,
|
||||||
EnumBitMask: true,
|
EnumBitMask: true,
|
||||||
Description: "Input key modifier type.",
|
Description: "Input key modifier type.",
|
||||||
Enum: []string{"None", "Alt", "Ctrl", "Meta", "Shift"},
|
Enum: []string{"None", "Alt", "Ctrl", "Meta", "Shift"},
|
||||||
|
@ -156,9 +154,9 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// node type type -- see: https://developer.mozilla.org/en/docs/Web/API/Node/nodeType
|
// node type type -- see: https://developer.mozilla.org/en/docs/Web/API/Node/nodeType
|
||||||
nodeTypeType := &Type{
|
nodeTypeType := &internal.Type{
|
||||||
ID: "NodeType",
|
ID: "NodeType",
|
||||||
Type: TypeInteger,
|
Type: internal.TypeInteger,
|
||||||
Description: "Node type.",
|
Description: "Node type.",
|
||||||
Enum: []string{
|
Enum: []string{
|
||||||
"Element", "Attribute", "Text", "CDATA", "EntityReference",
|
"Element", "Attribute", "Text", "CDATA", "EntityReference",
|
||||||
|
@ -170,7 +168,7 @@ func FixupDomains(domains []*Domain) {
|
||||||
// process domains
|
// process domains
|
||||||
for _, d := range domains {
|
for _, d := range domains {
|
||||||
switch d.Domain {
|
switch d.Domain {
|
||||||
case DomainInspector:
|
case internal.DomainInspector:
|
||||||
// add Inspector types
|
// add Inspector types
|
||||||
d.Types = append(d.Types, messageErrorType, messageType, methodType, detachReasonType, errorType)
|
d.Types = append(d.Types, messageErrorType, messageType, methodType, detachReasonType, errorType)
|
||||||
|
|
||||||
|
@ -180,7 +178,7 @@ func FixupDomains(domains []*Domain) {
|
||||||
for _, t := range e.Parameters {
|
for _, t := range e.Parameters {
|
||||||
if t.Name == "reason" {
|
if t.Name == "reason" {
|
||||||
t.Ref = "DetachReason"
|
t.Ref = "DetachReason"
|
||||||
t.Type = TypeEnum("")
|
t.Type = internal.TypeEnum("")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,16 +186,14 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DomainCSS:
|
case internal.DomainCSS:
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
if t.ID == "CSSComputedStyleProperty" {
|
if t.ID == "CSSComputedStyleProperty" {
|
||||||
t.ID = "ComputedProperty"
|
t.ID = "ComputedProperty"
|
||||||
} else {
|
|
||||||
t.ID = strings.TrimPrefix(t.ID, "CSS")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DomainInput:
|
case internal.DomainInput:
|
||||||
// add Input types
|
// add Input types
|
||||||
d.Types = append(d.Types, modifierType)
|
d.Types = append(d.Types, modifierType)
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
|
@ -206,67 +202,39 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DomainDOM:
|
case internal.DomainDOM:
|
||||||
// add DOM types
|
// add DOM types
|
||||||
d.Types = append(d.Types, nodeTypeType)
|
d.Types = append(d.Types, nodeTypeType)
|
||||||
|
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
switch t.ID {
|
switch t.ID {
|
||||||
case "NodeId", "BackendNodeId":
|
case "NodeId", "BackendNodeId":
|
||||||
t.Extra += templates.ExtraFixStringUnmarshaler(ForceCamel(t.ID), "ParseInt", ", 10, 64")
|
t.Extra += templates.ExtraFixStringUnmarshaler(internal.ForceCamel(t.ID), "ParseInt", ", 10, 64")
|
||||||
|
|
||||||
case "Node":
|
case "Node":
|
||||||
t.Properties = append(t.Properties,
|
t.Properties = append(t.Properties,
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "Parent",
|
Name: "Parent",
|
||||||
Ref: domNodeRef,
|
Ref: domNodeRef,
|
||||||
Description: "Parent node.",
|
Description: "Parent node.",
|
||||||
NoResolve: true,
|
NoResolve: true,
|
||||||
NoExpose: true,
|
NoExpose: true,
|
||||||
},
|
},
|
||||||
/*&Type{
|
&internal.Type{
|
||||||
Name: "Ready",
|
|
||||||
Ref: "chan struct{}",
|
|
||||||
Description: "Ready channel.",
|
|
||||||
NoResolve: true,
|
|
||||||
NoExpose: true,
|
|
||||||
},*/
|
|
||||||
&Type{
|
|
||||||
Name: "Invalidated",
|
Name: "Invalidated",
|
||||||
Ref: "chan struct{}",
|
Ref: "chan struct{}",
|
||||||
Description: "Invalidated channel.",
|
Description: "Invalidated channel.",
|
||||||
NoResolve: true,
|
NoResolve: true,
|
||||||
NoExpose: true,
|
NoExpose: true,
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "State",
|
Name: "State",
|
||||||
Ref: "NodeState",
|
Ref: "NodeState",
|
||||||
Description: "Node state.",
|
Description: "Node state.",
|
||||||
NoResolve: true,
|
NoResolve: true,
|
||||||
NoExpose: true,
|
NoExpose: true,
|
||||||
},
|
},
|
||||||
/*&Type{
|
&internal.Type{
|
||||||
Name: "ComputedStyle",
|
|
||||||
Ref: "[]" + cssComputedStylePropertyRef,
|
|
||||||
Description: "Computed style.",
|
|
||||||
NoResolve: true,
|
|
||||||
NoExpose: true,
|
|
||||||
},
|
|
||||||
&Type{
|
|
||||||
Name: "Valid",
|
|
||||||
Ref: "bool",
|
|
||||||
Description: "Valid state.",
|
|
||||||
NoResolve: true,
|
|
||||||
NoExpose: true,
|
|
||||||
},
|
|
||||||
&Type{
|
|
||||||
Name: "Hidden",
|
|
||||||
Ref: "bool",
|
|
||||||
Description: "Hidden state.",
|
|
||||||
NoResolve: true,
|
|
||||||
NoExpose: true,
|
|
||||||
},*/
|
|
||||||
&Type{
|
|
||||||
Name: "",
|
Name: "",
|
||||||
Ref: "sync.RWMutex",
|
Ref: "sync.RWMutex",
|
||||||
Description: "Read write mutex.",
|
Description: "Read write mutex.",
|
||||||
|
@ -280,36 +248,36 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DomainPage:
|
case internal.DomainPage:
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
switch t.ID {
|
switch t.ID {
|
||||||
case "FrameId":
|
case "FrameId":
|
||||||
t.Extra += templates.ExtraFixStringUnmarshaler(ForceCamel(t.ID), "", "")
|
t.Extra += templates.ExtraFixStringUnmarshaler(internal.ForceCamel(t.ID), "", "")
|
||||||
|
|
||||||
case "Frame":
|
case "Frame":
|
||||||
t.Properties = append(t.Properties,
|
t.Properties = append(t.Properties,
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "State",
|
Name: "State",
|
||||||
Ref: "FrameState",
|
Ref: "FrameState",
|
||||||
Description: "Frame state.",
|
Description: "Frame state.",
|
||||||
NoResolve: true,
|
NoResolve: true,
|
||||||
NoExpose: true,
|
NoExpose: true,
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "Root",
|
Name: "Root",
|
||||||
Ref: domNodeRef,
|
Ref: domNodeRef,
|
||||||
Description: "Frame document root.",
|
Description: "Frame document root.",
|
||||||
NoResolve: true,
|
NoResolve: true,
|
||||||
NoExpose: true,
|
NoExpose: true,
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "Nodes",
|
Name: "Nodes",
|
||||||
Ref: "map[" + domNodeIDRef + "]" + domNodeRef,
|
Ref: "map[" + domNodeIDRef + "]" + domNodeRef,
|
||||||
Description: "Frame nodes.",
|
Description: "Frame nodes.",
|
||||||
NoResolve: true,
|
NoResolve: true,
|
||||||
NoExpose: true,
|
NoExpose: true,
|
||||||
},
|
},
|
||||||
&Type{
|
&internal.Type{
|
||||||
Name: "",
|
Name: "",
|
||||||
Ref: "sync.RWMutex",
|
Ref: "sync.RWMutex",
|
||||||
Description: "Read write mutex.",
|
Description: "Read write mutex.",
|
||||||
|
@ -323,23 +291,23 @@ func FixupDomains(domains []*Domain) {
|
||||||
for _, p := range t.Properties {
|
for _, p := range t.Properties {
|
||||||
if p.Name == "id" || p.Name == "parentId" {
|
if p.Name == "id" || p.Name == "parentId" {
|
||||||
p.Ref = "FrameId"
|
p.Ref = "FrameId"
|
||||||
p.Type = TypeEnum("")
|
p.Type = internal.TypeEnum("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DomainNetwork:
|
case internal.DomainNetwork:
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
// change Timestamp to TypeTimestamp and add extra unmarshaling template
|
// change Timestamp to TypeTimestamp and add extra unmarshaling template
|
||||||
if t.ID == "Timestamp" {
|
if t.ID == "Timestamp" {
|
||||||
t.Type = TypeTimestamp
|
t.Type = internal.TypeTimestamp
|
||||||
t.Extra += templates.ExtraTimestampTemplate(t, d)
|
t.Extra += templates.ExtraTimestampTemplate(t, d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DomainRuntime:
|
case internal.DomainRuntime:
|
||||||
var types []*Type
|
var types []*internal.Type
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
if t.ID == "Timestamp" {
|
if t.ID == "Timestamp" {
|
||||||
continue
|
continue
|
||||||
|
@ -357,11 +325,11 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// process events and commands
|
// process events and commands
|
||||||
processTypesWithParameters(methodType, d, d.Events, EventMethodPrefix, EventMethodSuffix)
|
processTypesWithParameters(methodType, d, d.Events, internal.EventMethodPrefix, internal.EventMethodSuffix)
|
||||||
processTypesWithParameters(methodType, d, d.Commands, CommandMethodPrefix, CommandMethodSuffix)
|
processTypesWithParameters(methodType, d, d.Commands, internal.CommandMethodPrefix, internal.CommandMethodSuffix)
|
||||||
|
|
||||||
// fix input enums
|
// fix input enums
|
||||||
if d.Domain == DomainInput {
|
if d.Domain == internal.DomainInput {
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
if t.Enum != nil && t.ID != "Modifier" {
|
if t.Enum != nil && t.ID != "Modifier" {
|
||||||
t.EnumValueNameMap = make(map[string]string)
|
t.EnumValueNameMap = make(map[string]string)
|
||||||
|
@ -373,7 +341,7 @@ func FixupDomains(domains []*Domain) {
|
||||||
case "ButtonType":
|
case "ButtonType":
|
||||||
prefix = "Button"
|
prefix = "Button"
|
||||||
}
|
}
|
||||||
n := prefix + ForceCamel(v)
|
n := prefix + internal.ForceCamel(v)
|
||||||
if t.ID == "KeyType" {
|
if t.ID == "KeyType" {
|
||||||
n = "Key" + strings.Replace(n, "Key", "", -1)
|
n = "Key" + strings.Replace(n, "Key", "", -1)
|
||||||
}
|
}
|
||||||
|
@ -382,12 +350,24 @@ func FixupDomains(domains []*Domain) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, t := range d.Types {
|
||||||
|
// fix type stuttering
|
||||||
|
if !t.NoExpose && !t.NoResolve {
|
||||||
|
id := strings.TrimPrefix(t.ID, d.Domain.String())
|
||||||
|
if id == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
t.ID = id
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// processTypesWithParameters adds the types to t's enum values, setting the
|
// processTypesWithParameters adds the types to t's enum values, setting the
|
||||||
// enum value map for m. Also, converts the Parameters and Returns properties.
|
// enum value map for m. Also, converts the Parameters and Returns properties.
|
||||||
func processTypesWithParameters(m *Type, d *Domain, types []*Type, prefix, suffix string) {
|
func processTypesWithParameters(m *internal.Type, d *internal.Domain, types []*internal.Type, prefix, suffix string) {
|
||||||
for _, t := range types {
|
for _, t := range types {
|
||||||
n := t.ProtoName(d)
|
n := t.ProtoName(d)
|
||||||
m.Enum = append(m.Enum, n)
|
m.Enum = append(m.Enum, n)
|
||||||
|
@ -401,24 +381,24 @@ func processTypesWithParameters(m *Type, d *Domain, types []*Type, prefix, suffi
|
||||||
}
|
}
|
||||||
|
|
||||||
// convertObjectProperties converts object properties.
|
// convertObjectProperties converts object properties.
|
||||||
func convertObjectProperties(params []*Type, d *Domain, name string) []*Type {
|
func convertObjectProperties(params []*internal.Type, d *internal.Domain, name string) []*internal.Type {
|
||||||
r := make([]*Type, 0)
|
r := make([]*internal.Type, 0)
|
||||||
for _, p := range params {
|
for _, p := range params {
|
||||||
switch {
|
switch {
|
||||||
case p.Items != nil:
|
case p.Items != nil:
|
||||||
r = append(r, &Type{
|
r = append(r, &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Type: TypeArray,
|
Type: internal.TypeArray,
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
Optional: p.Optional,
|
Optional: p.Optional,
|
||||||
Items: convertObjectProperties([]*Type{p.Items}, d, name+"."+p.Name)[0],
|
Items: convertObjectProperties([]*internal.Type{p.Items}, d, name+"."+p.Name)[0],
|
||||||
})
|
})
|
||||||
|
|
||||||
case p.Enum != nil:
|
case p.Enum != nil:
|
||||||
r = append(r, fixupEnumParameter(name, p, d))
|
r = append(r, fixupEnumParameter(name, p, d))
|
||||||
|
|
||||||
case (p.Name == "timestamp" || p.Ref == "Network.Timestamp" || p.Ref == "Timestamp") && d.Domain != DomainInput:
|
case (p.Name == "timestamp" || p.Ref == "Network.Timestamp" || p.Ref == "Timestamp") && d.Domain != internal.DomainInput:
|
||||||
r = append(r, &Type{
|
r = append(r, &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Ref: "Network.Timestamp",
|
Ref: "Network.Timestamp",
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
|
@ -426,7 +406,7 @@ func convertObjectProperties(params []*Type, d *Domain, name string) []*Type {
|
||||||
})
|
})
|
||||||
|
|
||||||
case p.Name == "modifiers":
|
case p.Name == "modifiers":
|
||||||
r = append(r, &Type{
|
r = append(r, &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Ref: "Modifier",
|
Ref: "Modifier",
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
|
@ -434,7 +414,7 @@ func convertObjectProperties(params []*Type, d *Domain, name string) []*Type {
|
||||||
})
|
})
|
||||||
|
|
||||||
case p.Name == "nodeType":
|
case p.Name == "nodeType":
|
||||||
r = append(r, &Type{
|
r = append(r, &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Ref: "NodeType",
|
Ref: "NodeType",
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
|
@ -442,7 +422,7 @@ func convertObjectProperties(params []*Type, d *Domain, name string) []*Type {
|
||||||
})
|
})
|
||||||
|
|
||||||
case p.Ref == "GestureSourceType":
|
case p.Ref == "GestureSourceType":
|
||||||
r = append(r, &Type{
|
r = append(r, &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Ref: "GestureType",
|
Ref: "GestureType",
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
|
@ -450,17 +430,29 @@ func convertObjectProperties(params []*Type, d *Domain, name string) []*Type {
|
||||||
})
|
})
|
||||||
|
|
||||||
case p.Ref == "CSSComputedStyleProperty":
|
case p.Ref == "CSSComputedStyleProperty":
|
||||||
r = append(r, &Type{
|
r = append(r, &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Ref: "ComputedProperty",
|
Ref: "ComputedProperty",
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
Optional: p.Optional,
|
Optional: p.Optional,
|
||||||
})
|
})
|
||||||
|
|
||||||
case strings.HasPrefix(p.Ref, "CSS"):
|
case p.Ref != "" && !p.NoExpose && !p.NoResolve:
|
||||||
r = append(r, &Type{
|
ref := strings.SplitN(p.Ref, ".", 2)
|
||||||
|
if len(ref) == 1 {
|
||||||
|
ref[0] = strings.TrimPrefix(ref[0], d.Domain.String())
|
||||||
|
} else {
|
||||||
|
ref[1] = strings.TrimPrefix(ref[1], ref[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
z := strings.Join(ref, ".")
|
||||||
|
if z == "" {
|
||||||
|
z = p.Ref
|
||||||
|
}
|
||||||
|
|
||||||
|
r = append(r, &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Ref: strings.TrimPrefix(p.Ref, "CSS"),
|
Ref: z,
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
Optional: p.Optional,
|
Optional: p.Optional,
|
||||||
})
|
})
|
||||||
|
@ -474,9 +466,9 @@ func convertObjectProperties(params []*Type, d *Domain, name string) []*Type {
|
||||||
}
|
}
|
||||||
|
|
||||||
// addEnumValues adds orig.Enum values to type named n's Enum values in domain.
|
// addEnumValues adds orig.Enum values to type named n's Enum values in domain.
|
||||||
func addEnumValues(d *Domain, n string, p *Type) {
|
func addEnumValues(d *internal.Domain, n string, p *internal.Type) {
|
||||||
// find type
|
// find type
|
||||||
var typ *Type
|
var typ *internal.Type
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
if t.ID == n {
|
if t.ID == n {
|
||||||
typ = t
|
typ = t
|
||||||
|
@ -484,9 +476,9 @@ func addEnumValues(d *Domain, n string, p *Type) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if typ == nil {
|
if typ == nil {
|
||||||
typ = &Type{
|
typ = &internal.Type{
|
||||||
ID: n,
|
ID: n,
|
||||||
Type: TypeString,
|
Type: internal.TypeString,
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
Optional: p.Optional,
|
Optional: p.Optional,
|
||||||
}
|
}
|
||||||
|
@ -513,8 +505,9 @@ func addEnumValues(d *Domain, n string, p *Type) {
|
||||||
|
|
||||||
// enumRefMap is the fully qualified parameter name to ref.
|
// enumRefMap is the fully qualified parameter name to ref.
|
||||||
var enumRefMap = map[string]string{
|
var enumRefMap = map[string]string{
|
||||||
|
"Animation.Animation.type": "Type",
|
||||||
|
"CSS.CSSMedia.source": "MediaSource",
|
||||||
"CSS.forcePseudoState.forcedPseudoClasses": "PseudoClass",
|
"CSS.forcePseudoState.forcedPseudoClasses": "PseudoClass",
|
||||||
"CSS.Media.source": "MediaSource",
|
|
||||||
"Debugger.setPauseOnExceptions.state": "ExceptionsState",
|
"Debugger.setPauseOnExceptions.state": "ExceptionsState",
|
||||||
"Emulation.ScreenOrientation.type": "OrientationType",
|
"Emulation.ScreenOrientation.type": "OrientationType",
|
||||||
"Emulation.setTouchEmulationEnabled.configuration": "EnabledConfiguration",
|
"Emulation.setTouchEmulationEnabled.configuration": "EnabledConfiguration",
|
||||||
|
@ -544,9 +537,9 @@ var enumRefMap = map[string]string{
|
||||||
|
|
||||||
// fixupEnumParameter takes an enum parameter, adds it to the domain and
|
// fixupEnumParameter takes an enum parameter, adds it to the domain and
|
||||||
// returns a type suitable for use in place of the type.
|
// returns a type suitable for use in place of the type.
|
||||||
func fixupEnumParameter(typ string, p *Type, d *Domain) *Type {
|
func fixupEnumParameter(typ string, p *internal.Type, d *internal.Domain) *internal.Type {
|
||||||
fqname := strings.TrimSuffix(fmt.Sprintf("%s.%s.%s", d.Domain, typ, p.Name), ".")
|
fqname := strings.TrimSuffix(fmt.Sprintf("%s.%s.%s", d.Domain, typ, p.Name), ".")
|
||||||
ref := ForceCamel(typ + "." + p.Name)
|
ref := internal.ForceCamel(typ + "." + p.Name)
|
||||||
if n, ok := enumRefMap[fqname]; ok {
|
if n, ok := enumRefMap[fqname]; ok {
|
||||||
ref = n
|
ref = n
|
||||||
}
|
}
|
||||||
|
@ -554,7 +547,7 @@ func fixupEnumParameter(typ string, p *Type, d *Domain) *Type {
|
||||||
// add enum values to type name
|
// add enum values to type name
|
||||||
addEnumValues(d, ref, p)
|
addEnumValues(d, ref, p)
|
||||||
|
|
||||||
return &Type{
|
return &internal.Type{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Ref: ref,
|
Ref: ref,
|
||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"github.com/gedex/inflector"
|
"github.com/gedex/inflector"
|
||||||
qtpl "github.com/valyala/quicktemplate"
|
qtpl "github.com/valyala/quicktemplate"
|
||||||
|
|
||||||
. "github.com/knq/chromedp/cmd/chromedp-gen/internal"
|
"github.com/knq/chromedp/cmd/chromedp-gen/internal"
|
||||||
. "github.com/knq/chromedp/cmd/chromedp-gen/templates"
|
"github.com/knq/chromedp/cmd/chromedp-gen/templates"
|
||||||
)
|
)
|
||||||
|
|
||||||
// fileBuffers is a type to manage buffers for file data.
|
// fileBuffers is a type to manage buffers for file data.
|
||||||
|
@ -16,17 +16,17 @@ type fileBuffers map[string]*bytes.Buffer
|
||||||
|
|
||||||
// GenerateDomains generates domains for the Chrome Debugging Protocol domain
|
// GenerateDomains generates domains for the Chrome Debugging Protocol domain
|
||||||
// definitions, returning generated file buffers.
|
// definitions, returning generated file buffers.
|
||||||
func GenerateDomains(domains []*Domain) map[string]*bytes.Buffer {
|
func GenerateDomains(domains []*internal.Domain) map[string]*bytes.Buffer {
|
||||||
fb := make(fileBuffers)
|
fb := make(fileBuffers)
|
||||||
|
|
||||||
var w *qtpl.Writer
|
var w *qtpl.Writer
|
||||||
|
|
||||||
// determine base (also used for the domains manager type name)
|
// determine base (also used for the domains manager type name)
|
||||||
pkgBase := path.Base(*FlagPkg)
|
pkgBase := path.Base(*internal.FlagPkg)
|
||||||
DomainTypeSuffix = inflector.Singularize(ForceCamel(pkgBase))
|
internal.DomainTypeSuffix = inflector.Singularize(internal.ForceCamel(pkgBase))
|
||||||
|
|
||||||
// generate internal types
|
// generate internal types
|
||||||
fb.generateInternalTypes(domains)
|
fb.generateCDPTypes(domains)
|
||||||
|
|
||||||
// generate util package
|
// generate util package
|
||||||
fb.generateUtilPackage(domains)
|
fb.generateUtilPackage(domains)
|
||||||
|
@ -38,14 +38,14 @@ func GenerateDomains(domains []*Domain) map[string]*bytes.Buffer {
|
||||||
|
|
||||||
// do command template
|
// do command template
|
||||||
w = fb.get(pkgOut, pkgName, d)
|
w = fb.get(pkgOut, pkgName, d)
|
||||||
StreamDomainTemplate(w, d, domains)
|
templates.StreamDomainTemplate(w, d, domains)
|
||||||
fb.release(w)
|
fb.release(w)
|
||||||
|
|
||||||
// generate domain types
|
// generate domain types
|
||||||
if len(d.Types) != 0 {
|
if len(d.Types) != 0 {
|
||||||
fb.generateTypes(
|
fb.generateTypes(
|
||||||
pkgName+"/types.go",
|
pkgName+"/types.go",
|
||||||
d.Types, TypePrefix, TypeSuffix, d, domains,
|
d.Types, internal.TypePrefix, internal.TypeSuffix, d, domains,
|
||||||
"", "", "", "", "",
|
"", "", "", "", "",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -54,9 +54,9 @@ func GenerateDomains(domains []*Domain) map[string]*bytes.Buffer {
|
||||||
if len(d.Events) != 0 {
|
if len(d.Events) != 0 {
|
||||||
fb.generateTypes(
|
fb.generateTypes(
|
||||||
pkgName+"/events.go",
|
pkgName+"/events.go",
|
||||||
d.Events, EventTypePrefix, EventTypeSuffix, d, domains,
|
d.Events, internal.EventTypePrefix, internal.EventTypeSuffix, d, domains,
|
||||||
"EventTypes", "MethodType", EventMethodPrefix+d.String(), EventMethodSuffix,
|
"EventTypes", "cdp.MethodType", "cdp."+internal.EventMethodPrefix+d.String(), internal.EventMethodSuffix,
|
||||||
"EventTypes is all event types in the domain.",
|
"All event types in the domain.",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,23 +64,32 @@ func GenerateDomains(domains []*Domain) map[string]*bytes.Buffer {
|
||||||
return map[string]*bytes.Buffer(fb)
|
return map[string]*bytes.Buffer(fb)
|
||||||
}
|
}
|
||||||
|
|
||||||
// generateInternalTypes generates the internal types for domain d.
|
// generateCDPTypes generates the internal types for domain d.
|
||||||
//
|
//
|
||||||
// because there are circular package dependencies, some types need to be moved
|
// because there are circular package dependencies, some types need to be moved
|
||||||
// to the shared internal package.
|
// to the shared internal package.
|
||||||
func (fb fileBuffers) generateInternalTypes(domains []*Domain) {
|
func (fb fileBuffers) generateCDPTypes(domains []*internal.Domain) {
|
||||||
pkg := path.Base(*FlagPkg)
|
var types []*internal.Type
|
||||||
w := fb.get(pkg+".go", pkg, nil)
|
|
||||||
|
|
||||||
for _, d := range domains {
|
for _, d := range domains {
|
||||||
// process internal types
|
// process internal types
|
||||||
for _, t := range d.Types {
|
for _, t := range d.Types {
|
||||||
if IsInternalType(d.Domain, t.IdOrName()) {
|
if internal.IsCDPType(d.Domain, t.IdOrName()) {
|
||||||
StreamTypeTemplate(w, t, TypePrefix, TypeSuffix, d, domains, nil, false, false)
|
types = append(types, t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pkg := path.Base(*internal.FlagPkg)
|
||||||
|
cdpDomain := &internal.Domain{
|
||||||
|
Domain: internal.DomainType("cdp"),
|
||||||
|
Types: types,
|
||||||
|
}
|
||||||
|
doms := append(domains, cdpDomain)
|
||||||
|
|
||||||
|
w := fb.get(pkg+".go", pkg, nil)
|
||||||
|
for _, t := range types {
|
||||||
|
templates.StreamTypeTemplate(w, t, internal.TypePrefix, internal.TypeSuffix, cdpDomain, doms, nil, false, false)
|
||||||
|
}
|
||||||
fb.release(w)
|
fb.release(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,40 +97,39 @@ func (fb fileBuffers) generateInternalTypes(domains []*Domain) {
|
||||||
//
|
//
|
||||||
// currently only contains the message unmarshaler: if this wasn't in a
|
// currently only contains the message unmarshaler: if this wasn't in a
|
||||||
// separate package, there would be circular dependencies.
|
// separate package, there would be circular dependencies.
|
||||||
func (fb fileBuffers) generateUtilPackage(domains []*Domain) {
|
func (fb fileBuffers) generateUtilPackage(domains []*internal.Domain) {
|
||||||
// generate imports
|
// generate imports
|
||||||
importMap := map[string]string{
|
importMap := map[string]string{
|
||||||
*FlagPkg: ".",
|
*internal.FlagPkg: "cdp",
|
||||||
}
|
}
|
||||||
for _, d := range domains {
|
for _, d := range domains {
|
||||||
importMap[*FlagPkg+"/"+d.PackageName()] = d.PackageImportAlias()
|
importMap[*internal.FlagPkg+"/"+d.PackageName()] = d.PackageImportAlias()
|
||||||
}
|
}
|
||||||
|
|
||||||
w := fb.get("util/util.go", "util", nil)
|
w := fb.get("util/util.go", "util", nil)
|
||||||
StreamFileImportTemplate(w, importMap)
|
templates.StreamFileImportTemplate(w, importMap)
|
||||||
StreamExtraUtilTemplate(w, domains)
|
templates.StreamExtraUtilTemplate(w, domains)
|
||||||
fb.release(w)
|
fb.release(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
// generateTypes generates the types.
|
// generateTypes generates the types.
|
||||||
func (fb fileBuffers) generateTypes(
|
func (fb fileBuffers) generateTypes(
|
||||||
path string,
|
path string,
|
||||||
types []*Type, prefix, suffix string, d *Domain, domains []*Domain,
|
types []*internal.Type, prefix, suffix string, d *internal.Domain, domains []*internal.Domain,
|
||||||
emit, emitType, emitPrefix, emitSuffix, emitDesc string,
|
emit, emitType, emitPrefix, emitSuffix, emitDesc string,
|
||||||
) {
|
) {
|
||||||
w := fb.get(path, d.PackageName(), d)
|
w := fb.get(path, d.PackageName(), d)
|
||||||
|
|
||||||
// add internal import
|
// add internal import
|
||||||
StreamFileLocalImportTemplate(w, *FlagPkg)
|
templates.StreamFileImportTemplate(w, map[string]string{*internal.FlagPkg: "cdp"})
|
||||||
StreamFileEmptyVarTemplate(w, InternalTypeList()...)
|
|
||||||
|
|
||||||
// process type list
|
// process type list
|
||||||
var names []string
|
var names []string
|
||||||
for _, t := range types {
|
for _, t := range types {
|
||||||
if IsInternalType(d.Domain, t.IdOrName()) {
|
if internal.IsCDPType(d.Domain, t.IdOrName()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
StreamTypeTemplate(w, t, prefix, suffix, d, domains, nil, false, false)
|
templates.StreamTypeTemplate(w, t, prefix, suffix, d, domains, nil, false, false)
|
||||||
names = append(names, t.TypeName(emitPrefix, emitSuffix))
|
names = append(names, t.TypeName(emitPrefix, emitSuffix))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,14 +140,14 @@ func (fb fileBuffers) generateTypes(
|
||||||
s += "\n" + n + ","
|
s += "\n" + n + ","
|
||||||
}
|
}
|
||||||
s += "\n}"
|
s += "\n}"
|
||||||
StreamFileVarTemplate(w, emit, s, emitDesc)
|
templates.StreamFileVarTemplate(w, emit, s, emitDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
fb.release(w)
|
fb.release(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get retrieves the file buffer for s, or creates it if it is not yet available.
|
// get retrieves the file buffer for s, or creates it if it is not yet available.
|
||||||
func (fb fileBuffers) get(s string, pkgName string, d *Domain) *qtpl.Writer {
|
func (fb fileBuffers) get(s string, pkgName string, d *internal.Domain) *qtpl.Writer {
|
||||||
// check if it already exists
|
// check if it already exists
|
||||||
if b, ok := fb[s]; ok {
|
if b, ok := fb[s]; ok {
|
||||||
return qtpl.AcquireWriter(b)
|
return qtpl.AcquireWriter(b)
|
||||||
|
@ -156,7 +164,7 @@ func (fb fileBuffers) get(s string, pkgName string, d *Domain) *qtpl.Writer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add package header
|
// add package header
|
||||||
StreamFileHeader(w, pkgName, v)
|
templates.StreamFileHeader(w, pkgName, v)
|
||||||
|
|
||||||
return w
|
return w
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user