What is the version of WebKit in JavaFX 8?
WebView is a Node that manages a WebEngine and displays its content. The associated WebEngine is created automatically at construction time and cannot be changed afterwards. WebView handles mouse and some keyboard events, and manages scrolling automatically, so there's no need to put it into a ScrollPane .
The recommended way to embed a JavaFX application into a web page or launch it from inside a web browser is to use the Deployment Toolkit library. The Deployment Toolkit provides a JavaScript API to simplify web deployment of JavaFX applications and improve the end user experience with getting the application to start.
JavaFX is a set of graphics and media packages that enables developers to design, create, test, debug, and deploy rich client applications that operate consistently across diverse platforms.
You can determine the base version of WebKit being used in WebView by querying the user agent string of the WebView's engine.
web.getEngine().getUserAgent()
This shows a WebKit version of 537.44 for Java 8u5.
This is the upstream version of WebKit used in the JavaFX implementation before any downstream modifications were made to it to allow it to work with JavaFX.
As new versions of Java 8 are released, the version of WebKit used in each version will change, but you should always be able to determine what is used by querying the User Agent String.
Sample Code Output (on my machine)
Java Version: 1.8.0_05-b13
JavaFX Version: 8.0.5-b13
OS: Windows 7, amd64
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.44 (KHTML, like Gecko) JavaFX/8.0 Safari/537.44
Sample Code
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class WebViewVersion extends Application {
@Override public void start(Stage stage) {
WebView web = new WebView();
System.out.println(
"Java Version: " + System.getProperty("java.runtime.version")
);
System.out.println(
"JavaFX Version: " + System.getProperty("javafx.runtime.version")
);
System.out.println(
"OS: " + System.getProperty("os.name") + ", "
+ System.getProperty("os.arch")
);
System.out.println(
"User Agent: " + web.getEngine().getUserAgent()
);
Platform.exit();
}
public static void main(String[] args) {
launch(args);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With