Hiding the address bar of a browser (popup)
I have to hide the address bar of a browser. I am using this code:
var winFeature =
'location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes';
window.open('Result.html','null',winFeature);
In many solutions, just the location=no
attribute can hide the address bar (in both IE & Chrome). However, this didn't work for me (even in IE & Chrome).
Finally, I found a MSDN article that describes how location=no
simply hides the back/forward/stop navigation buttons, and makes the address bar read-only.
Is there any solution to hide the entire address bar by ignoring above MSDN article? I am testing in IE and Google Chrome.
What is the truth?
Microsoft's documentation describing the behaviour of their browser is correct.
Is there any solution to hide the addressbar?
No. If you could hide it, then you could use HTML/CSS to make something that looked like a common address bar. You could then put a different address in it. You could then trick people into thinking they were on a different site and entering their password for it.
It is impossible to conceal the user's location from them because it is essential for security that they know what their location is.
This is no longer possible in modern browsers due to security restrictions.
Official(-ish) Sources:
-
Firefox
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.
-
Internet Explorer 7 and later
In Internet Explorer 6, location specifies whether to display the Address Bar.
(Implying the behaviour ends with IE6)
-
Chrome/Chromium
Those toolbar hiding parameters are ignored in Chrome. You will also notice that modern browsers are moving towards not hiding it as security / anti phishing measures. Also see https://bugzilla.mozilla.org/show_bug.cgi?id=337344
Looking for the same, the only thing I'm able to do is
Launch Google Chrome in app mode
Chrome.exe --app="<address>"
From the run prompt. Example:
Chrome.exe --app="http://www.google.com"
Hide the address bar in Mozilla Firefox
Type about:config
in the address bar, the search for:
dom.disable_window_open_feature.location
And set it to false
So, when you open a popup window, it will launch with the address bar hidden. For example:
window.open("http://www.google.com",'','postwindow');
Now, I'm looking to do something similar with Microsoft Edge, I have not found anything yet for this browser.
It's different in every browser.
Some years ago, what you tried, was right. But nowadays it is regarded as a security risk by browser vendors that one cannot see the browsers address bar (for phishing reasons) and so they (or most of them) made the decision to always show the browser address bar. Which is good in my eyes.