domsnapshot

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2017 License: MIT Imports: 6 Imported by: 6

Documentation

Overview

Package domsnapshot implements the DOMSnapshot domain. This domain facilitates obtaining document snapshots with DOM, layout, and style information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the DOMSnapshot domain with the connection set to conn.

Types

type ComputedStyle

type ComputedStyle struct {
	Properties []NameValue `json:"properties"` // Name/value pairs of computed style properties.
}

ComputedStyle A subset of the full ComputedStyle as defined by the request whitelist.

type DOMNode

type DOMNode struct {
	NodeType              int               `json:"nodeType"`                        // Node's nodeType.
	NodeName              string            `json:"nodeName"`                        // Node's nodeName.
	NodeValue             string            `json:"nodeValue"`                       // Node's nodeValue.
	BackendNodeID         dom.BackendNodeID `json:"backendNodeId"`                   // Node's id, corresponds to DOM.Node.backendNodeId.
	ChildNodeIndexes      []int             `json:"childNodeIndexes,omitempty"`      // The indexes of the node's child nodes in the domNodes array returned by getSnapshot, if any.
	Attributes            []NameValue       `json:"attributes,omitempty"`            // Attributes of an Element node.
	PseudoElementIndexes  []int             `json:"pseudoElementIndexes,omitempty"`  // Indexes of pseudo elements associated with this node in the domNodes array returned by getSnapshot, if any.
	LayoutNodeIndex       *int              `json:"layoutNodeIndex,omitempty"`       // The index of the node's related layout tree node in the layoutTreeNodes array returned by getSnapshot, if any.
	DocumentURL           *string           `json:"documentURL,omitempty"`           // Document URL that Document or FrameOwner node points to.
	BaseURL               *string           `json:"baseURL,omitempty"`               // Base URL that Document or FrameOwner node uses for URL completion.
	ContentLanguage       *string           `json:"contentLanguage,omitempty"`       // Only set for documents, contains the document's content language.
	PublicID              *string           `json:"publicId,omitempty"`              // DocumentType node's publicId.
	SystemID              *string           `json:"systemId,omitempty"`              // DocumentType node's systemId.
	FrameID               *page.FrameID     `json:"frameId,omitempty"`               // Frame ID for frame owner elements.
	ContentDocumentIndex  *int              `json:"contentDocumentIndex,omitempty"`  // The index of a frame owner element's content document in the domNodes array returned by getSnapshot, if any.
	ImportedDocumentIndex *int              `json:"importedDocumentIndex,omitempty"` // Index of the imported document's node of a link element in the domNodes array returned by getSnapshot, if any.
	TemplateContentIndex  *int              `json:"templateContentIndex,omitempty"`  // Index of the content node of a template element in the domNodes array returned by getSnapshot.
	PseudoType            *dom.PseudoType   `json:"pseudoType,omitempty"`            // Type of a pseudo element node.
	IsClickable           *bool             `json:"isClickable,omitempty"`           // Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked.
}

DOMNode A Node in the DOM tree.

type GetSnapshotArgs

type GetSnapshotArgs struct {
	ComputedStyleWhitelist []string `json:"computedStyleWhitelist"` // Whitelist of computed styles to return.
}

GetSnapshotArgs represents the arguments for GetSnapshot in the DOMSnapshot domain.

func NewGetSnapshotArgs

func NewGetSnapshotArgs(computedStyleWhitelist []string) *GetSnapshotArgs

NewGetSnapshotArgs initializes GetSnapshotArgs with the required arguments.

type GetSnapshotReply

type GetSnapshotReply struct {
	DOMNodes        []DOMNode        `json:"domNodes"`        // The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
	LayoutTreeNodes []LayoutTreeNode `json:"layoutTreeNodes"` // The nodes in the layout tree.
	ComputedStyles  []ComputedStyle  `json:"computedStyles"`  // Whitelisted ComputedStyle properties for each node in the layout tree.
}

GetSnapshotReply represents the return values for GetSnapshot in the DOMSnapshot domain.

type LayoutTreeNode

type LayoutTreeNode struct {
	DOMNodeIndex    int                 `json:"domNodeIndex"`              // The index of the related DOM node in the domNodes array returned by getSnapshot.
	BoundingBox     dom.Rect            `json:"boundingBox"`               // The absolute position bounding box.
	LayoutText      *string             `json:"layoutText,omitempty"`      // Contents of the LayoutText, if any.
	InlineTextNodes []css.InlineTextBox `json:"inlineTextNodes,omitempty"` // The post-layout inline text nodes, if any.
	StyleIndex      *int                `json:"styleIndex,omitempty"`      // Index into the computedStyles array returned by getSnapshot.
}

LayoutTreeNode Details of an element in the DOM tree with a LayoutObject.

type NameValue

type NameValue struct {
	Name  string `json:"name"`  // Attribute/property name.
	Value string `json:"value"` // Attribute/property value.
}

NameValue A name/value pair.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL