How to open Navigator.navigateTo in a new browser tab?


I’ve a few locations in code where I’d like to allow users to open an UI in a new page - e.g. when the user presses “CTRL” when clicking on a MenuItem. Is it possible to query the system which keys are

The code

MenuItem ellipsis = bar.addItem("", FontAwesome.ELLIPSIS_V, null); ellipsis.addItem("Search...", e -> { Search query =...; // if CTRL is not pressed, open view in the same browser tab: getUI().getNavigator().navigateTo(computeView(query)); // else (CTRL is pressed), open a new tab and navigate there: String url = ... + computeView(query)); getUI().getPage().open(url, "_blank"); }); Thanks,

I’m also interested in this. Any word?

Most browsers require client side user event, like click event to be involved for opening with "_blank" target, otherwise the browser will block it. Thus there are some limitations in this. E.g. in Vaadin8 BrowserWindowOpener has this implemented in client side.