3

Seems that (try at jsfiddle)

window.open('http://www.google.com/', window_name, 'width=400,height=320');

completely stops opening new window in Firefox, whatever you put as window_name (_blank, whatever..)! This must have worked recently (year ago), but now it stopped working! It must be some quite new change in Firefox in the past, also answers to this question prove this - they worked before but don't work any more!

My suspicion is that it stopped working because the option "Open new windows in new tab instead" (Tools / Options / Tabs) is now true by default! It must be a recent change.

My use case really needs to open just a small simple window with legend - opening new tab for this is overkill.

The problem is that it is a default and normal users are not aware of this setting - they just see that the website behaves strange!

Is there any way to override Firefox behaviour?

Community
  • 1
  • 1
Tomas
  • 57,621
  • 49
  • 238
  • 373
  • possible duplicate of [JavaScript open in a new window, not tab](http://stackoverflow.com/questions/726761/javascript-open-in-a-new-window-not-tab) – Ry- Mar 31 '12 at 14:41
  • 5
    OMG @minitech, have you read my question?? Please read it first to see why it's not a duplicate! I'm even citing it!! – Tomas Mar 31 '12 at 14:43
  • 1
    I have. You know, old questions aren't dead. Try the other solutions, if they don't work, put a bounty or something on the question. This is *the same question*. – Ry- Mar 31 '12 at 14:44
  • @minitech, if you read the first line of the linked question, it is about `window.open(url)` while my question is about `window.open(url, window, opts)` which is a **big** difference here! This question is about more specific case, which solved the previous question, but now stopped working!! – Tomas Mar 31 '12 at 14:47
  • Okay. So put a bounty on it saying the current answers are outdated. That's what it's for. – Ry- Mar 31 '12 at 14:54
  • @minitech, I just tried to explain you that my question is different. – Tomas Mar 31 '12 at 14:58
  • And I just tried to explain to you that it's actually the same. If you'd like, I can put a bounty on it for you. Yeesh. – Ry- Mar 31 '12 at 15:00

2 Answers2

9

Your fiddle does not contain the code that you posted. This one just works fine: http://jsfiddle.net/HLbLu/

Note that for some reason calling window.open(...) is not the same as calling open(...).

user123444555621
  • 148,182
  • 27
  • 114
  • 126
  • 1
    great!!! You made my day, I replaced all my calls to `open` with `window.open` and it works!! It must be some recent change in FF, because until now I only used `open`... – Tomas Apr 01 '12 at 16:29
  • But now I'm totally confused! How is it possible that `open` and `window.open` aren't the same?? Look at this example: http://artax.karlin.mff.cuni.cz/~ttel5535/pok_js/window.html – Tomas Apr 01 '12 at 16:36
  • I posted a [separate question on this](http://stackoverflow.com/questions/9966182/what-is-the-difference-between-open-and-window-open)... – Tomas Apr 01 '12 at 16:46
  • @Pumbaa80 how is open different from window.open? – Atif Sep 11 '13 at 17:34
  • @AtifMohammedAmeenuddin Please see the [follow-up question by Tomas](http://stackoverflow.com/a/9970045/27862). – user123444555621 Sep 11 '13 at 21:12
  • For what it's worth – taking a hint from https://stackoverflow.com/a/9962027/38108 – https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Avoid_resorting_to_window.open() advises "Generally speaking, it is preferable to avoid resorting to window.open() for several reasons: …" – Graham Perrin Dec 23 '17 at 21:34
0

From Mozilla: https://developer.mozilla.org/en/DOM/window.open#section_31

and here:

http://www.gtalbot.org/FirefoxSection/Popup/PopupAndFirefox.html

Andrew Briggs
  • 1,329
  • 12
  • 26