0

How can I hide the address bar (location bar ) in a modal dialog? Here is my code:

var dialogFeatures = 'center:yes; dialogWidth:600px; location:no;dialogHeight:400px; edge:raised; help:no; resizable:no; scroll:no; status:no; statusbar:no; toolbar:no; menubar:no; addressbar:no; titlebar:no;';
newwindow2 = window.showModalDialog('Combo?start1=' + calEvent.start + '&end1=' + calEvent.end + '&ownerType=' + < %= ApplicationConstants.OWNER_TYPE_CALENDAR % > , 'app', dialogFeatures);
Andy E
  • 338,112
  • 86
  • 474
  • 445
pavan
  • 73
  • 2
  • 3
  • 10

4 Answers4

7

It's not possible. The address bar is a security feature in most browsers, in IE since version 7, in Firefox (I think) since version 2.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
2

You can't hide the address bar, location: no is not a valid option for the features argument.

In Internet Explorer 7 and later, all windows opened by the browser have an address bar. The same is true of Google Chrome and other browsers supporting showModalDialog.

Andy E
  • 338,112
  • 86
  • 474
  • 445
  • 2
    @Andy this answer was clearly not satisfactory, which is why the OP chose to [ask it again](http://stackoverflow.com/questions/4164824/how-to-hide-address-bar-on-showmodaldialog/4164844#4164844). He got the same answer there, we'll see whether he'll open another one – Pekka Nov 12 '10 at 13:21
  • 1
    @Pekka: he could have at least copy and pasted the improved grammar/formatting from here! – Andy E Nov 12 '10 at 13:23
  • @Andy read the comments underneath my answer there. I've never seen anything so bizarre on SO – Pekka Nov 12 '10 at 13:24
  • @Pekka - Yep, [there's another one](http://stackoverflow.com/questions/4164824/how-to-hide-address-bar-on-showmodaldialog-closed). – Nick Craver Nov 12 '10 at 13:30
  • @Nick yeah, we were just merged from there :) – Pekka Nov 12 '10 at 13:31
  • @Nick I think so, too. Looks like an incurable help vampire – Pekka Nov 12 '10 at 13:33
1

You can't.

Hiding the address bar is disallowed in most browsers, for security reasons.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
-1

in about:config change this parameter:

dom.disable_window_open_feature.location
and for menubar and any other components you have to change their feature in about:config