Can I extend JavaScript Debug to debug JavaFX WebView?

JavaFX is an official graphics framework for Java (like AWT or Swing). JavaFX provides an embedded browser, WebView, which is built on top of WebKit, an open-source web engine used in Safari and previously in Chrome. WebView exposes the WebKit Remote Debugging Protocol, a simple text protocol for debugging JavaScript in web pages.

Is it possible and practical for me to extend IntelliJ's JavaScript debugging functionality to support debugging JavaScript in web pages in WebView? I'm able to expose WebView's capabilities through either a Java interface or a local server.

If so, how should I get started? Thanks!

4 comments
Comment actions Permalink

Please try to use Chromium Remote (IDEA Ultimate only) run configuration to debug.

0
Comment actions Permalink

Can you provide any more details? I understand that it should be possible to use an existing configuration, particularly since the Chrome debugging interface seems to be similar. However, since I assume that this configuration is closed-source, I'm not sure how to emulate the browser.

0
Comment actions Permalink

I found a way to debug with chrome DevTool and safari Web Inspector.

I posted an an anwer at http://stackoverflow.com/a/34444807/1334241

For other details contact me at boskokg@gmail.com

0
Comment actions Permalink

Bosko, thank you for your solution. I built on it to get full featured debugger working with Chrome Dev Tools.

Just released MIT licensed library JavaFx WebView Debugger and a working sample application Web View Debug Sample to show how to make it work in any implementation.

I was doing log based script debugging in JavaFX WebView for two years. It is slow and tedious. Having a real debugger, console log with one click navigation to source and commandLineAPI makes working with JavaScript in WebView a joy.

main-screen

1

Please sign in to leave a comment.