-5

Using JavaScript I want to open a new browser window with following characteristics. Please advise:

  1. Open a new window (not a new tab)
  2. New window shouldn't have toolbar, addressbar, menubar, statusbar
  3. New window should be maximized
  4. New window shouldn't be resizable
  5. From the new window, I should not be able to open a new tab
  6. The above should work with all modern browsers

Update: I have used the code from http://www.w3schools.com/jsref/met_win_open.asp with undesired results across browsers. For example, location=no still shows address bar in FireFox.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Kabeer
  • 4,138
  • 7
  • 40
  • 62

2 Answers2

1

For example, location=no still shows address bar in FireFox.

How to hide address bar in Firefox using javascript window.open

Setting the browser GUI is not a programmer's business. Users define it, not you.

Community
  • 1
  • 1
Kolyunya
  • 5,973
  • 7
  • 46
  • 81
  • Thanks Kolyunya, especially when others are being so judgmental & cynical about my question. – Kabeer Aug 22 '12 at 07:06
  • Doesn't the question you linked to have an answer using `location=no` - could you explain why that would work when Kabeer already said it doesn't? There's also a comment under that question saying it can't be done in FF... – nnnnnn Aug 22 '12 at 07:17
  • 1
    This is the answer to your question - it's just impossible to hide address bar in new versions of firefox and other browsers. In fact you can not hide **most** of gui elements. This is made in order to protect users from some crazy tricks, when hackers substitute OS windows to a browser window. – Kolyunya Aug 22 '12 at 07:23
  • 2
    This means, setting the browser GUI is not a programmer's business. Users define it, not you. – Kolyunya Aug 22 '12 at 07:24
1
  1. You can't override the browser settings, it will open in a tab if the user wants that.
  2. You can try menubar=0,location=0,status=0 in the feature string, but it's not likely that you will be able to remove all of them. The address field is generally impossible to remove in most browsers.
  3. You can't open a maximised window. You can try fullscreen=1 in the feature string, which would give a similar effect.
  4. You can try resizable=0 in the feature string, but it's not likely that it will make the window impossible to resize.
  5. That's not possible. You may be able to remove some of the ways to open a new window/tab (e.g. the menu), but the feature to open new windows can't be disabled.
  6. The support for this varies across browsers, you will never be able to make all this work in all browsers.

Look at Microsofts documentation of the open method, or window.open at Mozilla for a list of supported features.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005