-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open The Elements Panel Like like in Google Chrome with ctrl+shift+c #2
Comments
@ilkerceng, the only thing I figured out for now is to highlight the element which is being hovered over in Chrome Dev Tools. It is a bit of a kludge since it adds a class to the element to provide the highlight. |
Thank you @vsch. How could you do that? is it possibble to share code? |
@ilkerceng, it is all part of the WebViewDebugSample with all source code. The highlighting code is part of the debugger script used to provide the bridging between debugger, java and HTML javascript: https://github.com/vsch/Javafx-WebView-Debugger/blob/master/src/main/resources/markdown-navigator.js#L169-L186 I have to admit getting it all to work resulted in somewhat convoluted code but all that Async and modalities of the script engine don't make it easy. I also found that the only Chrome version which works reliably for console output is 65.0.3325.181 under OS X. Newer versions work but console pane is not enabled. The readme has a link to chrome version downloads and I opted out to install the working version rather than trying to figure out what is different in the newer versions that causes them not to work. |
@vsch thanks for detailed info. i am trying to understand, i will dive into details of each module used in java and js separately later. |
@ilkerceng, one thing to look out for is the need for Java to setup a JsBridge for JavaScript to use for call backs. The webview script engine is created on page load so this bridge cannot be setup before page is loaded. This complicates the initialization since the script in the page will run before JsBridge is setup. The injected helper script sets up the calls so that ones which need JsBridge are stored as lambdas which will execute when JsBridge is setup. This means that timing of these calls will not occur when they are invoked but at a later time when JsBridge is setup. This also means that console log calls before JsBridge is setup will have the stack trace showing the markdown-navigator.js source not the original source because JsBridge is used to get the stack trace. |
Is it possible to integrate to java fx WebView: inspect elements in real-time like Google Chrome ctrl+shift+c capabbility on hover html elements and send selected data to the server app?
The text was updated successfully, but these errors were encountered: