vsch / Javafx-WebView-Debugger

Full Featured Google Chrome Dev Tools to JavaFX WebView browser debugging.
MIT License
66 stars 11 forks source link

cannot resolve method 'startDebugServer' #5

Open yihchu opened 5 years ago

yihchu commented 5 years ago

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 commented 5 years ago

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

vsch commented 5 years ago

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

yihchu commented 5 years ago

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