Open Bug 1576182 Opened 5 years ago Updated 2 years ago

Preventing default on middle-clicking does not prevent new tab from opening

Categories

(Core :: DOM: Events, defect, P3)

defect

Tracking

()

Tracking Status
firefox68 --- affected
firefox69 --- affected
firefox70 --- affected

People

(Reporter: jsmunroe, Unassigned)

Details

Attachments

(1 file)

Attached image TwoTabs.gif

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36

Steps to reproduce:

I created a jsfiddle link below to reproduce the issue minimally.

  1. Middle click the "Middle Click Me" link.
  2. If the allow popups notification displays select always allow. This time it will be only one tab.
  3. Close the tab.
  4. Middle click the "Middle Click Me" link again.

https://jsfiddle.net/jsmunroe/eap1b6k7/3/

Actual results:

Two tabs show up: one with the link passed into window.open, and another with the href from the clicked anchor element.

Expected results:

This appears to happen all within the window.open call. If i debug it all happens when I step over that line. I am calling preventDefault and my handler is only being called one time. This doesn't happen in other browsers.

I'm using FireFox 68.02.

Hi,
I can reproduce this on the latest builds from all channels.
Thanks for reporting!

Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
Version: other → unspecified

Not sure if this is by design to prevent sites from taking away the middle-click function.

Component: DOM: Core & HTML → DOM: Events
Priority: -- → P3
Summary: When calling window.open two tabs are created. → Preventing default on middle-clicking does not prevent new tab from opening
Severity: normal → S3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: