7

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.

Braiam
  • 1
  • 11
  • 47
  • 78
cometta
  • 35,071
  • 77
  • 215
  • 324
  • 1
    Because 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 Answers6

20

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

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
4

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?

Hemant
  • 19,486
  • 24
  • 91
  • 127
3

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

Bobby
  • 11,419
  • 5
  • 44
  • 69
Haim Evgi
  • 123,187
  • 45
  • 217
  • 223
3

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');
awe
  • 21,938
  • 6
  • 78
  • 91
  • 3
    Yes, as other answers have already explained, the security limitation doesn't apply to trusted sites. – Quentin Jul 22 '09 at 13:21
2

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.

wefwfwefwe
  • 3,382
  • 1
  • 21
  • 24
1

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.

Read More

Josh Stodola
  • 81,538
  • 47
  • 180
  • 227