最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - window.open(url, windowname, opts) opens in new tab instead of new window in Firefox - Stack Overflow

programmeradmin3浏览0评论

Seems that (try at jsfiddle)

window.open('/', window_name, 'width=400,height=320');

pletely 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?

Seems that (try at jsfiddle)

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

pletely 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?

Share Improve this question edited May 23, 2017 at 12:15 CommunityBot 11 silver badge asked Mar 31, 2012 at 14:37 TomasTomas 59.6k54 gold badges249 silver badges382 bronze badges 7
  • possible duplicate of JavaScript open in a new window, not tab – Ry- Commented Mar 31, 2012 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 Commented Mar 31, 2012 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- Commented Mar 31, 2012 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 Commented Mar 31, 2012 at 14:47
  • Okay. So put a bounty on it saying the current answers are outdated. That's what it's for. – Ry- Commented Mar 31, 2012 at 14:54
 |  Show 2 more ments

2 Answers 2

Reset to default 9

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

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

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

and here:

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

发布评论

评论列表(0)

  1. 暂无评论