Closed Bug 1081542 Opened 11 years ago Closed 1 year ago

ctrl-click on a link which uses event.preventDefault() and window.open() should still obey browser.tabs.loadInBackground

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

RESOLVED FIXED
130 Branch
Webcompat Priority P3
Tracking Status
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- wontfix
firefox130 --- fixed

People

(Reporter: pascal.fischer.ac, Assigned: arai)

References

Details

(Whiteboard: [fidefe-quality-foundations])

Attachments

(8 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0 Build ID: 20140923175406 Steps to reproduce: Sometimes a click on a link while holding the Ctrl-Key opens the link in a background-tab (correct) but sometimes it also switches to that tab (incorrect). Actual results: Example: the German IT-news-website Heise.de. E.g. on http://www.heise.de/newsticker/meldung/Cascading-Stylesheets-20-Jahre-CSS-2415483.html Click the first 2 links: "Håkon Wium Lie" or "Cascading HTML style sheets" and the described happens. Expected results: It should open the links in background-tabs but stays in the current tab. Like it is meant and on most sites. But there are also many sites where the Ctrl-Click does something wrong like on this website.
I was able to reproduce this bug on Nightly 35.0a1 (2014-10-11), using Windows 7 x64. I think this issue belongs to the Firefox -> Tabbed Browser component. [bugday-20141013]
The due to http://www.heise.de/support/lib/external.js. $(document).on('click', "a[rel~=external]", function(e) { e.preventDefault(); var url = $(this).attr("href"); window.open(url, "_blank"); }); I think this is a site behavior, it can not be avoided.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Component: Untriaged → General
Resolution: --- → INVALID
But the normal user thinks, this is a fault of Firefox. Pop-ups are a site behavior too, but Firefox allows to block them. And because of a consistent user-experience, Ctrö-Click should always have the same effect. By the way: Chrome does it correctly. In the same example, Ctrl-Click opens a background-tab in Chrome.
Status: RESOLVED → UNCONFIRMED
Component: General → Untriaged
Product: Firefox → Core
Resolution: INVALID → ---
I totally agree with Pascal: Firefox should give the user a consistent user-experience (like the user wants it) and not some stupid, annoying behaviour that some sites want to force the user. And because Chrome does it right, it's certainly possible.
Leaving this in core because I think we'll need to curry modifier key info all through core in order to implement this - either that, or JS needs a way to query modifier state without an event object present.
Component: Untriaged → Document Navigation
OS: Windows 7 → All
Hardware: x86_64 → All
Summary: Ctrl-Click (open link in background-tab) doesn't always work correctly → ctrl-click on a link which uses event.preventDefault() and window.open() should still obey browser.tabs.loadInBackground
Version: 32 Branch → Trunk

on https://www.stuff.co.nz/
This is the code breaking the opening of the tab in the background. The tabs will open in the foreground instead.
see https://github.com/webcompat/web-bugs/issues/48651 for the details.

  function f(i) {
    var j,
    k,
    h;
    j = document.createElement('iframe');
    j.style.display = 'none';
    document.body.appendChild(j);
    k = j.contentDocument || j.contentWindow.document;
    h = k.createElement('script');
    h.type = 'text/javascript';
    h.text = '
        window.parent = null; 
        window.top = null;
        window.frameElement = null; 
        var child = window.open("' + i + '");
        child.opener = null
        ';
    k.body.appendChild(h);
    document.body.removeChild(j)
  }

This is working in Chrome and Safari as expected by the user.

Status: UNCONFIRMED → NEW
Webcompat Priority: --- → ?
Ever confirmed: true

Love to see this fixed. Now five years old!

<Ctrl><click> is honoured correctly in:
IE11
Edge (original and new)
G Chrome
Vivaldi
Safari (reported by Karl above)

It's just Firefox that it doesn't work correctly.

Does this click handler actually fire for the modifier-clicks / middle clicks in chrome/safari/whatever?

Flags: needinfo?(kdubost)

on macos this the meta key (aka command) which is used to open a new tab.
(Shift + click will open a new window, ctrl+click will open the contextual menu)

so looking at

            wrap: function(a, c, d) {
                if ("function" != typeof a)
                    return a;
                d = d || BOOMR.plugins.Errors.VIA_APP;
                BOOMR_check_doc_domain();
                return function() {
                    try {
                        return a.apply(c, arguments)
                    } catch (e) {
                        if (-2146823277 === e.number && (d === BOOMR.plugins.Errors.VIA_EVENTHANDLER || d === BOOMR.plugins.Errors.VIA_TIMEOUT))
                            return;
                        b.send(e, d);
                        e.reported = !0;
                        throw e
                    }
                }
            },

when breaking on mouse click
in chrome:

arguments[0].type
10:14:35.021 "click"
10:14:43.822 arguments[0].metaKey
10:14:43.829 true

same thing in firefox, and safari

All of that said it seems to happen in an iframe.
because of https://github.com/akamai/boomerang ?

Flags: needinfo?(kdubost)
Webcompat Priority: ? → revisit
See Also: → 935191
Webcompat Priority: revisit → P3
Severity: normal → S3
See Also: → 1878318
Duplicate of this bug: 1878318
See Also: 1878318
Whiteboard: [fidefe-quality-foundations]

This is very much still a thing 10 years later in February 2024. [CTRL] + <left mouse> click behavior in Firefox feels very erratic - for some sites it does what the official documentation says (open in the background / keeping focus on the current page where the click was issued), but for the other half it does not and focuses on and switches to the new tab, including i.e. Microsoft's Outlook / Office 365 web interface, compass.com and I could keep going if I kept a log throughout the day.

For an end user it makes no obvious sense why there is an inconsistent ([CTRL] +) link clicking behavior, especially when coming from other browsers when those, Chromium & Safari/Webkit based ones, manage to have [CTRL]+clicked links consistently & always open in the background.

(In reply to Jörg Battermann from comment #13)

This is very much still a thing 10 years later in February 2024. [CTRL] + <left mouse> click behavior in Firefox feels very erratic - for some sites it does what the official documentation says (open in the background / keeping focus on the current page where the click was issued), but for the other half it does not and focuses on and switches to the new tab, including i.e. Microsoft's Outlook / Office 365 web interface, compass.com and I could keep going if I kept a log throughout the day.

For an end user it makes no obvious sense why there is an inconsistent ([CTRL] +) link clicking behavior, especially when coming from other browsers when those, Chromium & Safari/Webkit based ones, manage to have [CTRL]+clicked links consistently & always open in the background.

Yep, that's a +1 from me too. It's been a long time, Firefox devs.

Depends on: 1880236
Duplicate of this bug: 1880236

Given meta/ctrl key should use browser.tabs.loadInBackground pref instead of
browser.tabs.loadDivertedInBackground pref, the existing
nsIBrowserDOMWindow.OPEN_NEWTAB behavior doesn't match the requirement.

Add dedicate flag for "open in foreground tab" to make it controllable from
nsWindowWatcher::IsWindowOpenLocationModified.

Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Depends on: 1873330
No longer depends on: 1880236
Attachment #9380350 - Attachment description: Bug 1081542 - Part 6: Reflect middle click to UserActivation::Modifiers, replacing unused Alt key. r?smaug! → Bug 1081542 - Part 6: Reflect middle click to UserActivation::Modifiers. r?smaug!
See Also: → 1882224
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/deb46de7b01c Part 1: Add nsIBrowserDOMWindow.OPEN_NEWTAB_FOREGROUND. r=smaug,geckoview-reviewers,Gijs,amejiamarmol https://hg.mozilla.org/integration/autoland/rev/758ad04a330e Part 2: Move browser.tabs.loadInBackground to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/c4530ae2b9e3 Part 3: Reflect browser.tabs.loadInBackground to window.open with meta/ctrl key. r=smaug https://hg.mozilla.org/integration/autoland/rev/56fb245cd38e Part 4: Move browser.tabs.opentabfor.middleclick to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/ade6db42285d Part 5: Move middlemouse.openNewWindow to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/8d495120e6d2 Part 6: Reflect middle click to UserActivation::Modifiers. r=smaug https://hg.mozilla.org/integration/autoland/rev/9f3fe37b77ca Part 7: Reflect middle click to window.open. r=smaug https://hg.mozilla.org/integration/autoland/rev/3cc96704d17f Part 8: Add tests. r=smaug

Backed out for causing bc failures in browser_cancel_starting_autoscrolling_requested_by_background_tab.js

Flags: needinfo?(arai.unmht)
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/27dae926668f Part 1: Add nsIBrowserDOMWindow.OPEN_NEWTAB_FOREGROUND. r=smaug,geckoview-reviewers,Gijs,amejiamarmol https://hg.mozilla.org/integration/autoland/rev/0a6b3d90e636 Part 2: Move browser.tabs.loadInBackground to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/d29d7e9c38bd Part 3: Reflect browser.tabs.loadInBackground to window.open with meta/ctrl key. r=smaug https://hg.mozilla.org/integration/autoland/rev/7f46e8820023 Part 4: Move browser.tabs.opentabfor.middleclick to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/058d5712354b Part 5: Move middlemouse.openNewWindow to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/29f139450ccc Part 6: Reflect middle click to UserActivation::Modifiers. r=smaug https://hg.mozilla.org/integration/autoland/rev/7571e95ed78c Part 7: Reflect middle click to window.open. r=smaug https://hg.mozilla.org/integration/autoland/rev/38614c34e575 Part 8: Add tests. r=smaug
Attachment #9386986 - Attachment is obsolete: true
Flags: needinfo?(arai.unmht)
Regressions: 1885050

Backed out for causing Bug 1885050

Status: RESOLVED → REOPENED
Flags: needinfo?(arai.unmht)
Resolution: FIXED → ---
Target Milestone: 125 Branch → ---
Flags: needinfo?(arai.unmht)

So, here's some more investigation after the mousedown regression.

Chromium reflects the modifiers for click and auxclick, but not for mousedown.
some website uses mousedown event handler for middle-click, for calling window.open, and in that case Chromium opens the tab as foreground, regardless of the button or modifiers. Here, opening a foreground tab for mousedown prevents regular click behavior for the element (because the original page is already hidden when the mouse button is released), and bug 1885050 case is caused by that. Website doesn't prevent regular click behavior for the element, and opening a background tab there can also trigger the regular click behavior, which results in opening the link twice.
Then, auxclick is also called for middle-click, and Chromium opens the tab as background here, and holding shift-key opens the tab as foreground.
So, the difference between mousedown vs auxclick should be reflected to the behavior here.

The same behavior can be achieved by somehow not reflecting the modifiers/middle-click for mousedown (maybe some more), and reflect the modifiers/middle-click for click, auxclick, (and possibly some keyboard event).

I'll check more combinations of the event handlers and modifier keys, and then update the patch.

Here's the result of (window.open features, modifiers, element, event, mouse button) combinations.
Firefox column is the result with the patches applied.

There are so many categories with different kind of behavior, but I think the current patch's way is mostly reasonable, except for the bug 1885050's case, where Chromium doesn't reflect modifiers/middle-click on some events.

window.open, no features

no modifiers

Chromium doesn't reflect middle-click in onmousedown/onpointerdown.
Safari doesn't allow window.open in oncontextmenu/onchange

event Chromium Safari Firefox Note
DIV onclick fg tab fg tab fg tab
A onclick fg tab fg tab fg tab
DIV onclick + middle - BG tab - Safari handles middle-click with onclick
A onclick + middle - BG tab -
DIV ondblclick fg tab fg tab fg tab
A ondblclick fg tab fg tab fg tab
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup fg tab fg tab fg tab
A onmouseup fg tab fg tab fg tab
DIV onmouseup + middle BG tab BG tab BG tab
A onmouseup + middle BG tab BG tab BG tab
DIV onpointerup fg tab fg tab fg tab
A onpointerup fg tab fg tab fg tab
DIV onpointerup + middle BG tab BG tab BG tab
A onpointerup + middle BG tab BG tab BG tab
DIV onauxclick + middle BG tab - BG tab Safari doesn't support onauxclick
A onauxclick + middle BG tab - BG tab
DIV onmousedown fg tab fg tab fg tab
A onmousedown fg tab fg tab fg tab
DIV onmousedown + middle fg tab BG tab BG tab Chrome doesn't reflect middle-click for "down" events (bug 1885050)
A onmousedown + middle fg tab BG tab BG tab
DIV onpointerdown fg tab fg tab fg tab
A onpointerdown fg tab fg tab fg tab
DIV onpointerdown + middle fg tab BG tab BG tab
A onpointerdown + middle fg tab BG tab BG tab
DIV oncontextmenu fg tab (blocked) fg tab
A oncontextmenu fg tab (blocked) fg tab
FORM onreset fg tab fg tab fg tab
FORM onsubmit fg tab fg tab fg tab
SELECT onchange fg tab (blocked) fg tab

shift

In most case "shift" is for "open a window", and "shift+middle-click" is for "open in foreground tab".

event Chromium Safari Firefox Note
DIV onclick window window window
A onclick window window window
DIV onclick + middle - fg tab -
A onclick + middle - fg tab -
DIV ondblclick window window window
A ondblclick window window window
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup window window window
A onmouseup window window window
DIV onmouseup + middle fg tab fg tab fg tab
A onmouseup + middle fg tab fg tab fg tab
DIV onpointerup window window window
A onpointerup window window window
DIV onpointerup + middle fg tab fg tab fg tab
A onpointerup + middle fg tab fg tab fg tab
DIV onauxclick + middle fg tab - fg tab
A onauxclick + middle fg tab - fg tab
DIV onmousedown fg tab window window
A onmousedown fg tab window window
DIV onmousedown + middle fg tab fg tab fg tab
A onmousedown + middle fg tab fg tab fg tab
DIV onpointerdown fg tab window window
A onpointerdown fg tab window window
DIV onpointerdown + middle fg tab fg tab fg tab
A onpointerdown + middle fg tab fg tab fg tab
DIV oncontextmenu fg tab (blocked) -
A oncontextmenu fg tab (blocked) -
FORM onreset window window window
FORM onsubmit window window window
SELECT onchange fg tab (blocked) fg tab SELECT doesn't reflect modifiers

meta

In most case "meta" is for "open in background tab".

event Chromium Safari Firefox Note
DIV onclick BG tab BG tab BG tab
A onclick BG tab BG tab BG tab
DIV onclick + middle - BG tab -
A onclick + middle - BG tab -
DIV ondblclick BG tab BG tab BG tab
A ondblclick BG tab BG tab BG tab
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup BG tab BG tab BG tab
A onmouseup BG tab BG tab BG tab
DIV onmouseup + middle BG tab BG tab BG tab
A onmouseup + middle BG tab BG tab BG tab
DIV onpointerup BG tab BG tab BG tab
A onpointerup BG tab BG tab BG tab
DIV onpointerup + middle BG tab BG tab BG tab
A onpointerup + middle BG tab BG tab BG tab
DIV onauxclick + middle BG tab - BG tab
A onauxclick + middle BG tab - BG tab
DIV onmousedown fg tab BG tab BG tab
A onmousedown fg tab BG tab BG tab
DIV onmousedown + middle fg tab BG tab BG tab
A onmousedown + middle fg tab BG tab BG tab
DIV onpointerdown fg tab BG tab BG tab
A onpointerdown fg tab BG tab BG tab
DIV onpointerdown + middle fg tab BG tab BG tab
A onpointerdown + middle fg tab BG tab BG tab
DIV oncontextmenu fg tab (blocked) BG tab
A oncontextmenu fg tab (blocked) BG tab
FORM onreset BG tab BG tab BG tab
FORM onsubmit BG tab BG tab BG tab
SELECT onchange fg tab (blocked) fg tab

shift+meta

In most case "shift+meta" is for "open in foreground tab".
(This is same as the default behavior for "no features")

event Chromium Safari Firefox Note
DIV onclick fg tab fg tab fg tab
A onclick fg tab fg tab fg tab
DIV onclick + middle - fg tab -
A onclick + middle - fg tab -
DIV ondblclick fg tab fg tab fg tab
A ondblclick fg tab fg tab fg tab
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup fg tab fg tab fg tab
A onmouseup fg tab fg tab fg tab
DIV onmouseup + middle fg tab fg tab fg tab
A onmouseup + middle fg tab fg tab fg tab
DIV onpointerup fg tab fg tab fg tab
A onpointerup fg tab fg tab fg tab
DIV onpointerup + middle fg tab fg tab fg tab
A onpointerup + middle fg tab fg tab fg tab
DIV onauxclick + middle fg tab - fg tab
A onauxclick + middle fg tab - fg tab
DIV onmousedown fg tab fg tab fg tab
A onmousedown fg tab fg tab fg tab
DIV onmousedown + middle fg tab fg tab fg tab
A onmousedown + middle fg tab fg tab fg tab
DIV onpointerdown fg tab fg tab fg tab
A onpointerdown fg tab fg tab fg tab
DIV onpointerdown + middle fg tab fg tab fg tab
A onpointerdown + middle fg tab fg tab fg tab
DIV oncontextmenu fg tab (blocked) -
A oncontextmenu fg tab (blocked) -
FORM onreset fg tab fg tab fg tab
FORM onsubmit fg tab fg tab fg tab
SELECT onchange fg tab (blocked) fg tab

alt

"alt" has no effect on Chromium and Firefox except for some link case.
"alt" is for "open in new window" on Safari.

event Chromium Safari Firefox Note
DIV onclick fg tab window fg tab
A onclick - window fg tab
DIV onclick + middle - window -
A onclick + middle - window -
DIV ondblclick fg tab window fg tab
A ondblclick - window fg tab
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup fg tab window fg tab
A onmouseup fg tab window fg tab
DIV onmouseup + middle BG tab window BG tab
A onmouseup + middle BG tab window BG tab
DIV onpointerup fg tab window fg tab
A onpointerup fg tab window fg tab
DIV onpointerup + middle BG tab window BG tab
A onpointerup + middle BG tab window BG tab
DIV onauxclick + middle BG tab - BG tab
A onauxclick + middle BG tab - BG tab
DIV onmousedown fg tab window fg tab
A onmousedown fg tab window fg tab
DIV onmousedown + middle fg tab window BG tab
A onmousedown + middle fg tab window BG tab
DIV onpointerdown fg tab window fg tab
A onpointerdown fg tab window fg tab
DIV onpointerdown + middle fg tab window BG tab
A onpointerdown + middle fg tab window BG tab
DIV oncontextmenu fg tab (blocked) fg tab
A oncontextmenu fg tab (blocked) fg tab
FORM onreset fg tab window fg tab
FORM onsubmit fg tab window fg tab
SELECT onchange fg tab (blocked) fg tab

window.open, features=popup

no modifiers

features=popup has higher priority than middle-click on Safari.

event Chromium Safari Firefox Note
DIV onclick popup popup popup
A onclick popup popup popup
DIV onclick + middle - popup -
A onclick + middle - popup -
DIV ondblclick popup popup popup
A ondblclick popup popup popup
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup popup popup popup
A onmouseup popup popup popup
DIV onmouseup + middle BG tab popup BG tab
A onmouseup + middle BG tab popup BG tab
DIV onpointerup popup popup popup
A onpointerup popup popup popup
DIV onpointerup + middle BG tab popup BG tab
A onpointerup + middle BG tab popup BG tab
DIV onauxclick + middle BG tab - BG tab
A onauxclick + middle BG tab - BG tab
DIV onmousedown popup popup popup
A onmousedown popup popup popup
DIV onmousedown + middle popup popup BG tab Only Firefox uses tab for this combination
A onmousedown + middle popup popup BG tab
DIV onpointerdown popup popup popup
A onpointerdown popup popup popup
DIV onpointerdown + middle popup popup BG tab
A onpointerdown + middle popup popup BG tab
DIV oncontextmenu popup (blocked) popup
A oncontextmenu popup (blocked) popup
FORM onreset popup popup popup
FORM onsubmit popup popup popup
SELECT onchange popup (blocked) popup

shift

features=popup has higher priority than shift on Chromium and Safari.
Firefox uses "open a window", but others use "open a popup".

IMO, this is fine, given the difference is only about the UI parts, and the effect is almost same around focus etc.

event Chromium Safari Firefox Note
DIV onclick popup popup window
A onclick popup popup window
DIV onclick + middle - popup -
A onclick + middle - popup -
DIV ondblclick popup popup window
A ondblclick popup popup window
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup popup popup window
A onmouseup popup popup window
DIV onmouseup + middle fg tab popup fg tab
A onmouseup + middle fg tab popup fg tab
DIV onpointerup popup popup window
A onpointerup popup popup window
DIV onpointerup + middle fg tab popup fg tab
A onpointerup + middle fg tab popup fg tab
DIV onauxclick + middle fg tab - fg tab
A onauxclick + middle fg tab - fg tab
DIV onmousedown popup popup window
A onmousedown popup popup window
DIV onmousedown + middle popup popup fg tab
A onmousedown + middle popup popup fg tab
DIV onpointerdown popup popup window
A onpointerdown popup popup window
DIV onpointerdown + middle popup popup fg tab
A onpointerdown + middle popup popup fg tab
DIV oncontextmenu popup (blocked) -
A oncontextmenu popup (blocked) -
FORM onreset popup popup window
FORM onsubmit popup popup window
SELECT onchange popup (blocked) popup

meta

features=popup has higher priority than meta on Safari but not on others.

event Chromium Safari Firefox Note
DIV onclick BG tab popup BG tab
A onclick BG tab popup BG tab
DIV onclick + middle - popup -
A onclick + middle - popup -
DIV ondblclick BG tab popup BG tab
A ondblclick BG tab popup BG tab
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup BG tab popup BG tab
A onmouseup BG tab popup BG tab
DIV onmouseup + middle BG tab popup BG tab
A onmouseup + middle BG tab popup BG tab
DIV onpointerup BG tab popup BG tab
A onpointerup BG tab popup BG tab
DIV onpointerup + middle BG tab popup BG tab
A onpointerup + middle BG tab popup BG tab
DIV onauxclick + middle BG tab - BG tab
A onauxclick + middle BG tab - BG tab
DIV onmousedown popup popup BG tab
A onmousedown popup popup BG tab
DIV onmousedown + middle popup popup BG tab
A onmousedown + middle popup popup BG tab
DIV onpointerdown popup popup BG tab
A onpointerdown popup popup BG tab
DIV onpointerdown + middle popup popup BG tab
A onpointerdown + middle popup popup BG tab
DIV oncontextmenu popup (blocked) BG tab
A oncontextmenu popup (blocked) BG tab
FORM onreset BG tab popup BG tab
FORM onsubmit BG tab BG tab BG tab Somehow Safari uses background tab for this
SELECT onchange popup (blocked) popup

shift+meta

event Chromium Safari Firefox Note
DIV onclick fg tab popup fg tab
A onclick fg tab popup fg tab
DIV onclick + middle - popup -
A onclick + middle - popup -
DIV ondblclick fg tab popup fg tab
A ondblclick fg tab popup fg tab
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup fg tab popup fg tab
A onmouseup fg tab popup fg tab
DIV onmouseup + middle fg tab popup fg tab
A onmouseup + middle fg tab popup fg tab
DIV onpointerup fg tab popup fg tab
A onpointerup fg tab popup fg tab
DIV onpointerup + middle fg tab popup fg tab
A onpointerup + middle fg tab popup fg tab
DIV onauxclick + middle fg tab - fg tab
A onauxclick + middle fg tab - fg tab
DIV onmousedown popup popup fg tab
A onmousedown popup popup fg tab
DIV onmousedown + middle popup popup fg tab
A onmousedown + middle popup popup fg tab
DIV onpointerdown popup popup fg tab
A onpointerdown popup popup fg tab
DIV onpointerdown + middle popup popup fg tab
A onpointerdown + middle popup popup fg tab
DIV oncontextmenu popup (blocked) -
A oncontextmenu popup (blocked) -
FORM onreset fg tab popup fg tab
FORM onsubmit fg tab popup fg tab
SELECT onchange popup (blocked) popup

alt

event Chromium Safari Firefox Note
DIV onclick popup popup popup
A onclick - popup popup
DIV onclick + middle - popup -
A onclick + middle - popup -
DIV ondblclick popup popup popup
A ondblclick - popup popup
DIV ondblclick + middle - - -
A ondblclick + middle - - -
DIV onmouseup popup popup popup
A onmouseup popup popup popup
DIV onmouseup + middle BG tab popup BG tab
A onmouseup + middle BG tab popup BG tab
DIV onpointerup popup popup popup
A onpointerup popup popup popup
DIV onpointerup + middle BG tab popup BG tab
A onpointerup + middle BG tab popup BG tab
DIV onauxclick + middle BG tab - BG tab
A onauxclick + middle BG tab - BG tab
DIV onmousedown popup popup popup
A onmousedown popup popup popup
DIV onmousedown + middle popup popup BG tab
A onmousedown + middle popup popup BG tab
DIV onpointerdown popup popup popup
A onpointerdown popup popup popup
DIV onpointerdown + middle popup popup BG tab
A onpointerdown + middle popup popup BG tab
DIV oncontextmenu popup (blocked) popup
A oncontextmenu popup (blocked) popup
FORM onreset popup popup popup
FORM onsubmit popup popup popup
SELECT onchange popup (blocked) popup

Given Safari agrees with mousedown behavior, I'll look into re-landing this after contacting the Jira support.

Jira's code seems to be fixed not to call window.open that conflicts with regular link behavior.
I'll look into re-landing the patch stack after testing some more.

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/a7a8b0ec681f Part 1: Add nsIBrowserDOMWindow.OPEN_NEWTAB_FOREGROUND. r=smaug,geckoview-reviewers,Gijs,amejiamarmol,tabbrowser-reviewers,dao https://hg.mozilla.org/integration/autoland/rev/b76f89a10cf5 Part 2: Move browser.tabs.loadInBackground to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/c77057e2afd2 Part 3: Reflect browser.tabs.loadInBackground to window.open with meta/ctrl key. r=smaug https://hg.mozilla.org/integration/autoland/rev/8023a5847e17 Part 4: Move browser.tabs.opentabfor.middleclick to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/3cd13abc6a25 Part 5: Move middlemouse.openNewWindow to StaticPrefList.yaml to access it from nsWindowWatcher::IsWindowOpenLocationModified. r=smaug https://hg.mozilla.org/integration/autoland/rev/2c81d022c833 Part 6: Reflect middle click to UserActivation::Modifiers. r=smaug https://hg.mozilla.org/integration/autoland/rev/6401337cd41b Part 7: Reflect middle click to window.open. r=smaug https://hg.mozilla.org/integration/autoland/rev/21b7c90f196d Part 8: Add tests. r=smaug,tabbrowser-reviewers,mak
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: