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
4
  • 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, 2013 at 7:09
  • i want to hide the popup window addressbar............
    – Siva G
    May 17, 2013 at 7: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, 2013 at 8:20
  • ya u r right buddy .....
    – Siva G
    May 17, 2013 at 8:28

2 Answers 2

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

-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>");
1
  • please edit your answer and format the code to make it readable
    – kleopatra
    Oct 10, 2013 at 10:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.