-
Notifications
You must be signed in to change notification settings - Fork 6
Desktop webview support with JavaFX #667
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐳
JFXPanel().apply { | ||
Platform.setImplicitExit(false) // Otherwise, webView will not show the second time | ||
Platform.runLater { | ||
println("webview: factory runLater") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println("webview: factory runLater") |
} | ||
// Hack to send HTTP headers by taking advantage of userAgent | ||
webView.engine.userAgent = "ooni$headers" | ||
println("webview: Loading: ${event.url}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println("webview: Loading: ${event.url}") |
factory = { | ||
controller.state = OoniWebViewController.State.Initializing | ||
|
||
println("webview: factory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println("webview: factory") |
}, | ||
modifier = modifier, | ||
update = { jfxPanel -> | ||
println("webview: update") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println("webview: update") |
update = { jfxPanel -> | ||
println("webview: update") | ||
Platform.runLater { | ||
println("webview: update runLater") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println("webview: update runLater") |
I'm trying to use JavaFX for the WebView but I could get it to run.
I was following an old version of https://github.com/KevinnZou/compose-webview-multiplatform/tree/1.2.0 as inspiration.
It said the toolkit was missing. It seems Jetbrains JRE and most others no longer have JavaFX bundled, so I installed the Android Studio plugin for it: https://plugins.jetbrains.com/plugin/14250-javafx-runtime-for-plugins
Still the app failed to run.
I then try to follow the configurations mentioned here: https://openjfx.io/openjfx-docs/#gradle But I still get issues: