cdproto: github.com/chromedp/cdproto/target Index | Files

package target

import "github.com/chromedp/cdproto/target"

Package target provides the Chrome DevTools Protocol commands, types, and events for the Target domain.

Supports additional targets discovery and allows to attach to them.

Generated by the cdproto-gen command.

Index

Package Files

easyjson.go events.go target.go types.go

Constants

const (
    CommandActivateTarget         = "Target.activateTarget"
    CommandAttachToTarget         = "Target.attachToTarget"
    CommandAttachToBrowserTarget  = "Target.attachToBrowserTarget"
    CommandCloseTarget            = "Target.closeTarget"
    CommandExposeDevToolsProtocol = "Target.exposeDevToolsProtocol"
    CommandCreateBrowserContext   = "Target.createBrowserContext"
    CommandGetBrowserContexts     = "Target.getBrowserContexts"
    CommandCreateTarget           = "Target.createTarget"
    CommandDetachFromTarget       = "Target.detachFromTarget"
    CommandDisposeBrowserContext  = "Target.disposeBrowserContext"
    CommandGetTargetInfo          = "Target.getTargetInfo"
    CommandGetTargets             = "Target.getTargets"
    CommandSetAutoAttach          = "Target.setAutoAttach"
    CommandSetDiscoverTargets     = "Target.setDiscoverTargets"
    CommandSetRemoteLocations     = "Target.setRemoteLocations"
)

Command names.

type ActivateTargetParams Uses

type ActivateTargetParams struct {
    TargetID ID `json:"targetId"`
}

ActivateTargetParams activates (focuses) the target.

func ActivateTarget Uses

func ActivateTarget(targetID ID) *ActivateTargetParams

ActivateTarget activates (focuses) the target.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-activateTarget

parameters:

targetID

func (*ActivateTargetParams) Do Uses

func (p *ActivateTargetParams) Do(ctx context.Context) (err error)

Do executes Target.activateTarget against the provided context.

func (ActivateTargetParams) MarshalEasyJSON Uses

func (v ActivateTargetParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ActivateTargetParams) MarshalJSON Uses

func (v ActivateTargetParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ActivateTargetParams) UnmarshalEasyJSON Uses

func (v *ActivateTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ActivateTargetParams) UnmarshalJSON Uses

