Class CefDevToolsClient

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class CefDevToolsClient
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • isClosed

        public boolean isClosed()
      • executeDevToolsMethod

        public java.util.concurrent.CompletableFuture<java.lang.String> executeDevToolsMethod​(java.lang.String method)
        Execute a method call over the DevTools protocol. See the DevTools protocol documentation for details of supported methods and the expected syntax for parameters.

        If an error occurs the returned future is completed exceptionally, otherwise its value is asynchronously set to the method result.

        Call #addEventListener(String, EventListener) to subscribe to events.

        Parameters:
        method - the method name
        Returns:
        return a future with the method result if the method was executed successfully
      • executeDevToolsMethod

        public java.util.concurrent.CompletableFuture<java.lang.String> executeDevToolsMethod​(java.lang.String method,
                                                                                              java.lang.String parametersAsJson)
        Execute a method call over the DevTools protocol. See the DevTools protocol documentation for details of supported methods and the expected syntax for parameters.

        If an error occurs the returned future is completed exceptionally, otherwise its value is asynchronously set to the method result.

        Call #addEventListener(String, EventListener) to subscribe to events.

        Parameters:
        method - the method name
        parametersAsJson - JSON object with parameters, or null if no parameters are needed
        Returns:
        return a future with the method result if the method was executed successfully
      • addEventListener

        public void addEventListener​(CefDevToolsClient.EventListener eventListener)
        Add an event listener for DevTools protocol events. Events by default are disabled and need to be enabled on a per domain basis, e.g. by sending Network.enable to enable network related events.
        Parameters:
        eventListener - the listener to add
      • removeEventListener

        public void removeEventListener​(CefDevToolsClient.EventListener eventListener)
        Remove an event listener for DevTools protocol events.
        Parameters:
        eventListener - the listener to remove