Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everyboby. I wrote function open new window in browser. i wanna disable address bar
JavaScript
window.open('/login.html', 'winname', 
  directories=0,titlebar=0,toolbar=0,location=0,status=0,     
    menubar=0,scrollbars=no,resizable=no,
      width=400,height=350);


but it not work in new version Firefox.

thanks everboby
Posted
Updated 5-Oct-22 5:17am

Firefox 3 note:

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.

See details here: https://developer.mozilla.org/en-US/docs/Web/API/Window/open?redirectlocale=en-US&redirectslug=DOM%2Fwindow.open[^]
 
Share this answer
 
Comments
Thomas Daniels 3-Mar-15 13:26pm    
+5
Kornfeld Eliyahu Peter 3-Mar-15 13:29pm    
Thank you...
Sergey Alexandrovich Kryukov 3-Mar-15 14:17pm    
My 5, but is would be even better to avoid such pop-up windows. Please see alternative Solution 3.
—SA
Kornfeld Eliyahu Peter 3-Mar-15 14:21pm    
Thank you...
You are right - fortunately, most modern browsers will block such open if it not comes from direct user interaction, but from code...
In addition to informative Solutions 1 and 2, I would add my advice:

Your design pop-ups the new window (or possibly a new tab). Such pop-ups often irritates the users; first of all, because the abuse of many advertisers' pop-ups, but also because they are pretty inconvenient in general. Therefore, many users block such pop-ups, usually using some browsers' plug-ins. Your work will look much better is you simulate the modal behavior you need using on-page modal dialog, like the one found in jQuery UI: http://jqueryui.com/dialog[^].

There are many 3rd party plug-ins offering good number of useful effects, such as dimming of the rest of the page, and a lot more. Please see: http://bit.ly/1EKp8je[^].

—SA
 
Share this answer
 
Comments
Thomas Daniels 3-Mar-15 14:21pm    
+5, good suggestion.
Sergey Alexandrovich Kryukov 3-Mar-15 14:34pm    
Thank you.
—SA

  1. Put the options around quotes, like this:
    JavaScript
    window.open('/login.html', 'winname',"directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=no,resizable=no,width=400,height=350");

  2. As Kornfeld Eliyahu Peter already mentioned in his answer, dom.disable_window_open_feature.location now defaults to true, to force the location bar to be there.

    If you want to change that, go to about:config and set it to false.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 3-Mar-15 14:17pm    
My 5, but is would be even better to avoid such pop-up windows. Please see alternative Solution 3.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900