I am trying to open a URL in a new window. The URL is opened in a new window but without any Menu and navigation controls.
I am using JAVA and ZK in backend and using Script to run the code as:
Script jsScriptInitializer = new Script();
String js = "window.open('https://www.google.com', '_blank', 'location=no,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes');";
jsScriptInitializer.setContent(js);
jsScriptInitializer.setDefer(true);
jsScriptInitializer.setParent(event.getTarget().getParent().getParent());
I need all the navigation and menu controls as usual when I open a URL in another window. How can I achieve this ?
Your code will work as desired in browsers other than Chrome. There has been an ongoing bug in Chrome which has turned into a feature request. You can read about it at: https://bugs.chromium.org/p/chromium/issues/detail?id=82522
As of Jan 2022, there is still no way to open a Seperate window with the standard toolbars. However, if you can accept the new window being in the form of a tab rather than a separate window, simply eliminating the third argument will open as a fully featured tab.
// open a new tab
window.open('https://www.google.com', '_blank');