We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

window.open using _blank open in same window

  • 7 个回答
  • 8 人有此问题
  • 1 次查看
  • 最后回复者为 cmd1234

more options

It seems in the latest update when using window.open(url,'_blank') in place of opening the link in a new window/tab, it is opening it in the current tab

It seems in the latest update when using window.open(url,'_blank') in place of opening the link in a new window/tab, it is opening it in the current tab

被采纳的解决方案

We have found a fix to this...

var parentOpener = window.opener; window.opener = null; window.open(url,"_blank"); window.opener = parentOpener;

定位到答案原位置 👍 0

所有回复 (7)

more options

Could you please expand on your issue. If possible in point form so that we may help solve your issue.

What is page suppose to open to when start Firefox and is it doing what it you want ? What happens when open a new Tab ? Did you insert the old fix code into about:config ?

So sorta need more information if you would please

more options

A simple bit of java script that has worked for the last 10 years stopped working correctly on the latest Firefox update. The simple use of window.open( URL , "_blank") which will open the link in another tab, has stopped opening another tab and now open the link in the same window as the java script is running in.

more options

Might point out the link dose not return a HTML page, it returns a excel spread sheet.. We send a Json object to the server, it makes a excel spread sheet, and returns a link for the spread sheet, we use the link in window.open to download the spread sheet. In the past it use to open another tab and download the spread sheet it now opens that link in the current tab and not a new one.

more options

cmd1234 said

Might point out the link dose not return a HTML page, it returns a excel spread sheet..

So does window.open(URL, "_blank") work normally for HTML pages, and is broken only for downloads (content Firefox can't display in a tab or which has file-disposition:attachment)?

Test page for HTML: https://jeffersonscher.com/res/popit.html

For downloads: in the old days, you'd get a blank new tab and then Firefox would realize it's a download and close the blank tab. But in Firefox 54 instead of opening and closing a blank tab, do you find that Firefox closes the page you were on?

This thread has that scenario with a possible (client-side) workaround: opening a PDF document closes underyling window (workaround is to disable multiprocess)

Note: I have multiprocess disabled due to one or more of my extensions being incompatible, so I haven't been experiencing this myself.

more options

You can check some prefs on the about:config page if you haven't done this yet.

For links opened via JavaScript you can look at this pref:

You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.

more options

jscher2000 said

cmd1234 said
Might point out the link dose not return a HTML page, it returns a excel spread sheet..

So does window.open(URL, "_blank") work normally for HTML pages, and is broken only for downloads (content Firefox can't display in a tab or which has file-disposition:attachment)?

Test page for HTML: https://jeffersonscher.com/res/popit.html

For downloads: in the old days, you'd get a blank new tab and then Firefox would realize it's a download and close the blank tab. But in Firefox 54 instead of opening and closing a blank tab, do you find that Firefox closes the page you were on?

This thread has that scenario with a possible (client-side) workaround: opening a PDF document closes underyling window (workaround is to disable multiprocess)

Note: I have multiprocess disabled due to one or more of my extensions being incompatible, so I haven't been experiencing this myself.

opening a normal html page dose work ok. my settings for dom.ipc.processCount was already set too 1 and setting browser.tabs.remote.autostart.2 to false did fix the problem, but we can not tell all our clients to go into about:config and change there browser setting if we are going to tell our client anything it will be go and use chrome in place of firefox, as chrome and safari still work ok.

more options

选择的解决方案

We have found a fix to this...

var parentOpener = window.opener; window.opener = null; window.open(url,"_blank"); window.opener = parentOpener;