Preventing default on middle-clicking does not prevent new tab from opening
Categories
(Core :: DOM: Events, defect, P3)
Tracking
()
People
(Reporter: jsmunroe, Unassigned)
Details
Attachments
(1 file)
144.65 KB,
image/gif
|
Details |
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.
- Middle click the "Middle Click Me" link.
- If the allow popups notification displays select always allow. This time it will be only one tab.
- Close the tab.
- 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.
Comment 2•5 years ago
|
||
Hi,
I can reproduce this on the latest builds from all channels.
Thanks for reporting!
Comment 3•5 years ago
|
||
Not sure if this is by design to prevent sites from taking away the middle-click function.
Updated•2 years ago
|
Updated•2 years ago
|
Description
•