user889292
user889292

Reputation:

hiding address bar and status bar in IE8

How can I hide the status bar and address bar through JavaScript? I have the following code:

 var params = 'width=400, height=400';
        params += ', top=0, left=0';
        params += ', directories=no';
        params += ', location=no';
        params += ', menubar=no';
        params += ', resizable=no';
        params += ', scrollbars=no';
        params += ', status=yes';
        params += ', toolbar=no';
        newwin = window.open('C:\Documents and Settings\Admin\Desktop\test.htm', 'windowname5', params);

In IE8 we can't hack using security option, so how can I achieve this?

Upvotes: 2

Views: 2048

Answers (2)

mplungjan
mplungjan

Reputation: 177885

  • you are opening a local file. That is already a security issue
  • do not have spaces in the parameters,
  • more and more browsers block the removal of browser chrome. Live with it or pop a DIV with an embedded IFrame
  • no need to have parameters=no if you have at least one parameter - all that are allowed to be turned off are off by default when one of the parms are on
var params = 'width=400,height=400,top=0,left=0';

// you wanted to try to hide the status, then don't include it as =yes
    // params += ',status=yes'; 
    newwin = window.open('C:\Documents and Settings\Admin\Desktop\test.htm',
    'windowname5', params);

should do the same as your posted code except it would hide the status if allowed

Upvotes: 2

Guffa
Guffa

Reputation: 700322

To hide the status bar, change status=yes to status=no.

For security reasons, it's not possible to hide the address bar.

Upvotes: 2

Related Questions