B4J Question Override Url in Webview

Hi everyone and @Erel can you please check this link: https://www.codota.com/code/java/methods/javafx.scene.web.WebEngine/locationProperty


I saw this code


[CODE lang="java" title="How to deny access to webpage from javafx web"]
WebEngine engine = webview.getEngine();
engine.locationProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.contains("badsite")) { // replace with your URL checking logic
Platform.runLater(() -> {
// Load your block page url
engine.load("http://example.com"));
}
}
});[/CODE]

but I don't know how to make it work for B4J
 
Upvote 0
Back
Top