You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Class webEngineClazz = WebEngine.class;
Field debuggerField = webEngineClazz.getDeclaredField("debugger");
debuggerField.setAccessible(true);
Debugger debugger = (Debugger) debuggerField.get(webView.getEngine());
DevToolsDebuggerServer devToolsDebuggerServer.startDebugServer(debugger, 51742, 1);
To:
Class webEngineClazz = WebEngine.class;
Field debuggerField = webEngineClazz.getDeclaredField("debugger");
debuggerField.setAccessible(true);
Debugger debugger = (Debugger) debuggerField.get(webView.getEngine());
DevToolsDebuggerServer bridge = new DevToolsDebuggerServer(debugger, WEBVIEW_DEBUG_PORT, 0, null, null);
Using this class is not well documented, and just something I've used from the previous repo this was based upon.
When using the new class DevToolsJsBridge, as shown in the example, there's no way to pass a Debugger instance. The underlying method it uses, .impl_getDebugger(), on WebEngine is not supported in Java 9 (and presumed above).
Would it be possible to allow support to either pass in a Debugger, use reflection to extract the debugger field or check for which method is available (Java 9 seems to have getDebugger()?
Also what is the difference between DevToolsJsBridge and DevToolsDebuggerServer ?
The text was updated successfully, but these errors were encountered:
@limpygnome, I will modify the code for DevToolsJsBridge to take debugger argument.
The DevToolsDebuggerJsBridge is used by the by the debug code for interfacing JS script code to handler for implementation. Saving JS state, stopping event propagation and signalling page load complete is done through this interface.
The state can be used to save/load JS state.
Event propagation does not reach events implemented from Java so an alternate mechanism has to be used.
Additionally println, print and consoleLog is also passed through this interface.
The class provides a default implementation but can be customized if needed. Some functionality, like console logs have very convoluted implementation to allow creating a stack trace which needs to be passed to Chrome Dev Tools.
I have not looked at the code for a while but do remember the brittle nature of the debug interface which has to prevent recursion into the debugger interface under some conditions, otherwise JVM crashes and exits the application.
@vsch
Please update the README file according to the right way.
I have been struggling to use the webview debugger but it can be much easier if the README will be up to date with a working example.
The following example needs to be updated:
To:
Using this class is not well documented, and just something I've used from the previous repo this was based upon.
When using the new class
DevToolsJsBridge
, as shown in the example, there's no way to pass aDebugger
instance. The underlying method it uses,.impl_getDebugger()
, onWebEngine
is not supported in Java 9 (and presumed above).Would it be possible to allow support to either pass in a
Debugger
, use reflection to extract thedebugger
field or check for which method is available (Java 9 seems to havegetDebugger()
?Also what is the difference between
DevToolsJsBridge
andDevToolsDebuggerServer
?The text was updated successfully, but these errors were encountered: