Reputation: 382696
how to hide address bar from popup window opened with window.open?
Upvotes: 0
Views: 2097
Reputation: 38346
You can use the location
option to toggle the address bar on/off in most browsers:
window.open('popup.html', 'popup', 'location=no');
If you are aiming for a "visually light weight window" you might also want to disable other visual elements such as toolbar
, menubar
, scrollbars
, status
:
window.open('popup.html', 'popup',
'location=no,toolbar=no,menubar=no,scrollbars=no,status=no');
Browsers may or may not choose to follow these directives. See the comprehensive documentation of the window.open()
function in Mozilla Developer Center for more options and information about support in various browsers.
Upvotes: 2
Reputation: 138017
On modern browsers this cannot be done, it poses a security risk.
for example:
In Internet Explorer 7 and later, you cannot remove the address bar in Internet Zone windows, for security (anti-spoofing) reasons. As described in the MSDN article above, in IE7 and later, location=no simply hides the back/forward/stop navigation buttons, and makes the address bar read-only.
Source: http://msdn.microsoft.com/en-us/library/ms536651%28VS.85%29.aspx
Upvotes: 4