Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

window.open using _blank open in same window

  • 7 trả lời
  • 8 gặp vấn đề này
  • 234 lượt xem
  • Trả lời mới nhất được viết bởi 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

Giải pháp được chọn

We have found a fix to this...

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

Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (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

Giải pháp được chọn

We have found a fix to this...

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