I have an WebView object which I have added a popup handler to as so:
WebView view = new WebView();
WebEngine engine = view.getEngine();
engine.setCreatePopupHandler(new Callback<PopupFeatures, WebEngine>() {
public WebEngine call(PopupFeatures param) {
Stage stage = new Stage(StageStyle.UTILITY);
WebView popupView = new WebView();
stage.setScene(new Scene(popupView));
stage.show();
return popupView.getEngine();
}
});
This works as intended when a typical web page is loaded such as http://www.google.com. Where I run into trouble is when a URI meant to be passed to Windows command line is opened by JavaScript. Particularly I am trying to start a lync conference call by passing "conf:sip..." to the command line:
window.open("conf:sip...")
I know that WebView isn't capable of loading a location like this and that isn't the main issue. I can catch a MalformedURLException and then pass command myself. What is the issue is that the popup handler never seems to pass the destination on. I have tried adding a listener to the locationProperty and the workDoneProperty as well as an onError listener to both the original engine and the popupView engine. The popup appears to never be passed the destination of the window.open function and the popupView engine never loads anything.
Is there a way to obtain the destination of the window.open function inside of the Callback interface or to catch whatever error is preventing the popup from being passed the destination?
Thanks!