Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript Window.Open location feature not working

Tags:

javascript

In my window.open I've set the location to no. As I understand it, this should open a popup window with no address bar. However, when the popup window appears it has an address bar in all browsers except for Safari. How can I open a new window without an address bar?

<script type="text/javascript" language="javascript">
$(document).ready(function() {

    var win = window.open("<%= Uri %>", "_blank", "directories=no,location=no,menubar=no,titlebar=no,toolbar=no,status=no");
    if (win != undefined) {
        window.location.href = '<%= this.Request.UrlReferrer.AbsoluteUri %>';
    }
});

like image 487
Aaron Salazar Avatar asked Mar 20 '26 10:03

Aaron Salazar


1 Answers

In general, you can never guarantee that the user won't see window features you ask to be hidden, because some browsers (Firefox, I know, and maybe others) allow the browser user to control what features can be disabled. On top of that, some plugins add toolbars and don't pay any attention to those parameters to window.open.

That said, that parameter usually works, as I've successfully used it, and it works in cooperating browsers (including all versions of IE I've tried).

edit — I just tried a quick test and it seems to work just fine in Chrome and IE. Now, Chrome shows a little indicator area at the window top that shows the URL, but it's not really the complete "location" bar.

like image 173
Pointy Avatar answered Mar 23 '26 00:03

Pointy