puppeteer/new-docs/puppeteer.protocol.dom.md
2020-07-13 14:01:35 +01:00

9.3 KiB

Home > puppeteer > Protocol > DOM

Protocol.DOM namespace

This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id. This id can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client.

Note that iframe owner elements will return corresponding document elements as their child nodes.

Signature:

export namespace DOM 

Interfaces

Interface Description
AttributeModifiedEvent Fired when Element's attribute is modified.
AttributeRemovedEvent Fired when Element's attribute is removed.
BackendNode Backend node with a friendly name.
BoxModel Box model.
CharacterDataModifiedEvent Mirrors DOMCharacterDataModified event.
ChildNodeCountUpdatedEvent Fired when Container's child node count has changed.
ChildNodeInsertedEvent Mirrors DOMNodeInserted event.
ChildNodeRemovedEvent Mirrors DOMNodeRemoved event.
CollectClassNamesFromSubtreeRequest
CollectClassNamesFromSubtreeResponse
CopyToRequest
CopyToResponse
DescribeNodeRequest
DescribeNodeResponse
DiscardSearchResultsRequest
DistributedNodesUpdatedEvent Called when distrubution is changed.
FocusRequest
GetAttributesRequest
GetAttributesResponse
GetBoxModelRequest
GetBoxModelResponse
GetContentQuadsRequest
GetContentQuadsResponse
GetDocumentRequest
GetDocumentResponse
GetFileInfoRequest
GetFileInfoResponse
GetFlattenedDocumentRequest
GetFlattenedDocumentResponse
GetFrameOwnerRequest
GetFrameOwnerResponse
GetNodeForLocationRequest
GetNodeForLocationResponse
GetNodeStackTracesRequest
GetNodeStackTracesResponse
GetOuterHTMLRequest
GetOuterHTMLResponse
GetRelayoutBoundaryRequest
GetRelayoutBoundaryResponse
GetSearchResultsRequest
GetSearchResultsResponse
InlineStyleInvalidatedEvent Fired when Element's inline style is modified via a CSS property modification.
MoveToRequest
MoveToResponse
Node DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
PerformSearchRequest
PerformSearchResponse
PseudoElementAddedEvent Called when a pseudo element is added to an element.
PseudoElementRemovedEvent Called when a pseudo element is removed from an element.
PushNodeByPathToFrontendRequest
PushNodeByPathToFrontendResponse
PushNodesByBackendIdsToFrontendRequest
PushNodesByBackendIdsToFrontendResponse
QuerySelectorAllRequest
QuerySelectorAllResponse
QuerySelectorRequest
QuerySelectorResponse
Rect Rectangle.
RemoveAttributeRequest
RemoveNodeRequest
RequestChildNodesRequest
RequestNodeRequest
RequestNodeResponse
ResolveNodeRequest
ResolveNodeResponse
RGBA A structure holding an RGBA color.
ScrollIntoViewIfNeededRequest
SetAttributesAsTextRequest
SetAttributeValueRequest
SetChildNodesEvent Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
SetFileInputFilesRequest
SetInspectedNodeRequest
SetNodeNameRequest
SetNodeNameResponse
SetNodeStackTracesEnabledRequest
SetNodeValueRequest
SetOuterHTMLRequest
ShadowRootPoppedEvent Called when shadow root is popped from the element.
ShadowRootPushedEvent Called when shadow root is pushed into the element.
ShapeOutsideInfo CSS Shape Outside details.

Type Aliases

Type Alias Description
BackendNodeId Unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
NodeId Unique DOM node identifier.
PseudoType Pseudo element type.
Quad An array of quad vertices, x immediately followed by y for each point, points clock-wise.
ShadowRootType Shadow root type.