Javafx-WebView-Debugger
Javafx-WebView-Debugger copied to clipboard
cannot resolve method 'startDebugServer'
I copied the codes,
Class webEngineClazz = WebEngine.class;
Field debuggerField = webEngineClazz.getDeclaredField("debugger"); debuggerField.setAccessible(true);
Debugger debugger = (Debugger) debuggerField.get(webView.getEngine()); DevToolsDebuggerServer devToolsDebuggerServer.startDebugServer(debugger, WEBVIEW_DEBUG_PORT, 0, null, null);
and the last line is wrong, so i modified it to
DevToolsDebuggerServer devToolsDebuggerServer = new DevToolsDebuggerServer(debugger, 54321, 0, null, null); devToolsDebuggerServer.startDebugServer();
but there still an error: cannot resolve method 'startDebugServer'
I modified 'startDebugServer' to 'onOpen', and it works. But I can check request in 'Network', but I cannot check logs in 'Console', why ?
@yihchu, console output is accomplished in a convoluted way because it needs the stack trace.
It is done through the JSBridge. So if JSBridge is not setup or there is some change in the sequence in how the debugger interface is implemented on Chrome end then it will not work.
I also noticed that it is not consistent. Some times it is setup correctly and on some runs it is not.
The functionality is very fragile and because it is async on multiple counts it is very hard to debug.
@vsch the bridge never setup correctly here, and I new a bridge myself, and i can see logs from java console now, but i still want to see logs from chrome devtools. What should i do ?