Javafx-WebView-Debugger icon indicating copy to clipboard operation
Javafx-WebView-Debugger copied to clipboard

cannot resolve method 'startDebugServer'

Open yihchu opened this issue 5 years ago • 4 comments

yihchu avatar Apr 01 '19 03:04 yihchu

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'

yihchu avatar Apr 01 '19 03:04 yihchu

I modified 'startDebugServer' to 'onOpen', and it works. But I can check request in 'Network', but I cannot check logs in 'Console', why ?

yihchu avatar Apr 01 '19 03:04 yihchu

@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 avatar Apr 01 '19 19:04 vsch

@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 ?

yihchu avatar Apr 02 '19 03:04 yihchu