Class DOM


  • public class DOM
    extends java.lang.Object
    Class created by Automatic Code-Generator.
    This class was built using the Chrome Remote Dev-Tools A.P.I., which is specified by two JSON-RPC Files. These files were obtained from the Chrome Dev Tools Protocol Git Hub Page, which has a "Tip of Tree" (the latest) API-Specification Page Here: JSON-RPC Protocol Specification.

    JSON-Viewable Google-API:
    These files may be viewed here: browser_protocol.json and js_protocol.json.
    These files were converted into this Java-Browser (CDT) Library; they are a Java-Alternative to the Node.js implementation.

    HTML-Viewable API:
    In addition to this Class-Library, these files were also converted to a simple HTML Page, which may be browsed here: Browser API Web-Page

    Node.js RDP-API Implementation:
    You may read about the Node.js Chrome Remote Interface on the Node.js Package Manager Web-Site: NPM
    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.


    This class is intended to be used with a Headless Browser

    These methods have been tested, to some degree, using Google Chrome. In order to use this class you must start a web-browser instance and make a connection to the browser using a Remote Debugging Port. The initializations may be accomplished using class BRDPC (Browser Remote Debug Protocol Connection).

    Google-Chrome was used during the development process of the classes in this particular package. Note that, lately, it has been asserted Microsoft has switched to using the Chrome-Engine for its Microsoft Edge Browser Internal Code-Base. Therefore, there may limited support / functionality when running the methods in this class with Microsoft-Edge. There is the possibility these will work with Opera & Safari.

    Check whether the your Web-Browser will allow itself to be driven by the Web-Socket RDP-Port 9223.


    Foreign Function API:
    Every one of the methods that reside in this class are designed to do nothing more than:

    1. Accept Parameters from the User, and "Marshall Them" into a Valid JSON-Request
    2. Transmit the Marshalled Request-JSON to a Headless Web-Browser over a Web-Socket RDP Connection
    3. Receive BOTH that Method's Results AND any Browser Event-Firings from the Web-Socket
    4. Parse JSON Method-Results and Browser-Event Firings, and Subsequently Convert them to Standard Java-Types
    5. Report these Method-Results and Browser-Events to the User via an User-Registered Event-Listener or a Promise Object


    Java-HTML Difference:
    Unlike the bulk of the Java HTML JAR Library, there is very little native Java-Code, and very little testing that may be done on any of the classes & methods in this package. The code inside these classes does nothing more than marshall-and-unmarshall Java-Types into Json-Requests (and vice-versa). The Java-Script & Browser modules inside of a Google-Chrome instance are, theoretically, handling these requests, and returning their results (or events) over the Web-Socket Connection.

    It has been asserted (by Google Chrome Developers) that some of these methods are only "partially working" or "experimental".



    Stateless Class:
    This class neither contains any program-state, nor can it be instantiated. The @StaticFunctional Annotation may also be called 'The Spaghetti Report'. Static-Functional classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's @Stateless Annotation.

    • 1 Constructor(s), 1 declared private, zero-argument constructor
    • 48 Method(s), 48 declared static
    • 8 Field(s), 8 declared static, 7 declared final
    • Fields excused from final modifier (with explanation):
      Field 'counter' is not final. Reason: CONFIGURATION


    • Field Summary

       
      DOM Domain Enumerated String Types
      Modifier and Type Field
      static String[] CompatibilityMode
      Document compatibility mode.
      static String[] PseudoType
      Pseudo element type.
      static String[] ShadowRootType
      Shadow root type.
    • Method Summary

       
      DOM Domain Commands
      Script Returns Modifier and Type Method
      String[] static Script<> collectClassNamesFromSubtree​(int nodeId)
      Collects class names for the node with given id and all of it's child nodes.
      Integer static Script<> copyTo​(int nodeId, int targetNodeId, Integer insertBeforeNodeId)
      Creates a deep copy of the specified node and places it into the target container before the given anchor.
      DOM.Node static Script<> describeNode​(Integer nodeId, Integer backendNodeId, String objectId, Integer depth, Boolean pierce)
      Describes node given its id, does not require domain to be enabled.
      NONE (void) static Script<> disable()
      Disables DOM agent for the given page.
      NONE (void) static Script<> discardSearchResults​(String searchId)
      Discards search results from the session with the given id.
      NONE (void) static Script<> enable()
      Enables DOM agent for the given page.
      NONE (void) static Script<> focus​(Integer nodeId, Integer backendNodeId, String objectId)
      Focuses the given element.
      String[] static Script<> getAttributes​(int nodeId)
      Returns attributes for the specified node.
      DOM.BoxModel static Script<> getBoxModel​(Integer nodeId, Integer backendNodeId, String objectId)
      Returns boxes for the given node.
      Integer static Script<> getContainerForNode​(int nodeId, String containerName)
      Returns the container of the given node based on container query conditions.
      Number[][] static Script<> getContentQuads​(Integer nodeId, Integer backendNodeId, String objectId)
      Returns quads that describe node position on the page.
      DOM.Node static Script<> getDocument​(Integer depth, Boolean pierce)
      Returns the root DOM node (and optionally the subtree) to the caller.
      String static Script<> getFileInfo​(String objectId)
      Returns file information for the given File wrapper.
      DOM.Node[] static Script<> getFlattenedDocument​(Integer depth, Boolean pierce)
      Returns the root DOM node (and optionally the subtree) to the caller.
      Ret2<Integer,
           ​Integer>
      static Script<> getFrameOwner​(String frameId)
      Returns iframe node that owns iframe with the given domain.
      Ret3<Integer,
           ​String,
           ​Integer>
      static Script<> getNodeForLocation​(int x, int y, Boolean includeUserAgentShadowDOM, Boolean ignorePointerEventsNone)
      Returns node id at given location.
      int[] static Script<> getNodesForSubtreeByStyle​(int nodeId, DOM.CSSComputedStyleProperty[] computedStyles, Boolean pierce)
      Finds nodes with a given computed style in a subtree.
      RunTime.StackTrace static Script<> getNodeStackTraces​(int nodeId)
      Gets stack traces associated with a Node.
      String static Script<> getOuterHTML​(Integer nodeId, Integer backendNodeId, String objectId)
      Returns node's HTML markup.
      int[] static Script<> getQueryingDescendantsForContainer​(int nodeId)
      Returns the descendants of a container query container that have container queries against this container.
      Integer static Script<> getRelayoutBoundary​(int nodeId)
      Returns the id of the nearest ancestor that is a relayout boundary.
      int[] static Script<> getSearchResults​(String searchId, int fromIndex, int toIndex)
      Returns search results from given fromIndex to given toIndex from the search with the given identifier.
      NONE (void) static Script<> hideHighlight()
      Hides any highlight.
      NONE (void) static Script<> highlightNode()
      Highlights DOM node.
      NONE (void) static Script<> highlightRect()
      Highlights given rectangle.
      NONE (void) static Script<> markUndoableState()
      Marks last undoable state.
      Integer static Script<> moveTo​(int nodeId, int targetNodeId, Integer insertBeforeNodeId)
      Moves node into the new container, places it before the given anchor.
      Ret2<String,
           ​Integer>
      static Script<> performSearch​(String query, Boolean includeUserAgentShadowDOM)
      Searches for a given string in the DOM tree.
      Integer static Script<> pushNodeByPathToFrontend​(String path)
      Requests that the node is sent to the caller given its path.
      int[] static Script<> pushNodesByBackendIdsToFrontend​(int[] backendNodeIds)
      Requests that a batch of nodes is sent to the caller given their backend node ids.
      Integer static Script<> querySelector​(int nodeId, String selector)
      Executes querySelector on a given node.
      int[] static Script<> querySelectorAll​(int nodeId, String selector)
      Executes querySelectorAll on a given node.
      NONE (void) static Script<> redo()
      Re-does the last undone action.
      NONE (void) static Script<> removeAttribute​(int nodeId, String name)
      Removes attribute with given name from an element with given id.
      NONE (void) static Script<> removeNode​(int nodeId)
      Removes node with given id.
      NONE (void) static Script<> requestChildNodes​(int nodeId, Integer depth, Boolean pierce)
      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.
      Integer static Script<> requestNode​(String objectId)
      Requests that the node is sent to the caller given the JavaScript node object reference.
      RunTime.RemoteObject static Script<> resolveNode​(Integer nodeId, Integer backendNodeId, String objectGroup, Integer executionContextId)
      Resolves the JavaScript node object for a given NodeId or BackendNodeId.
      NONE (void) static Script<> scrollIntoViewIfNeeded​(Integer nodeId, Integer backendNodeId, String objectId, DOM.Rect rect)
      Scrolls the specified rect of the given node into view if not already visible.
      NONE (void) static Script<> setAttributesAsText​(int nodeId, String text, String name)
      Sets attributes on element with given id.
      NONE (void) static Script<> setAttributeValue​(int nodeId, String name, String value)
      Sets attribute for an element with given id.
      NONE (void) static Script<> setFileInputFiles​(String[] files, Integer nodeId, Integer backendNodeId, String objectId)
      Sets files for the given file input element.
      NONE (void) static Script<> setInspectedNode​(int nodeId)
      Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
      Integer static Script<> setNodeName​(int nodeId, String name)
      Sets node name for a node with given id.
      NONE (void) static Script<> setNodeStackTracesEnabled​(boolean enable)
      Sets if stack traces should be captured for Nodes.
      NONE (void) static Script<> setNodeValue​(int nodeId, String value)
      Sets node value for a node with given id.
      NONE (void) static Script<> setOuterHTML​(int nodeId, String outerHTML)
      Sets node HTML markup, returns new node id.
      NONE (void) static Script<> undo()
      Undoes the last performed action.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • collectClassNamesFromSubtree

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String[]> collectClassNamesFromSubtree​
                    (int nodeId)
        
        Collects class names for the node with given id and all of it's child nodes.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the node to collect class names.
        Returns:
        An instance of Script<String, JsonObject, String[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String[] (classNames)
          Class name list.
      • copyTo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> copyTo​
                    (int nodeId,
                     int targetNodeId,
                     java.lang.Integer insertBeforeNodeId)
        
        Creates a deep copy of the specified node and places it into the target container before the given anchor.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the node to copy.
        targetNodeId - Id of the element to drop the copy into.
        insertBeforeNodeId - Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId).
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          Id of the node clone.
      • describeNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​DOM.NodedescribeNode​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId,
                     java.lang.Integer depth,
                     java.lang.Boolean pierce)
        
        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 - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        depth - 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.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, DOM.Node>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, DOM.Node> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

      • scrollIntoViewIfNeeded

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0scrollIntoViewIfNeeded​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId,
                     DOM.Rect rect)
        
        Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
        EXPERIMENTAL
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        rect - The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • disable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0disable()
        Disables DOM agent for the given page.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • discardSearchResults

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0discardSearchResults​
                    (java.lang.String searchId)
        
        Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
        EXPERIMENTAL
        Parameters:
        searchId - Unique search session identifier.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • enable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0enable()
        Enables DOM agent for the given page.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • focus

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0focus​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Focuses the given element.
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • getAttributes

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String[]> getAttributes​
                    (int nodeId)
        
        Returns attributes for the specified node.
        Parameters:
        nodeId - Id of the node to retrieve attibutes for.
        Returns:
        An instance of Script<String, JsonObject, String[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String[] (attributes)
          An interleaved array of node attribute names and values.
      • getBoxModel

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​DOM.BoxModelgetBoxModel​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Returns boxes for the given node.
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, DOM.BoxModel>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, DOM.BoxModel> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

      • getContentQuads

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Number[][]> getContentQuads​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
        EXPERIMENTAL
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Number[][]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Number[][]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Number[][] (quads)
          Quads that describe node layout relative to viewport.
      • getDocument

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​DOM.NodegetDocument​
                    (java.lang.Integer depth,
                     java.lang.Boolean pierce)
        
        Returns the root DOM node (and optionally the subtree) to the caller.
        Parameters:
        depth - 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.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, DOM.Node>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, DOM.Node> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

      • getFlattenedDocument

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​DOM.Node[]> getFlattenedDocument​
                    (java.lang.Integer depth,
                     java.lang.Boolean pierce)
        
        Returns the root DOM node (and optionally the subtree) to the caller. Deprecated, as it is not designed to work well with the rest of the DOM agent. Use DOMSnapshot.captureSnapshot instead.
        DEPRECATED
        Parameters:
        depth - 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.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, DOM.Node[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, DOM.Node[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

      • getNodesForSubtreeByStyle

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​int[]> getNodesForSubtreeByStyle​
                    (int nodeId,
                     DOM.CSSComputedStyleProperty[] computedStyles,
                     java.lang.Boolean pierce)
        
        Finds nodes with a given computed style in a subtree.
        EXPERIMENTAL
        Parameters:
        nodeId - Node ID pointing to the root of a subtree.
        computedStyles - The style to filter nodes by (includes nodes if any of properties matches).
        pierce - Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false).
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, int[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, int[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • int[] (nodeIds)
          Resulting nodes.
      • getNodeForLocation

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret3<java.lang.Integer,​java.lang.String,​java.lang.Integer>> getNodeForLocation​
                    (int x,
                     int y,
                     java.lang.Boolean includeUserAgentShadowDOM,
                     java.lang.Boolean ignorePointerEventsNone)
        
        Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
        Parameters:
        x - X coordinate.
        y - Y coordinate.
        includeUserAgentShadowDOM - False to skip to the nearest non-UA shadow root ancestor (default: false).
        OPTIONAL
        ignorePointerEventsNone - Whether to ignore pointer-events: none on elements and hit test them.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret3>

        This Script may be executed (using Script.exec()), and a Promise returned.

        When the Promise is awaited (using Promise.await()), the Ret3 will subsequently be returned from that call.

        The returned values are encapsulated in an instance of Ret3

        • Ret3.a: Integer (backendNodeId)
          Resulting node.

        • Ret3.b: String (frameId)
          Frame this node belongs to.

        • Ret3.c: Integer (nodeId)
          Id of the node at given coordinates, only when enabled and requested document.
      • getOuterHTML

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> getOuterHTML​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Returns node's HTML markup.
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, String>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String (outerHTML)
          Outer HTML markup.
      • getRelayoutBoundary

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> getRelayoutBoundary​
                    (int nodeId)
        
        Returns the id of the nearest ancestor that is a relayout boundary.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the node.
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          Relayout boundary node id for the given node.
      • getSearchResults

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​int[]> getSearchResults​
                    (java.lang.String searchId,
                     int fromIndex,
                     int toIndex)
        
        Returns search results from given fromIndex to given toIndex from the search with the given identifier.
        EXPERIMENTAL
        Parameters:
        searchId - Unique search session identifier.
        fromIndex - Start index of the search result to be returned.
        toIndex - End index of the search result to be returned.
        Returns:
        An instance of Script<String, JsonObject, int[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, int[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • int[] (nodeIds)
          Ids of the search result nodes.
      • hideHighlight

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0hideHighlight()
        Hides any highlight.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • highlightNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0highlightNode()
        Highlights DOM node.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • highlightRect

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0highlightRect()
        Highlights given rectangle.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • markUndoableState

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0markUndoableState
                    ()
        
        Marks last undoable state.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • moveTo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> moveTo​
                    (int nodeId,
                     int targetNodeId,
                     java.lang.Integer insertBeforeNodeId)
        
        Moves node into the new container, places it before the given anchor.
        Parameters:
        nodeId - Id of the node to move.
        targetNodeId - Id of the element to drop the moved node into.
        insertBeforeNodeId - Drop node before this one (if absent, the moved node becomes the last child of targetNodeId).
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          New id of the moved node.
      • performSearch

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret2<java.lang.String,​java.lang.Integer>> performSearch​
                    (java.lang.String query,
                     java.lang.Boolean includeUserAgentShadowDOM)
        
        Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
        EXPERIMENTAL
        Parameters:
        query - Plain text or query selector or XPath search query.
        includeUserAgentShadowDOM - True to search in user agent shadow DOM.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret2>

        This Script may be executed (using Script.exec()), and a Promise returned.

        When the Promise is awaited (using Promise.await()), the Ret2 will subsequently be returned from that call.

        The returned values are encapsulated in an instance of Ret2

        • Ret2.a: String (searchId)
          Unique search session identifier.

        • Ret2.b: Integer (resultCount)
          Number of search results.
      • pushNodeByPathToFrontend

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> pushNodeByPathToFrontend​
                    (java.lang.String path)
        
        Requests that the node is sent to the caller given its path. // FIXME, use XPath
        EXPERIMENTAL
        Parameters:
        path - Path to node in the proprietary format.
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          Id of the node for given path.
      • pushNodesByBackendIdsToFrontend

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​int[]> pushNodesByBackendIdsToFrontend​
                    (int[] backendNodeIds)
        
        Requests that a batch of nodes is sent to the caller given their backend node ids.
        EXPERIMENTAL
        Parameters:
        backendNodeIds - The array of backend node ids.
        Returns:
        An instance of Script<String, JsonObject, int[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, int[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • int[] (nodeIds)
          The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
      • querySelector

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> querySelector​
                    (int nodeId,
                     java.lang.String selector)
        
        Executes querySelector on a given node.
        Parameters:
        nodeId - Id of the node to query upon.
        selector - Selector string.
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          Query selector result.
      • querySelectorAll

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​int[]> querySelectorAll​
                    (int nodeId,
                     java.lang.String selector)
        
        Executes querySelectorAll on a given node.
        Parameters:
        nodeId - Id of the node to query upon.
        selector - Selector string.
        Returns:
        An instance of Script<String, JsonObject, int[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, int[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • int[] (nodeIds)
          Query selector result.
      • redo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0redo()
        Re-does the last undone action.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • removeAttribute

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0removeAttribute​
                    (int nodeId,
                     java.lang.String name)
        
        Removes attribute with given name from an element with given id.
        Parameters:
        nodeId - Id of the element to remove attribute from.
        name - Name of the attribute to remove.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • removeNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0removeNode​
                    (int nodeId)
        
        Removes node with given id.
        Parameters:
        nodeId - Id of the node to remove.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • requestChildNodes

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0requestChildNodes​
                    (int nodeId,
                     java.lang.Integer depth,
                     java.lang.Boolean pierce)
        
        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 - Id of the node to get children for.
        depth - 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.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • requestNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> requestNode​
                    (java.lang.String objectId)
        
        Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications.
        Parameters:
        objectId - JavaScript object id to convert into node.
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          Node id for given object.
      • resolveNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​RunTime.RemoteObjectresolveNode​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectGroup,
                     java.lang.Integer executionContextId)
        
        Resolves the JavaScript node object for a given NodeId or BackendNodeId.
        Parameters:
        nodeId - Id of the node to resolve.
        OPTIONAL
        backendNodeId - Backend identifier of the node to resolve.
        OPTIONAL
        objectGroup - Symbolic group name that can be used to release multiple objects.
        OPTIONAL
        executionContextId - Execution context in which to resolve the node.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, RunTime.RemoteObject>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, RunTime.RemoteObject> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

      • setAttributeValue

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setAttributeValue​
                    (int nodeId,
                     java.lang.String name,
                     java.lang.String value)
        
        Sets attribute for an element with given id.
        Parameters:
        nodeId - Id of the element to set attribute for.
        name - Attribute name.
        value - Attribute value.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setAttributesAsText

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setAttributesAsText​
                    (int nodeId,
                     java.lang.String text,
                     java.lang.String name)
        
        Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
        Parameters:
        nodeId - Id of the element to set attributes for.
        text - Text with a number of attributes. Will parse this text using HTML parser.
        name - Attribute name to replace with new attributes derived from text in case text parsed successfully.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setFileInputFiles

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setFileInputFiles​
                    (java.lang.String[] files,
                     java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Sets files for the given file input element.
        Parameters:
        files - Array of file paths to set.
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setNodeStackTracesEnabled

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setNodeStackTracesEnabled​
                    (boolean enable)
        
        Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
        EXPERIMENTAL
        Parameters:
        enable - Enable or disable.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • getFileInfo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> getFileInfo​
                    (java.lang.String objectId)
        
        Returns file information for the given File wrapper.
        EXPERIMENTAL
        Parameters:
        objectId - JavaScript object id of the node wrapper.
        Returns:
        An instance of Script<String, JsonObject, String>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String (path)
          -
      • setInspectedNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setInspectedNode​
                    (int nodeId)
        
        Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
        EXPERIMENTAL
        Parameters:
        nodeId - DOM node id to be accessible by means of $x command line API.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setNodeName

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> setNodeName​
                    (int nodeId,
                     java.lang.String name)
        
        Sets node name for a node with given id.
        Parameters:
        nodeId - Id of the node to set name for.
        name - New node's name.
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          New node's id.
      • setNodeValue

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setNodeValue​
                    (int nodeId,
                     java.lang.String value)
        
        Sets node value for a node with given id.
        Parameters:
        nodeId - Id of the node to set value for.
        value - New node's value.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setOuterHTML

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setOuterHTML​
                    (int nodeId,
                     java.lang.String outerHTML)
        
        Sets node HTML markup, returns new node id.
        Parameters:
        nodeId - Id of the node to set markup for.
        outerHTML - Outer HTML markup to set.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • undo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0undo()
        Undoes the last performed action.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • getFrameOwner

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret2<java.lang.Integer,​java.lang.Integer>> getFrameOwner​
                    (java.lang.String frameId)
        
        Returns iframe node that owns iframe with the given domain.
        EXPERIMENTAL
        Parameters:
        frameId - -
        Returns:
        An instance of Script<String, JsonObject, Ret2>

        This Script may be executed (using Script.exec()), and a Promise returned.

        When the Promise is awaited (using Promise.await()), the Ret2 will subsequently be returned from that call.

        The returned values are encapsulated in an instance of Ret2

        • Ret2.a: Integer (backendNodeId)
          Resulting node.

        • Ret2.b: Integer (nodeId)
          Id of the node at given coordinates, only when enabled and requested document.
      • getContainerForNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Integer> getContainerForNode​
                    (int nodeId,
                     java.lang.String containerName)
        
        Returns the container of the given node based on container query conditions. If containerName is given, it will find the nearest container with a matching name; otherwise it will find the nearest container regardless of its container name.
        EXPERIMENTAL
        Parameters:
        nodeId - -
        containerName - -
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (nodeId)
          The container node for the given node, or null if not found.
      • getQueryingDescendantsForContainer

        🡅     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​int[]> getQueryingDescendantsForContainer​
                    (int nodeId)
        
        Returns the descendants of a container query container that have container queries against this container.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the container node to find querying descendants from.
        Returns:
        An instance of Script<String, JsonObject, int[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, int[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • int[] (nodeIds)
          Descendant nodes with container queries against the given container.