func (v *ActivateTargetParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type AttachToBrowserTargetParams Uses

type AttachToBrowserTargetParams struct{}

AttachToBrowserTargetParams attaches to the browser target, only uses flat sessionId mode.

func AttachToBrowserTarget Uses

func AttachToBrowserTarget() *AttachToBrowserTargetParams

AttachToBrowserTarget attaches to the browser target, only uses flat sessionId mode.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-attachToBrowserTarget

func (*AttachToBrowserTargetParams) Do Uses

func (p *AttachToBrowserTargetParams) Do(ctx context.Context) (sessionID SessionID, err error)

Do executes Target.attachToBrowserTarget against the provided context.

returns:

sessionID - Id assigned to the session.

func (AttachToBrowserTargetParams) MarshalEasyJSON Uses

func (v AttachToBrowserTargetParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (AttachToBrowserTargetParams) MarshalJSON Uses

func (v AttachToBrowserTargetParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*AttachToBrowserTargetParams) UnmarshalEasyJSON Uses

func (v *AttachToBrowserTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*AttachToBrowserTargetParams) UnmarshalJSON Uses

func (v *AttachToBrowserTargetParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type AttachToBrowserTargetReturns Uses

type AttachToBrowserTargetReturns struct {
    SessionID SessionID `json:"sessionId,omitempty"` // Id assigned to the session.
}

AttachToBrowserTargetReturns return values.

func (AttachToBrowserTargetReturns) MarshalEasyJSON Uses

func (v AttachToBrowserTargetReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (AttachToBrowserTargetReturns) MarshalJSON Uses

func (v AttachToBrowserTargetReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*AttachToBrowserTargetReturns) UnmarshalEasyJSON Uses

func (v *AttachToBrowserTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*AttachToBrowserTargetReturns) UnmarshalJSON Uses

func (v *AttachToBrowserTargetReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type AttachToTargetParams Uses

type AttachToTargetParams struct {
    TargetID ID   `json:"targetId"`
    Flatten  bool `json:"flatten,omitempty"` // Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.
}

AttachToTargetParams attaches to the target with given id.

func AttachToTarget Uses

func AttachToTarget(targetID ID) *AttachToTargetParams

AttachToTarget attaches to the target with given id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-attachToTarget

parameters:

targetID

func (*AttachToTargetParams) Do Uses

func (p *AttachToTargetParams) Do(ctx context.Context) (sessionID SessionID, err error)

Do executes Target.attachToTarget against the provided context.

returns:

sessionID - Id assigned to the session.

func (AttachToTargetParams) MarshalEasyJSON Uses

func (v AttachToTargetParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (AttachToTargetParams) MarshalJSON Uses

func (v AttachToTargetParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*AttachToTargetParams) UnmarshalEasyJSON Uses

func (v *AttachToTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*AttachToTargetParams) UnmarshalJSON Uses

func (v *AttachToTargetParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (AttachToTargetParams) WithFlatten Uses

func (p AttachToTargetParams) WithFlatten(flatten bool) *AttachToTargetParams

WithFlatten enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.

type AttachToTargetReturns Uses

type AttachToTargetReturns struct {
    SessionID SessionID `json:"sessionId,omitempty"` // Id assigned to the session.
}

AttachToTargetReturns return values.

func (AttachToTargetReturns) MarshalEasyJSON Uses

func (v AttachToTargetReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (AttachToTargetReturns) MarshalJSON Uses

func (v AttachToTargetReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*AttachToTargetReturns) UnmarshalEasyJSON Uses

func (v *AttachToTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*AttachToTargetReturns) UnmarshalJSON Uses

func (v *AttachToTargetReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CloseTargetParams Uses

type CloseTargetParams struct {
    TargetID ID `json:"targetId"`
}

CloseTargetParams closes the target. If the target is a page that gets closed too.

func CloseTarget Uses

func CloseTarget(targetID ID) *CloseTargetParams

CloseTarget closes the target. If the target is a page that gets closed too.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-closeTarget

parameters:

targetID

func (*CloseTargetParams) Do Uses

func (p *CloseTargetParams) Do(ctx context.Context) (err error)

Do executes Target.closeTarget against the provided context.

func (CloseTargetParams) MarshalEasyJSON Uses

func (v CloseTargetParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CloseTargetParams) MarshalJSON Uses

func (v CloseTargetParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CloseTargetParams) UnmarshalEasyJSON Uses

func (v *CloseTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CloseTargetParams) UnmarshalJSON Uses

func (v *CloseTargetParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreateBrowserContextParams Uses

type CreateBrowserContextParams struct {
    DisposeOnDetach bool   `json:"disposeOnDetach,omitempty"` // If specified, disposes this context when debugging session disconnects.
    ProxyServer     string `json:"proxyServer,omitempty"`     // Proxy server, similar to the one passed to --proxy-server
    ProxyBypassList string `json:"proxyBypassList,omitempty"` // Proxy bypass list, similar to the one passed to --proxy-bypass-list
}

CreateBrowserContextParams creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.

func CreateBrowserContext Uses

func CreateBrowserContext() *CreateBrowserContextParams

CreateBrowserContext creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-createBrowserContext

parameters:

func (*CreateBrowserContextParams) Do Uses

func (p *CreateBrowserContextParams) Do(ctx context.Context) (browserContextID cdp.BrowserContextID, err error)

Do executes Target.createBrowserContext against the provided context.

returns:

browserContextID - The id of the context created.

func (CreateBrowserContextParams) MarshalEasyJSON Uses

func (v CreateBrowserContextParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateBrowserContextParams) MarshalJSON Uses

func (v CreateBrowserContextParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateBrowserContextParams) UnmarshalEasyJSON Uses

func (v *CreateBrowserContextParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateBrowserContextParams) UnmarshalJSON Uses

func (v *CreateBrowserContextParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (CreateBrowserContextParams) WithDisposeOnDetach Uses

func (p CreateBrowserContextParams) WithDisposeOnDetach(disposeOnDetach bool) *CreateBrowserContextParams

WithDisposeOnDetach if specified, disposes this context when debugging session disconnects.

func (CreateBrowserContextParams) WithProxyBypassList Uses

func (p CreateBrowserContextParams) WithProxyBypassList(proxyBypassList string) *CreateBrowserContextParams

WithProxyBypassList proxy bypass list, similar to the one passed to --proxy-bypass-list.

func (CreateBrowserContextParams) WithProxyServer Uses

func (p CreateBrowserContextParams) WithProxyServer(proxyServer string) *CreateBrowserContextParams

WithProxyServer proxy server, similar to the one passed to --proxy-server.

type CreateBrowserContextReturns Uses

type CreateBrowserContextReturns struct {
    BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // The id of the context created.
}

CreateBrowserContextReturns return values.

func (CreateBrowserContextReturns) MarshalEasyJSON Uses

func (v CreateBrowserContextReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateBrowserContextReturns) MarshalJSON Uses

func (v CreateBrowserContextReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateBrowserContextReturns) UnmarshalEasyJSON Uses

func (v *CreateBrowserContextReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateBrowserContextReturns) UnmarshalJSON Uses

func (v *CreateBrowserContextReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreateTargetParams Uses

type CreateTargetParams struct {
    URL                     string               `json:"url"`                               // The initial URL the page will be navigated to.
    Width                   int64                `json:"width,omitempty"`                   // Frame width in DIP (headless chrome only).
    Height                  int64                `json:"height,omitempty"`                  // Frame height in DIP (headless chrome only).
    BrowserContextID        cdp.BrowserContextID `json:"browserContextId,omitempty"`        // The browser context to create the page in.
    EnableBeginFrameControl bool                 `json:"enableBeginFrameControl,omitempty"` // Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).
    NewWindow               bool                 `json:"newWindow,omitempty"`               // Whether to create a new Window or Tab (chrome-only, false by default).
    Background              bool                 `json:"background,omitempty"`              // Whether to create the target in background or foreground (chrome-only, false by default).
}

CreateTargetParams creates a new page.

func CreateTarget Uses

func CreateTarget(url string) *CreateTargetParams

CreateTarget creates a new page.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-createTarget

parameters:

url - The initial URL the page will be navigated to.

func (*CreateTargetParams) Do Uses

func (p *CreateTargetParams) Do(ctx context.Context) (targetID ID, err error)

Do executes Target.createTarget against the provided context.

returns:

targetID - The id of the page opened.

func (CreateTargetParams) MarshalEasyJSON Uses

func (v CreateTargetParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateTargetParams) MarshalJSON Uses

func (v CreateTargetParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateTargetParams) UnmarshalEasyJSON Uses

func (v *CreateTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateTargetParams) UnmarshalJSON Uses

func (v *CreateTargetParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (CreateTargetParams) WithBackground Uses

func (p CreateTargetParams) WithBackground(background bool) *CreateTargetParams

WithBackground whether to create the target in background or foreground (chrome-only, false by default).

func (CreateTargetParams) WithBrowserContextID Uses

func (p CreateTargetParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *CreateTargetParams

WithBrowserContextID the browser context to create the page in.

func (CreateTargetParams) WithEnableBeginFrameControl Uses

func (p CreateTargetParams) WithEnableBeginFrameControl(enableBeginFrameControl bool) *CreateTargetParams

WithEnableBeginFrameControl whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).

func (CreateTargetParams) WithHeight Uses

func (p CreateTargetParams) WithHeight(height int64) *CreateTargetParams

WithHeight frame height in DIP (headless chrome only).

func (CreateTargetParams) WithNewWindow Uses

func (p CreateTargetParams) WithNewWindow(newWindow bool) *CreateTargetParams

WithNewWindow whether to create a new Window or Tab (chrome-only, false by default).

func (CreateTargetParams) WithWidth Uses

func (p CreateTargetParams) WithWidth(width int64) *CreateTargetParams

WithWidth frame width in DIP (headless chrome only).

type CreateTargetReturns Uses

type CreateTargetReturns struct {
    TargetID ID `json:"targetId,omitempty"` // The id of the page opened.
}

CreateTargetReturns return values.

func (CreateTargetReturns) MarshalEasyJSON Uses

func (v CreateTargetReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateTargetReturns) MarshalJSON Uses

func (v CreateTargetReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateTargetReturns) UnmarshalEasyJSON Uses

func (v *CreateTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateTargetReturns) UnmarshalJSON Uses

func (v *CreateTargetReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DetachFromTargetParams Uses

type DetachFromTargetParams struct {
    SessionID SessionID `json:"sessionId,omitempty"` // Session to detach.
}

DetachFromTargetParams detaches session with given id.

func DetachFromTarget Uses

func DetachFromTarget() *DetachFromTargetParams

DetachFromTarget detaches session with given id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-detachFromTarget

parameters:

func (*DetachFromTargetParams) Do Uses

func (p *DetachFromTargetParams) Do(ctx context.Context) (err error)

Do executes Target.detachFromTarget against the provided context.

func (DetachFromTargetParams) MarshalEasyJSON Uses

func (v DetachFromTargetParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DetachFromTargetParams) MarshalJSON Uses

func (v DetachFromTargetParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DetachFromTargetParams) UnmarshalEasyJSON Uses

func (v *DetachFromTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DetachFromTargetParams) UnmarshalJSON Uses

func (v *DetachFromTargetParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (DetachFromTargetParams) WithSessionID Uses

func (p DetachFromTargetParams) WithSessionID(sessionID SessionID) *DetachFromTargetParams

WithSessionID session to detach.

type DisposeBrowserContextParams Uses

type DisposeBrowserContextParams struct {
    BrowserContextID cdp.BrowserContextID `json:"browserContextId"`
}

DisposeBrowserContextParams deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.

func DisposeBrowserContext Uses

func DisposeBrowserContext(browserContextID cdp.BrowserContextID) *DisposeBrowserContextParams

DisposeBrowserContext deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-disposeBrowserContext

parameters:

browserContextID

func (*DisposeBrowserContextParams) Do Uses

func (p *DisposeBrowserContextParams) Do(ctx context.Context) (err error)

Do executes Target.disposeBrowserContext against the provided context.

func (DisposeBrowserContextParams) MarshalEasyJSON Uses

func (v DisposeBrowserContextParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DisposeBrowserContextParams) MarshalJSON Uses

func (v DisposeBrowserContextParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DisposeBrowserContextParams) UnmarshalEasyJSON Uses

func (v *DisposeBrowserContextParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DisposeBrowserContextParams) UnmarshalJSON Uses

func (v *DisposeBrowserContextParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventAttachedToTarget Uses

type EventAttachedToTarget struct {
    SessionID          SessionID `json:"sessionId"` // Identifier assigned to the session used to send/receive messages.
    TargetInfo         *Info     `json:"targetInfo"`
    WaitingForDebugger bool      `json:"waitingForDebugger"`
}

EventAttachedToTarget issued when attached to target because of auto-attach or attachToTarget command.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#event-attachedToTarget

func (EventAttachedToTarget) MarshalEasyJSON Uses

func (v EventAttachedToTarget) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventAttachedToTarget) MarshalJSON Uses

func (v EventAttachedToTarget) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventAttachedToTarget) UnmarshalEasyJSON Uses

func (v *EventAttachedToTarget) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventAttachedToTarget) UnmarshalJSON Uses

func (v *EventAttachedToTarget) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventDetachedFromTarget Uses

type EventDetachedFromTarget struct {
    SessionID SessionID `json:"sessionId"` // Detached session identifier.
}

EventDetachedFromTarget issued when detached from target for any reason (including detachFromTarget command). Can be issued multiple times per target if multiple sessions have been attached to it.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#event-detachedFromTarget

func (EventDetachedFromTarget) MarshalEasyJSON Uses

func (v EventDetachedFromTarget) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventDetachedFromTarget) MarshalJSON Uses

func (v EventDetachedFromTarget) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventDetachedFromTarget) UnmarshalEasyJSON Uses

func (v *EventDetachedFromTarget) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventDetachedFromTarget) UnmarshalJSON Uses

func (v *EventDetachedFromTarget) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventReceivedMessageFromTarget Uses

type EventReceivedMessageFromTarget struct {
    SessionID SessionID `json:"sessionId"` // Identifier of a session which sends a message.
    Message   string    `json:"message"`
}

EventReceivedMessageFromTarget notifies about a new protocol message received from the session (as reported in attachedToTarget event).

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#event-receivedMessageFromTarget

func (EventReceivedMessageFromTarget) MarshalEasyJSON Uses

func (v EventReceivedMessageFromTarget) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventReceivedMessageFromTarget) MarshalJSON Uses

func (v EventReceivedMessageFromTarget) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventReceivedMessageFromTarget) UnmarshalEasyJSON Uses

func (v *EventReceivedMessageFromTarget) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventReceivedMessageFromTarget) UnmarshalJSON Uses

func (v *EventReceivedMessageFromTarget) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventTargetCrashed Uses

type EventTargetCrashed struct {
    TargetID  ID     `json:"targetId"`
    Status    string `json:"status"`    // Termination status type.
    ErrorCode int64  `json:"errorCode"` // Termination error code.
}

EventTargetCrashed issued when a target has crashed.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#event-targetCrashed

func (EventTargetCrashed) MarshalEasyJSON Uses

func (v EventTargetCrashed) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventTargetCrashed) MarshalJSON Uses

func (v EventTargetCrashed) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventTargetCrashed) UnmarshalEasyJSON Uses

func (v *EventTargetCrashed) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventTargetCrashed) UnmarshalJSON Uses

func (v *EventTargetCrashed) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventTargetCreated Uses

type EventTargetCreated struct {
    TargetInfo *Info `json:"targetInfo"`
}

EventTargetCreated issued when a possible inspection target is created.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#event-targetCreated

func (EventTargetCreated) MarshalEasyJSON Uses

func (v EventTargetCreated) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventTargetCreated) MarshalJSON Uses

func (v EventTargetCreated) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventTargetCreated) UnmarshalEasyJSON Uses

func (v *EventTargetCreated) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventTargetCreated) UnmarshalJSON Uses

func (v *EventTargetCreated) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventTargetDestroyed Uses

type EventTargetDestroyed struct {
    TargetID ID `json:"targetId"`
}

EventTargetDestroyed issued when a target is destroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#event-targetDestroyed

func (EventTargetDestroyed) MarshalEasyJSON Uses

func (v EventTargetDestroyed) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventTargetDestroyed) MarshalJSON Uses

