Package org.cef.browser
Class CefDevToolsClient
- java.lang.Object
-
- org.cef.browser.CefDevToolsClient
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class CefDevToolsClient extends java.lang.Object implements java.lang.AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCefDevToolsClient.DevToolsExceptionstatic interfaceCefDevToolsClient.EventListener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListener(CefDevToolsClient.EventListener eventListener)Add an event listener for DevTools protocol events.voidclose()java.util.concurrent.CompletableFuture<java.lang.String>executeDevToolsMethod(java.lang.String method)Execute a method call over the DevTools protocol.java.util.concurrent.CompletableFuture<java.lang.String>executeDevToolsMethod(java.lang.String method, java.lang.String parametersAsJson)Execute a method call over the DevTools protocol.booleanisClosed()voidremoveEventListener(CefDevToolsClient.EventListener eventListener)Remove an event listener for DevTools protocol events.
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.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 nameparametersAsJson- 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
-
-