Kevin Day
Kevin Day

Reputation: 16413

Load tinymce in JavaFX Webview

We have a JavaFX WebView that needs to load a simple HTML page containing a tinymce v4 editor. This works fine in older versions of Java (Java 11). But in Java 21, tinymce v4 doesn't load in the jfx webview at all. We have also tried with tinymce 7.5, and that doesn't work in Java 11 or Java 21.

We even see this issue if we point the webview at the TinyMCE demo page (the page renders, but the editor pane in it does not take on tinymce functionality): https://www.tiny.cloud/docs/tinymce/latest/full-featured-premium-demo

Code is simple:

public class Main extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    public void start(Stage primaryStage) {
        primaryStage.setTitle("JavaFX WebView Example");

        WebView webView = new WebView();

        webView.getEngine().setJavaScriptEnabled(true);
        webView.getEngine().setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36");
        webView.getEngine().load("https://www.tiny.cloud/docs/tinymce/latest/full-featured-premium-demo");

        VBox vBox = new VBox(webView);
        Scene scene = new Scene(vBox, 960, 600);

        primaryStage.setScene(scene);
        primaryStage.show();

    }

}

The demo page works fine in regular browsers.

There is no console output. I have confirmed that there are no Javascript exceptions being thrown.

Does anyone have any guidance on how to proceed? WebView is so opaque that I don't have any ideas on how to even diagnose what might be different between JFX and a regular browser.

Upvotes: 0

Views: 43

Answers (0)

Related Questions