WebView not display a certain website

210 Views Asked by At

I am trying to display this site: https://harvard.service-now.com/ithelp into my WebView (which is in a JFXPanel). However, it showing a blank screen. I tried several different pages and they all works fine to me.

Searching around suggest that it is a certificate issue. However I tried to fix it using this: JavaFX WebView can't load certain sites and it still does not work.

This is also what I am getting when listening for an error event:

ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@36ecd1f, name: exception, value: null]

Code:

Platform.runLater(() -> {

        WebView webView = new WebView();
        webPanel.setScene(new Scene(webView));
        webView.setZoom(1.6);
        webView.getEngine().load("https://harvard.service-now.com/ithelp");
        webView.getEngine().getLoadWorker().stateProperty()
                .addListener((ov, oldState, newState) -> {
                    System.err.println(webView.getEngine().getLoadWorker()
                             .exceptionProperty());
                });
    });

Additionally, the website takes Firefox, Edge, Chrome, and Edge a bit of time to load so I don't know if it has anything to do with WebView.

0

There are 0 best solutions below