New window opened via window.open should be in background when ctrl/cmd is pressed

NEW
Unassigned

Status

()

Firefox
Tabbed Browser
2 years ago
a year ago

People

(Reporter: xidorn, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox41 affected)

Details

(Reporter)

Description

2 years ago
Currently, if we click a link with ctrl/cmd pressed, the link will be opened in a new background tab. But this behavior is broken if the page calls preventDefault() on that click, and use window.open() to open the page instead.

This problem affects Gmail, which seems to use window.open() to open the links in emails.

And in general, when users are pressing ctrl/cmd, they should expect that any new tab to be opened in the background.

Chrome seems to solve this by opening any new tab in background if that key is pressed. We probably should follow this behavior.

A simple testcase:
data:text/html,<button onclick="window.open('about:blank')">hello</button>
You need to log in before you can comment on or make changes to this bug.