func (v EventTargetDestroyed) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventTargetDestroyed) UnmarshalEasyJSON Uses

func (v *EventTargetDestroyed) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventTargetDestroyed) UnmarshalJSON Uses

func (v *EventTargetDestroyed) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventTargetInfoChanged Uses

type EventTargetInfoChanged struct {
    TargetInfo *Info `json:"targetInfo"`
}

EventTargetInfoChanged issued when some information about a target has changed. This only happens between targetCreated and targetDestroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#event-targetInfoChanged

func (EventTargetInfoChanged) MarshalEasyJSON Uses

func (v EventTargetInfoChanged) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventTargetInfoChanged) MarshalJSON Uses

func (v EventTargetInfoChanged) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventTargetInfoChanged) UnmarshalEasyJSON Uses

func (v *EventTargetInfoChanged) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventTargetInfoChanged) UnmarshalJSON Uses

func (v *EventTargetInfoChanged) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ExposeDevToolsProtocolParams Uses

type ExposeDevToolsProtocolParams struct {
    TargetID    ID     `json:"targetId"`
    BindingName string `json:"bindingName,omitempty"` // Binding name, 'cdp' if not specified.
}

ExposeDevToolsProtocolParams inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as window[bindingName]. The object has the follwing API: - binding.send(json) - a method to send messages over the remote debugging protocol - binding.onmessage = json => handleMessage(json) - a callback that will be called for the protocol notifications and command responses.

