Documentation ¶
Overview ¶
Package overlay implements the Overlay domain. This domain provides various functionality related to drawing atop the inspected page.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type GetHighlightObjectForTestArgs
- type GetHighlightObjectForTestReply
- type HighlightConfig
- type HighlightFrameArgs
- type HighlightNodeArgs
- type HighlightQuadArgs
- type HighlightRectArgs
- type InspectMode
- type InspectNodeRequestedClient
- type InspectNodeRequestedReply
- type NodeHighlightRequestedClient
- type NodeHighlightRequestedReply
- type ScreenshotRequestedClient
- type ScreenshotRequestedReply
- type SetInspectModeArgs
- type SetPausedInDebuggerMessageArgs
- type SetShowDebugBordersArgs
- type SetShowFPSCounterArgs
- type SetShowPaintRectsArgs
- type SetShowScrollBottleneckRectsArgs
- type SetShowViewportSizeOnResizeArgs
- type SetSuspendedArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GetHighlightObjectForTestArgs ¶
type GetHighlightObjectForTestArgs struct {
NodeID dom.NodeID `json:"nodeId"` // Id of the node to get highlight object for.
}
GetHighlightObjectForTestArgs represents the arguments for GetHighlightObjectForTest in the Overlay domain.
func NewGetHighlightObjectForTestArgs ¶
func NewGetHighlightObjectForTestArgs(nodeID dom.NodeID) *GetHighlightObjectForTestArgs
NewGetHighlightObjectForTestArgs initializes GetHighlightObjectForTestArgs with the required arguments.
type GetHighlightObjectForTestReply ¶
type GetHighlightObjectForTestReply struct {
Highlight json.RawMessage `json:"highlight"` // Highlight data for the node.
}
GetHighlightObjectForTestReply represents the return values for GetHighlightObjectForTest in the Overlay domain.
type HighlightConfig ¶
type HighlightConfig struct { 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). ShowExtensionLines *bool `json:"showExtensionLines,omitempty"` // Whether the extension lines from node to the rulers should be shown (default: false). DisplayAsMaterial *bool `json:"displayAsMaterial,omitempty"` // No description. ContentColor *dom.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent). PaddingColor *dom.RGBA `json:"paddingColor,omitempty"` // The padding highlight fill color (default: transparent). BorderColor *dom.RGBA `json:"borderColor,omitempty"` // The border highlight fill color (default: transparent). MarginColor *dom.RGBA `json:"marginColor,omitempty"` // The margin highlight fill color (default: transparent). EventTargetColor *dom.RGBA `json:"eventTargetColor,omitempty"` // The event target element highlight fill color (default: transparent). ShapeColor *dom.RGBA `json:"shapeColor,omitempty"` // The shape outside fill color (default: transparent). ShapeMarginColor *dom.RGBA `json:"shapeMarginColor,omitempty"` // The shape margin fill color (default: transparent). SelectorList *string `json:"selectorList,omitempty"` // Selectors to highlight relevant nodes. }
HighlightConfig Configuration data for the highlighting of page elements.
type HighlightFrameArgs ¶
type HighlightFrameArgs struct { FrameID page.FrameID `json:"frameId"` // Identifier of the frame to highlight. ContentColor *dom.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent). ContentOutlineColor *dom.RGBA `json:"contentOutlineColor,omitempty"` // The content box highlight outline color (default: transparent). }
HighlightFrameArgs represents the arguments for HighlightFrame in the Overlay domain.
func NewHighlightFrameArgs ¶
func NewHighlightFrameArgs(frameID page.FrameID) *HighlightFrameArgs
NewHighlightFrameArgs initializes HighlightFrameArgs with the required arguments.
func (*HighlightFrameArgs) SetContentColor ¶
func (a *HighlightFrameArgs) SetContentColor(contentColor dom.RGBA) *HighlightFrameArgs
SetContentColor sets the ContentColor optional argument. The content box highlight fill color (default: transparent).
func (*HighlightFrameArgs) SetContentOutlineColor ¶
func (a *HighlightFrameArgs) SetContentOutlineColor(contentOutlineColor dom.RGBA) *HighlightFrameArgs
SetContentOutlineColor sets the ContentOutlineColor optional argument. The content box highlight outline color (default: transparent).
type HighlightNodeArgs ¶
type HighlightNodeArgs struct { HighlightConfig HighlightConfig `json:"highlightConfig"` // A descriptor for the highlight appearance. NodeID *dom.NodeID `json:"nodeId,omitempty"` // Identifier of the node to highlight. BackendNodeID *dom.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node to highlight. ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node to be highlighted. }
HighlightNodeArgs represents the arguments for HighlightNode in the Overlay domain.
func NewHighlightNodeArgs ¶
func NewHighlightNodeArgs(highlightConfig HighlightConfig) *HighlightNodeArgs
NewHighlightNodeArgs initializes HighlightNodeArgs with the required arguments.
func (*HighlightNodeArgs) SetBackendNodeID ¶
func (a *HighlightNodeArgs) SetBackendNodeID(backendNodeID dom.BackendNodeID) *HighlightNodeArgs
SetBackendNodeID sets the BackendNodeID optional argument. Identifier of the backend node to highlight.
func (*HighlightNodeArgs) SetNodeID ¶
func (a *HighlightNodeArgs) SetNodeID(nodeID dom.NodeID) *HighlightNodeArgs
SetNodeID sets the NodeID optional argument. Identifier of the node to highlight.
func (*HighlightNodeArgs) SetObjectID ¶
func (a *HighlightNodeArgs) SetObjectID(objectID runtime.RemoteObjectID) *HighlightNodeArgs
SetObjectID sets the ObjectID optional argument. JavaScript object id of the node to be highlighted.
type HighlightQuadArgs ¶
type HighlightQuadArgs struct { Quad dom.Quad `json:"quad"` // Quad to highlight Color *dom.RGBA `json:"color,omitempty"` // The highlight fill color (default: transparent). OutlineColor *dom.RGBA `json:"outlineColor,omitempty"` // The highlight outline color (default: transparent). }
HighlightQuadArgs represents the arguments for HighlightQuad in the Overlay domain.
func NewHighlightQuadArgs ¶
func NewHighlightQuadArgs(quad dom.Quad) *HighlightQuadArgs
NewHighlightQuadArgs initializes HighlightQuadArgs with the required arguments.
func (*HighlightQuadArgs) SetColor ¶
func (a *HighlightQuadArgs) SetColor(color dom.RGBA) *HighlightQuadArgs
SetColor sets the Color optional argument. The highlight fill color (default: transparent).
func (*HighlightQuadArgs) SetOutlineColor ¶
func (a *HighlightQuadArgs) SetOutlineColor(outlineColor dom.RGBA) *HighlightQuadArgs
SetOutlineColor sets the OutlineColor optional argument. The highlight outline color (default: transparent).
type HighlightRectArgs ¶
type HighlightRectArgs struct { X int `json:"x"` // X coordinate Y int `json:"y"` // Y coordinate Width int `json:"width"` // Rectangle width Height int `json:"height"` // Rectangle height Color *dom.RGBA `json:"color,omitempty"` // The highlight fill color (default: transparent). OutlineColor *dom.RGBA `json:"outlineColor,omitempty"` // The highlight outline color (default: transparent). }
HighlightRectArgs represents the arguments for HighlightRect in the Overlay domain.
func NewHighlightRectArgs ¶
func NewHighlightRectArgs(x int, y int, width int, height int) *HighlightRectArgs
NewHighlightRectArgs initializes HighlightRectArgs with the required arguments.
func (*HighlightRectArgs) SetColor ¶
func (a *HighlightRectArgs) SetColor(color dom.RGBA) *HighlightRectArgs
SetColor sets the Color optional argument. The highlight fill color (default: transparent).
func (*HighlightRectArgs) SetOutlineColor ¶
func (a *HighlightRectArgs) SetOutlineColor(outlineColor dom.RGBA) *HighlightRectArgs
SetOutlineColor sets the OutlineColor optional argument. The highlight outline color (default: transparent).
type InspectMode ¶
type InspectMode int
InspectMode
const ( InspectModeNotSet InspectMode = iota InspectModeSearchForNode InspectModeSearchForUAShadowDOM InspectModeNone )
InspectMode as enums.
func (InspectMode) MarshalJSON ¶
func (e InspectMode) MarshalJSON() ([]byte, error)
MarshalJSON encodes enum into a string or null when not set.
func (InspectMode) String ¶
func (e InspectMode) String() string
func (*InspectMode) UnmarshalJSON ¶
func (e *InspectMode) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a string value into a enum.
type InspectNodeRequestedClient ¶
type InspectNodeRequestedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*InspectNodeRequestedReply, error) rpcc.Stream }
InspectNodeRequestedClient is a client for InspectNodeRequested events. Fired when the node should be inspected. This happens after call to setInspectMode or when user manually inspects an element.
type InspectNodeRequestedReply ¶
type InspectNodeRequestedReply struct {
BackendNodeID dom.BackendNodeID `json:"backendNodeId"` // Id of the node to inspect.
}
InspectNodeRequestedReply is the reply for InspectNodeRequested events.
type NodeHighlightRequestedClient ¶
type NodeHighlightRequestedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*NodeHighlightRequestedReply, error) rpcc.Stream }
NodeHighlightRequestedClient is a client for NodeHighlightRequested events. Fired when the node should be highlighted. This happens after call to setInspectMode.
type NodeHighlightRequestedReply ¶
NodeHighlightRequestedReply is the reply for NodeHighlightRequested events.
type ScreenshotRequestedClient ¶ added in v0.9.1
type ScreenshotRequestedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ScreenshotRequestedReply, error) rpcc.Stream }
ScreenshotRequestedClient is a client for ScreenshotRequested events. Fired when user asks to capture screenshot of some area on the page.
type ScreenshotRequestedReply ¶ added in v0.9.1
type ScreenshotRequestedReply struct {
Viewport page.Viewport `json:"viewport"` // Viewport to capture, in CSS.
}
ScreenshotRequestedReply is the reply for ScreenshotRequested events.
type SetInspectModeArgs ¶
type SetInspectModeArgs struct { Mode InspectMode `json:"mode"` // Set an inspection mode. HighlightConfig *HighlightConfig `json:"highlightConfig,omitempty"` // A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false. }
SetInspectModeArgs represents the arguments for SetInspectMode in the Overlay domain.
func NewSetInspectModeArgs ¶
func NewSetInspectModeArgs(mode InspectMode) *SetInspectModeArgs
NewSetInspectModeArgs initializes SetInspectModeArgs with the required arguments.
func (*SetInspectModeArgs) SetHighlightConfig ¶
func (a *SetInspectModeArgs) SetHighlightConfig(highlightConfig HighlightConfig) *SetInspectModeArgs
SetHighlightConfig sets the HighlightConfig optional argument. A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.
type SetPausedInDebuggerMessageArgs ¶
type SetPausedInDebuggerMessageArgs struct {
Message *string `json:"message,omitempty"` // The message to display, also triggers resume and step over controls.
}
SetPausedInDebuggerMessageArgs represents the arguments for SetPausedInDebuggerMessage in the Overlay domain.
func NewSetPausedInDebuggerMessageArgs ¶
func NewSetPausedInDebuggerMessageArgs() *SetPausedInDebuggerMessageArgs
NewSetPausedInDebuggerMessageArgs initializes SetPausedInDebuggerMessageArgs with the required arguments.
func (*SetPausedInDebuggerMessageArgs) SetMessage ¶
func (a *SetPausedInDebuggerMessageArgs) SetMessage(message string) *SetPausedInDebuggerMessageArgs
SetMessage sets the Message optional argument. The message to display, also triggers resume and step over controls.
type SetShowDebugBordersArgs ¶
type SetShowDebugBordersArgs struct {
Show bool `json:"show"` // True for showing debug borders
}
SetShowDebugBordersArgs represents the arguments for SetShowDebugBorders in the Overlay domain.
func NewSetShowDebugBordersArgs ¶
func NewSetShowDebugBordersArgs(show bool) *SetShowDebugBordersArgs
NewSetShowDebugBordersArgs initializes SetShowDebugBordersArgs with the required arguments.
type SetShowFPSCounterArgs ¶
type SetShowFPSCounterArgs struct {
Show bool `json:"show"` // True for showing the FPS counter
}
SetShowFPSCounterArgs represents the arguments for SetShowFPSCounter in the Overlay domain.
func NewSetShowFPSCounterArgs ¶
func NewSetShowFPSCounterArgs(show bool) *SetShowFPSCounterArgs
NewSetShowFPSCounterArgs initializes SetShowFPSCounterArgs with the required arguments.
type SetShowPaintRectsArgs ¶
type SetShowPaintRectsArgs struct {
Result bool `json:"result"` // True for showing paint rectangles
}
SetShowPaintRectsArgs represents the arguments for SetShowPaintRects in the Overlay domain.
func NewSetShowPaintRectsArgs ¶
func NewSetShowPaintRectsArgs(result bool) *SetShowPaintRectsArgs
NewSetShowPaintRectsArgs initializes SetShowPaintRectsArgs with the required arguments.
type SetShowScrollBottleneckRectsArgs ¶
type SetShowScrollBottleneckRectsArgs struct {
Show bool `json:"show"` // True for showing scroll bottleneck rects
}
SetShowScrollBottleneckRectsArgs represents the arguments for SetShowScrollBottleneckRects in the Overlay domain.
func NewSetShowScrollBottleneckRectsArgs ¶
func NewSetShowScrollBottleneckRectsArgs(show bool) *SetShowScrollBottleneckRectsArgs
NewSetShowScrollBottleneckRectsArgs initializes SetShowScrollBottleneckRectsArgs with the required arguments.
type SetShowViewportSizeOnResizeArgs ¶
type SetShowViewportSizeOnResizeArgs struct {
Show bool `json:"show"` // Whether to paint size or not.
}
SetShowViewportSizeOnResizeArgs represents the arguments for SetShowViewportSizeOnResize in the Overlay domain.
func NewSetShowViewportSizeOnResizeArgs ¶
func NewSetShowViewportSizeOnResizeArgs(show bool) *SetShowViewportSizeOnResizeArgs
NewSetShowViewportSizeOnResizeArgs initializes SetShowViewportSizeOnResizeArgs with the required arguments.
type SetSuspendedArgs ¶
type SetSuspendedArgs struct {
Suspended bool `json:"suspended"` // Whether overlay should be suspended and not consume any resources until resumed.
}
SetSuspendedArgs represents the arguments for SetSuspended in the Overlay domain.
func NewSetSuspendedArgs ¶
func NewSetSuspendedArgs(suspended bool) *SetSuspendedArgs
NewSetSuspendedArgs initializes SetSuspendedArgs with the required arguments.