How to hide the browser address bar with JavaScript
Is it possible to hide the user's address bar in the browser? If so, how would 开发者_如何学编程I go about it?
I don't think you can hide the address bar on a user's current window but you can create a pop up that has the address bar hidden:
var popup = window.open("http://someurl", "myPopup", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=120,height=120')
Can't do it reliably and it's not a good idea, even for popups, I think currently, IE is the only one that will hide it. Otherwise the user doesn't know where the popup is from. Think about the facebook login popup. How am I supposed to be confident that I'm not entering my password into a malicious website?
You can create a modeless window (IE), but you cannot hijack the browser's current page.
FF does not support this as it took them 3 years to implement the showModalDiaglog, which was more secure than IE's implementation.
Your option is to:
- Open a new window, hiding the address bar, but it would still be available
- Create an absolutely positioned element w/in the current page that contains an iframe
- Create your own browser and add that feature
精彩评论