When I use window.open()
to do a pop up on a new window, I'm unable to hide the url bar. It still shows the url bar even though it's read only. Can I hide it? I do not want user to see the url.
-
1Because of this limitation (see accepted answer for reason), it has been common to implements popup windows as some kind of floating `` instead of actual window (many javascript libraries available out there to help with this). If you need a separate html page in the popup, you can use `– awe Jun 24 '13 at 08:51
6 Answers
In Internet Explorer 7 and later, you cannot remove the address bar in Internet Zone windows, for security (anti-spoofing) reasons.
— http://msdn.microsoft.com/en-us/library/ms536651%28VS.85%29.aspx

- 914,110
- 126
- 1,211
- 1,335
You cannot do that in other browsers (Firefox, Chrome) also so even if you could do it in IE, it would have been pointless. Won't it?

- 19,486
- 24
- 91
- 127
You cannot no longer hide the address bar in IE7. Read more about here in this MS article http://www.microsoft.com/windows/ie/community/columns/securityupgrade.mspx
This works for me in IE7, but only because I have the site added to the "Trusted sites" list.
window.open(url, '_blank',
'toolbar=no,menubar=no,width=300,height=400,resizable=no,scrollbars=no');

- 21,938
- 6
- 78
- 91
-
3Yes, as other answers have already explained, the security limitation doesn't apply to trusted sites. – Quentin Jul 22 '09 at 13:21
it depends on the user's security settings. if the site is in the 'local intranet' zone then you will be able to hide the address bar.

- 3,382
- 1
- 21
- 24
It can be done like this...
window.open("about:blank", "popWin", "location=no");
But of course, the user will always be able to configure the browser to dis-allow this. And I think by default, it will not allow it. IF you are on their "Trusted Sites" list, this will work though.

- 81,538
- 47
- 180
- 227