JavaScript Window.Open function not working

In my window.open I set location to no . As I understand it, this should open a popup without an address bar. However, when a popup appears, it has an address bar in all browsers except Safari. How to 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 %>'; } }); 

+2
source share
1 answer

In general, you can never guarantee that the user will not see the window functions that you ask to hide, because some browsers (Firefox, I know, and possibly others) allow the browser user to control which functions can be disabled. In addition, some plugins add toolbars and do not pay attention to these options on window.open .

However, this option usually works, as I have successfully used it, and works in interacting browsers (including all versions of IE that I tried).

edit - I just tried a quick test and it seems to work fine in Chrome and IE. Chrome now shows a small indicator area at the top of the window that shows the URL, but it's not really a complete "location" panel.

+4
source

Source: https://habr.com/ru/post/893075/


All Articles