Asad
Asad

Reputation: 517

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?

Upvotes: 0

Views: 11996

Answers (3)

vol7ron
vol7ron

Reputation: 42099

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

Upvotes: 1

Ruan Mendes
Ruan Mendes

Reputation: 92274

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?

Upvotes: 1

Matthew Manela
Matthew Manela

Reputation: 16752

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')

Upvotes: 4

Related Questions