C

开发协议Chrome DevTools Protocol

0.00

★13次@Google

A:赛忞初雪

上架: 2025-08-12 18:14:16

开发协议Chrome DevTools Protocol

         收藏
 

四方仙域传送阵         

DOM Domain

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.

Methods

DOM.describeNode

DOM.disable

DOM.enable

DOM.focus

DOM.getAttributes

DOM.getBoxModel

DOM.getDocument

DOM.getNodeForLocation

DOM.getOuterHTML

DOM.hideHighlight

DOM.highlightNode

DOM.highlightRect

DOM.moveTo

DOM.querySelector

DOM.querySelectorAll

DOM.removeAttribute

DOM.removeNode

DOM.requestChildNodes

DOM.requestNode

DOM.resolveNode

DOM.scrollIntoViewIfNeeded

DOM.setAttributesAsText

DOM.setAttributeValue

DOM.setFileInputFiles

DOM.setNodeName

DOM.setNodeValue

DOM.setOuterHTML

DOM.getFlattenedDocument Deprecated

DOM.collectClassNamesFromSubtree Experimental

DOM.copyTo Experimental

DOM.discardSearchResults Experimental

DOM.forceShowPopover Experimental

DOM.getAnchorElement Experimental

DOM.getContainerForNode Experimental

DOM.getContentQuads Experimental

DOM.getDetachedDomNodes Experimental

DOM.getElementByRelation Experimental

DOM.getFileInfo Experimental

DOM.getFrameOwner Experimental

DOM.getNodesForSubtreeByStyle Experimental

DOM.getNodeStackTraces Experimental

DOM.getQueryingDescendantsForContainer Experimental

DOM.getRelayoutBoundary Experimental

DOM.getSearchResults Experimental

DOM.getTopLayerElements Experimental

DOM.markUndoableState Experimental

DOM.performSearch Experimental

DOM.pushNodeByPathToFrontend Experimental

DOM.pushNodesByBackendIdsToFrontend Experimental

DOM.redo Experimental

DOM.setInspectedNode Experimental

DOM.setNodeStackTracesEnabled Experimental

DOM.undo Experimental

Events

DOM.attributeModified

DOM.attributeRemoved

DOM.characterDataModified

DOM.childNodeCountUpdated

DOM.childNodeInserted

DOM.childNodeRemoved

DOM.documentUpdated

DOM.setChildNodes

DOM.distributedNodesUpdated Experimental

DOM.inlineStyleInvalidated Experimental

DOM.pseudoElementAdded Experimental

DOM.pseudoElementRemoved Experimental

DOM.scrollableFlagUpdated Experimental

DOM.shadowRootPopped Experimental

DOM.shadowRootPushed Experimental

DOM.topLayerElementsUpdated Experimental

Types

DOM.BackendNode

DOM.BackendNodeId

DOM.BoxModel

DOM.CompatibilityMode

DOM.CSSComputedStyleProperty

DOM.DetachedElementInfo

DOM.LogicalAxes

DOM.Node

DOM.NodeId

DOM.PhysicalAxes

DOM.PseudoType

DOM.Quad

DOM.Rect

DOM.RGBA

DOM.ScrollOrientation

DOM.ShadowRootType

DOM.ShapeOutsideInfo

Methods

DOM.describeNode 

Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.

parameters
  • nodeId

  • NodeId

    Identifier of the node.

  • backendNodeId

  • BackendNodeId

    Identifier of the backend node.

  • objectId

  • Runtime.RemoteObjectId

    JavaScript object id of the node wrapper.

  • depth

  • integer

    The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.

  • pierce

  • boolean

    Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).

Return Object
  • node

  • Node

    Node description.

DOM.disable 

Disables DOM agent for the given page.

DOM.enable 

Enables DOM agent for the given page.

parameters
  • includeWhitespace

  • string

    Whether to include whitespaces in the children array of returned Nodes.

    Allowed Values: noneall

    Experimental

DOM.focus 

Focuses the given element.

parameters

DOM.getAttributes 

Returns attributes for the specified node.

parameters
  • nodeId

  • NodeId

    Id of the node to retrieve attributes for.

Return Object
  • attributes

  • arraystring ]

    An interleaved array of node attribute names and values.

DOM.getBoxModel 

Returns boxes for the given node.

parameters
Return Object

DOM.getDocument 

Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.

parameters
  • depth

  • integer

    The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.

  • pierce

  • boolean

    Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).

Return Object
  • root

  • Node

    Resulting node.

DOM.getNodeForLocation 

Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.

parameters
  • x

  • integer

    X coordinate.

  • y

  • integer

    Y coordinate.

  • includeUserAgentShadowDOM

  • boolean

    False to skip to the nearest non-UA shadow root ancestor (default: false).

  • ignorePointerEventsNone

  • boolean

    Whether to ignore pointer-events: none on elements and hit test them.

Return Object
  • backendNodeId

  • BackendNodeId

    Resulting node.

  • frameId

  • Page.FrameId

    Frame this node belongs to.

  • nodeId

  • NodeId

    Id of the node at given coordinates, only when enabled and requested document.

DOM.getOuterHTML 

Returns node's HTML markup.

parameters
  • nodeId

  • NodeId

    Identifier of the node.

  • backendNodeId

  • BackendNodeId

    Identifier of the backend node.

  • objectId

  • Runtime.RemoteObjectId

    JavaScript object id of the node wrapper.

  • includeShadowDOM

  • boolean

    Include all shadow roots. Equals to false if not specified.

     

    Experimental

Return Object
  • outerHTML

  • string

    Outer HTML markup.

DOM.hideHighlight 

Hides any highlight.

DOM.highlightNode 

Highlights DOM node.

DOM.highlightRect 

Highlights given rectangle.

DOM.moveTo 

Moves node into the new container, places it before the given anchor.

parameters
  • nodeId

  • NodeId

    Id of the node to move.

  • targetNodeId

  • NodeId

    Id of the element to drop the moved node into.

  • insertBeforeNodeId

  • NodeId

    Drop node before this one (if absent, the moved node becomes the last child of targetNodeId).

Return Object
  • nodeId

  • NodeId

    New id of the moved node.

DOM.querySelector 

Executes querySelector on a given node.

parameters
  • nodeId

  • NodeId

    Id of the node to query upon.

  • selector

  • string

    Selector string.

Return Object
  • nodeId

  • NodeId

    Query selector result.

DOM.querySelectorAll 

Executes querySelectorAll on a given node.

parameters
  • nodeId

  • NodeId

    Id of the node to query upon.

  • selector

  • string

    Selector string.

Return Object
  • nodeIds

  • arrayNodeId ]

    Query selector result.

DOM.removeAttribute 

Removes attribute with given name from an element with given id.

parameters
  • nodeId

  • NodeId

    Id of the element to remove attribute from.

  • name

  • string

    Name of the attribute to remove.

DOM.removeNode 

Removes node with given id.

parameters
  • nodeId

  • NodeId

    Id of the node to remove.

DOM.requestChildNodes 

Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.

parameters
  • nodeId

  • NodeId

    Id of the node to get children for.

  • depth

  • integer

    The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.

  • pierce

  • boolean

    Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).

DOM.requestNode 

Requests that the node is sent to the caller given the JavaScript node object reference. All no

硬件app