I'm using both JavaFX and the javascript engine inside JavaFX WebEngine to develop an application. I'd like to get feedback from javascript for debugging purposes. What happens to the console output inside the WebEngine? Is there any way I can access it, or redirect to System.out in java?
相关问题
- JFX scale image up and down to parent
- Android Exclude Some Camera Intent
- WebView ssl error
- Xcode UI Testing - Finding element in Webview by i
- Unable to Full Screen Youtube Video Inside Custom
相关文章
- Loading custom font using JavaFX 8 and css
- Check if url is cached webview android
- WebView's LOAD_NO_CACHE setting still saves fi
- How do I see request headers on Android WebView re
- JavaFX scrolling table update performance degrades
- Can you specify minor jdk version for travis ci
- How to manage the Blank White Loading screen of an
- Xcode Wkwebview not Loading
I like to go the other direction. We use log4j so I created a javascript wrapper like the following:
Then at the beginning of the javascript I check to see if the log is present and set it:
And that way if you set the Log4j logger directly on the engine before you even load the url like:
This way I can get logging in if I am opening directly in a browser or it is being run from a WebView in a JavaFX program. And has the added benefit of having levels to the logging in javascript that match your packages of the WebView controller. Just an alternative for larger javascript views.
The following code redirects
console.log()
toJavaBridge.log()
:You can just add message listener to see what's happening in your output. You don't have to inject js bridge with redefinition of functions like
console.log
for every single loaded page