Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide address bar using javascript window.open? [duplicate]

I want to disable the address bar using javascript window.open. Also the script should work in IE, Safari and chrome. Any suggestions.

like image 911
VolleyBall Player Avatar asked Apr 14 '11 14:04

VolleyBall Player


People also ask

How do I hide the address bar in Windows Open?

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

How do I hide my browser address bar?

To get started enter “about:flags” into the Address Bar and hit Enter. Scroll down until you see the listing for Compact Navigation. Enable it and let the browser restart to gain access to the feature. Once the browser has restarted right click on one of the tabs and select Hide the toolbar from the Context Menu.

How do I hide the address bar in HTML?

16384.0 you can hide the address bar by setting location=no in the window.

How do I hide the address bar in Chrome pop up?

Open Google Chrome, navigate to Open-as-Popup extension's official page, and click on the Add to Chrome button. Click on Add extension in the confirmation prompt that appears. Once done, simply right-click on any website and select Toggle Open-as-Popup. It will then open without the address bar or toolbar.


2 Answers

location is the window feature you want to set to no or 0 to hide the address bar.

Opinionated Advice: You can't rely on popups showing because most people have popup blockers installed to curb abuse, so if you can get away with it, don't use a pop up at all! Use something like the jQuery UI Dialog plugin.

Example:

window.open("http://www.mydomain.com/mypage.htm", "mywindow", "location=0,menubar=0,status=0,scrollbars=0,width=100,height=100");

Format

window.open( [Url] [, Name] [, Features] [, History] )

Window features you can control

  • status The status bar at the bottom of the window.
  • toolbar The standard browser toolbar, with buttons such as Back and Forward.
  • location The Location entry field where you enter the URL.
  • menubar The menu bar of the window
  • resizable Allow/Disallow the user to resize the window.
  • scrollbars Enable the scrollbars if the document is bigger than the window
  • height Specifies the height of the window in pixels. (example: height=’350′)
  • width Specifies the width of the window in pixels.
like image 145
SavoryBytes Avatar answered Oct 16 '22 19:10

SavoryBytes


(untested)

function openWindow(){
var browser=navigator.appName;
if (browser==”Microsoft Internet Explorer”)
{
window.opener=self;

}
window.open(‘filename.htm’,'null’,'width=900,height=750,
toolbar=no,scrollbars=no,location=no,resizable =yes’);
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height-100);
self.close();
}

Got this from http://saher42.wordpress.com/2006/08/10/hiding-the-address-bar-on-pageload-using-javascript/.

like image 22
Paragon Avatar answered Oct 16 '22 20:10

Paragon