7

I need to hide the address bar of all browsers through my JavaScript code. Is it possible to do?

Here is my code:

window.open("displayPdf.php?mnth="+mnth+"&year="+year+"&val="+newVal);
    dom.disable_window_open_feature.location
    dom.disable_window_open_feature.resizable
    dom.disable_window_open_feature.status
JJJ
  • 32,902
  • 20
  • 89
  • 102
Siva G
  • 1,170
  • 3
  • 17
  • 35
  • Do you want to hide the address bar of current winodw? Or you want to pop up another window in which address bar is hidden? – Hariprasad May 17 '13 at 07:09
  • i want to hide the popup window addressbar............ – Siva G May 17 '13 at 07:17
  • 1
    Note that hiding an address bar is extremely user unfriendly. As an alternative you could display a message like 'Press F11 for fullscreen mode' (I believe F11 works in most browsers but correct me if I'm wrong). – Deruijter May 17 '13 at 08:20
  • ya u r right buddy ..... – Siva G May 17 '13 at 08:28

2 Answers2

18

This is no longer possible in modern browsers due to security restrictions.

Official(-ish) Sources:

  • Firefox

    In Firefox 3, dom.disable_window_open_feature.location now defaults to true, forcing the presence of the Location Bar much like in IE7. See bug 337344 for more information.

  • Internet Explorer 7 and later

    In Internet Explorer 6, location specifies whether to display the Address Bar.

    (Implying the behaviour ends with IE6)

  • Chrome/Chromium

    Those toolbar hiding parameters are ignored in Chrome. You will also notice that modern browsers are moving towards not hiding it as security / anti phishing measures. Also see https://bugzilla.mozilla.org/show_bug.cgi?id=337344

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
-4
ClientScript.RegisterStartupScript(GetType(), "openwindow", "<script type=text/javascript> window.open('abc.aspx?id=" + str_id + "','null','location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,addressbar=0,titlebar=no,directories=no,channelmode=no,status=no'); </script>");
Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67