func ExposeDevToolsProtocol Uses

func ExposeDevToolsProtocol(targetID ID) *ExposeDevToolsProtocolParams

ExposeDevToolsProtocol inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as window[bindingName]. The object has the follwing API: - binding.send(json) - a method to send messages over the remote debugging protocol - binding.onmessage = json => handleMessage(json) - a callback that will be called for the protocol notifications and command responses.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-exposeDevToolsProtocol

parameters:

targetID

func (*ExposeDevToolsProtocolParams) Do Uses

func (p *ExposeDevToolsProtocolParams) Do(ctx context.Context) (err error)

Do executes Target.exposeDevToolsProtocol against the provided context.

func (ExposeDevToolsProtocolParams) MarshalEasyJSON Uses

func (v ExposeDevToolsProtocolParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ExposeDevToolsProtocolParams) MarshalJSON Uses

func (v ExposeDevToolsProtocolParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ExposeDevToolsProtocolParams) UnmarshalEasyJSON Uses

func (v *ExposeDevToolsProtocolParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ExposeDevToolsProtocolParams) UnmarshalJSON Uses

func (v *ExposeDevToolsProtocolParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (ExposeDevToolsProtocolParams) WithBindingName Uses

func (p ExposeDevToolsProtocolParams) WithBindingName(bindingName string) *ExposeDevToolsProtocolParams

WithBindingName binding name, 'cdp' if not specified.

type GetBrowserContextsParams Uses

type GetBrowserContextsParams struct{}

GetBrowserContextsParams returns all browser contexts created with Target.createBrowserContext method.

func GetBrowserContexts Uses

func GetBrowserContexts() *GetBrowserContextsParams

GetBrowserContexts returns all browser contexts created with Target.createBrowserContext method.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-getBrowserContexts

func (*GetBrowserContextsParams) Do Uses

func (p *GetBrowserContextsParams) Do(ctx context.Context) (browserContextIds []cdp.BrowserContextID, err error)

Do executes Target.getBrowserContexts against the provided context.

returns:

browserContextIds - An array of browser context ids.

func (GetBrowserContextsParams) MarshalEasyJSON Uses

func (v GetBrowserContextsParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetBrowserContextsParams) MarshalJSON Uses

func (v GetBrowserContextsParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetBrowserContextsParams) UnmarshalEasyJSON Uses

func (v *GetBrowserContextsParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetBrowserContextsParams) UnmarshalJSON Uses

func (v *GetBrowserContextsParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetBrowserContextsReturns Uses

type GetBrowserContextsReturns struct {
    BrowserContextIds []cdp.BrowserContextID `json:"browserContextIds,omitempty"` // An array of browser context ids.
}

GetBrowserContextsReturns return values.

func (GetBrowserContextsReturns) MarshalEasyJSON Uses

func (v GetBrowserContextsReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetBrowserContextsReturns) MarshalJSON Uses

func (v GetBrowserContextsReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetBrowserContextsReturns) UnmarshalEasyJSON Uses

func (v *GetBrowserContextsReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetBrowserContextsReturns) UnmarshalJSON Uses

func (v *GetBrowserContextsReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetTargetInfoParams Uses

type GetTargetInfoParams struct {
    TargetID ID `json:"targetId,omitempty"`
}

GetTargetInfoParams returns information about a target.

func GetTargetInfo Uses

func GetTargetInfo() *GetTargetInfoParams

GetTargetInfo returns information about a target.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-getTargetInfo

parameters:

func (*GetTargetInfoParams) Do Uses

func (p *GetTargetInfoParams) Do(ctx context.Context) (targetInfo *Info, err error)

Do executes Target.getTargetInfo against the provided context.

returns:

targetInfo

func (GetTargetInfoParams) MarshalEasyJSON Uses

func (v GetTargetInfoParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetTargetInfoParams) MarshalJSON Uses

func (v GetTargetInfoParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetTargetInfoParams) UnmarshalEasyJSON Uses

func (v *GetTargetInfoParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetTargetInfoParams) UnmarshalJSON Uses

func (v *GetTargetInfoParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (GetTargetInfoParams) WithTargetID Uses

func (p GetTargetInfoParams) WithTargetID(targetID ID) *GetTargetInfoParams

WithTargetID [no description].

type GetTargetInfoReturns Uses

type GetTargetInfoReturns struct {
    TargetInfo *Info `json:"targetInfo,omitempty"`
}

GetTargetInfoReturns return values.

func (GetTargetInfoReturns) MarshalEasyJSON Uses

func (v GetTargetInfoReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetTargetInfoReturns) MarshalJSON Uses

func (v GetTargetInfoReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetTargetInfoReturns) UnmarshalEasyJSON Uses

func (v *GetTargetInfoReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetTargetInfoReturns) UnmarshalJSON Uses

func (v *GetTargetInfoReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetTargetsParams Uses

type GetTargetsParams struct{}

GetTargetsParams retrieves a list of available targets.

func GetTargets Uses

func GetTargets() *GetTargetsParams

GetTargets retrieves a list of available targets.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-getTargets

func (*GetTargetsParams) Do Uses

func (p *GetTargetsParams) Do(ctx context.Context) (targetInfos []*Info, err error)

Do executes Target.getTargets against the provided context.

returns:

targetInfos - The list of targets.

func (GetTargetsParams) MarshalEasyJSON Uses

func (v GetTargetsParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetTargetsParams) MarshalJSON Uses

func (v GetTargetsParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetTargetsParams) UnmarshalEasyJSON Uses

func (v *GetTargetsParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetTargetsParams) UnmarshalJSON Uses

func (v *GetTargetsParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetTargetsReturns Uses

type GetTargetsReturns struct {
    TargetInfos []*Info `json:"targetInfos,omitempty"` // The list of targets.
}

GetTargetsReturns return values.

func (GetTargetsReturns) MarshalEasyJSON Uses

func (v GetTargetsReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetTargetsReturns) MarshalJSON Uses

func (v GetTargetsReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetTargetsReturns) UnmarshalEasyJSON Uses

func (v *GetTargetsReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetTargetsReturns) UnmarshalJSON Uses

func (v *GetTargetsReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ID Uses

type ID string

ID [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-TargetID

func (ID) String Uses

func (t ID) String() string

String returns the ID as string value.

type Info Uses

type Info struct {
    TargetID         ID                   `json:"targetId"`
    Type             string               `json:"type"`
    Title            string               `json:"title"`
    URL              string               `json:"url"`
    Attached         bool                 `json:"attached"`                // Whether the target has an attached client.
    OpenerID         ID                   `json:"openerId,omitempty"`      // Opener target Id
    CanAccessOpener  bool                 `json:"canAccessOpener"`         // Whether the target has access to the originating window.
    OpenerFrameID    cdp.FrameID          `json:"openerFrameId,omitempty"` // Frame id of originating window (is only set if target has an opener).
    BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"`
}

Info [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-TargetInfo

func (Info) MarshalEasyJSON Uses

func (v Info) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Info) MarshalJSON Uses

func (v Info) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Info) UnmarshalEasyJSON Uses

func (v *Info) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Info) UnmarshalJSON Uses

func (v *Info) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RemoteLocation Uses

type RemoteLocation struct {
    Host string `json:"host"`
    Port int64  `json:"port"`
}

RemoteLocation [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-RemoteLocation

func (RemoteLocation) MarshalEasyJSON Uses

func (v RemoteLocation) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (RemoteLocation) MarshalJSON Uses

func (v RemoteLocation) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*RemoteLocation) UnmarshalEasyJSON Uses

func (v *RemoteLocation) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*RemoteLocation) UnmarshalJSON Uses

func (v *RemoteLocation) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SessionID Uses

type SessionID string

SessionID unique identifier of attached debugging session.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-SessionID

func (SessionID) String Uses

func (t SessionID) String() string

String returns the SessionID as string value.

type SetAutoAttachParams Uses

type SetAutoAttachParams struct {
    AutoAttach             bool `json:"autoAttach"`             // Whether to auto-attach to related targets.
    WaitForDebuggerOnStart bool `json:"waitForDebuggerOnStart"` // Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets.
    Flatten                bool `json:"flatten,omitempty"`      // Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.
}

SetAutoAttachParams controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets.

func SetAutoAttach Uses

func SetAutoAttach(autoAttach bool, waitForDebuggerOnStart bool) *SetAutoAttachParams

SetAutoAttach controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-setAutoAttach

parameters:

autoAttach - Whether to auto-attach to related targets.
waitForDebuggerOnStart - Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets.

func (*SetAutoAttachParams) Do Uses

func (p *SetAutoAttachParams) Do(ctx context.Context) (err error)

Do executes Target.setAutoAttach against the provided context.

func (SetAutoAttachParams) MarshalEasyJSON Uses

func (v SetAutoAttachParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SetAutoAttachParams) MarshalJSON Uses

func (v SetAutoAttachParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SetAutoAttachParams) UnmarshalEasyJSON Uses

func (v *SetAutoAttachParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SetAutoAttachParams) UnmarshalJSON Uses

func (v *SetAutoAttachParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (SetAutoAttachParams) WithFlatten Uses

func (p SetAutoAttachParams) WithFlatten(flatten bool) *SetAutoAttachParams

WithFlatten enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.

type SetDiscoverTargetsParams Uses

type SetDiscoverTargetsParams struct {
    Discover bool `json:"discover"` // Whether to discover available targets.
}

SetDiscoverTargetsParams controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyed events.

func SetDiscoverTargets Uses

func SetDiscoverTargets(discover bool) *SetDiscoverTargetsParams

SetDiscoverTargets controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyed events.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-setDiscoverTargets

parameters:

discover - Whether to discover available targets.

func (*SetDiscoverTargetsParams) Do Uses

func (p *SetDiscoverTargetsParams) Do(ctx context.Context) (err error)

Do executes Target.setDiscoverTargets against the provided context.

func (SetDiscoverTargetsParams) MarshalEasyJSON Uses

func (v SetDiscoverTargetsParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SetDiscoverTargetsParams) MarshalJSON Uses

func (v SetDiscoverTargetsParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SetDiscoverTargetsParams) UnmarshalEasyJSON Uses

func (v *SetDiscoverTargetsParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SetDiscoverTargetsParams) UnmarshalJSON Uses

func (v *SetDiscoverTargetsParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SetRemoteLocationsParams Uses

type SetRemoteLocationsParams struct {
    Locations []*RemoteLocation `json:"locations"` // List of remote locations.
}

SetRemoteLocationsParams enables target discovery for the specified locations, when setDiscoverTargets was set to true.

func SetRemoteLocations Uses

func SetRemoteLocations(locations []*RemoteLocation) *SetRemoteLocationsParams

SetRemoteLocations enables target discovery for the specified locations, when setDiscoverTargets was set to true.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-setRemoteLocations

parameters:

locations - List of remote locations.

func (*SetRemoteLocationsParams) Do Uses

func (p *SetRemoteLocationsParams) Do(ctx context.Context) (err error)

Do executes Target.setRemoteLocations against the provided context.

func (SetRemoteLocationsParams) MarshalEasyJSON Uses

func (v SetRemoteLocationsParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SetRemoteLocationsParams) MarshalJSON Uses

func (v SetRemoteLocationsParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SetRemoteLocationsParams) UnmarshalEasyJSON Uses

func (v *SetRemoteLocationsParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SetRemoteLocationsParams) UnmarshalJSON Uses

func (v *SetRemoteLocationsParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Package target imports 6 packages (graph) and is imported by 15 packages. Updated 2021-01-06. Refresh now. Tools for package owners.