Open
Bug 1204440
Opened 10 years ago
Updated 1 year ago
Command + click sometimes goes to the new tab even if the option is disabled
Categories
(Firefox :: Tabbed Browser, defect)
Tracking
()
NEW
People
(Reporter: nicolas, Assigned: mconley)
References
Details
(Keywords: testcase)
Attachments
(1 file)
|
423 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0
Build ID: 20150826023504
Steps to reproduce:
- Uncheck "When I open a link in a new tab, switch to it immediately" in the settings if currently checked
- Go to 500px[1] or Pinterest[2] search page for "kittens" (should be sfw)
- Command + click on one of the photo thumbnails
[1] https://500px.com/search?q=kittens&type=photos&sort=pulse
[2] https://www.pinterest.com/search/pins/?q=kittens&term_meta[]=kittens|typed
Actual results:
The linked page opens in a new tab, which gets the focus.
Expected results:
The tab should have been opened in background, not get the focus.
The support page[3] states this:
> When you middle-click on a Web link (or hold down command while clicking with the left mouse button), the page will be opened in a new tab. That page will not be displayed and will load in a background tab.
The link has a proper href, and I suspect there is some JavaScript event triggered, but middle-click on the same link in the same Firefox do open in a background tab.
[3] https://support.mozilla.org/en-US/kb/startup-home-page-tabs-download-settings#w_tabs
Component: Untriaged → Tabbed Browser
| Reporter | ||
Comment 1•10 years ago
|
||
500px's new profile page[1] now opens JS popins for every image instead of plain old pages, making this issue even more annoying… :-/
[1] https://iso.500px.com/introducing-the-new-500px-experience/
Comment 2•10 years ago
|
||
I reproduce the issue from comment 0 for 500px but not for pinterest.
I also see that middle clicking works as intended.
The best would be to have a simpler testcase...
(In reply to Nicolas Hoizey from comment #1)
> 500px's new profile page[1] now opens JS popins for every image instead of
> plain old pages, making this issue even more annoying… :-/
>
> [1] https://iso.500px.com/introducing-the-new-500px-experience/
Do you have a direct link to such a profile page ?
| Reporter | ||
Comment 3•10 years ago
|
||
(In reply to Julien Wajsberg [:julienw] from comment #2)
> I reproduce the issue from comment 0 for 500px but not for pinterest.
> I also see that middle clicking works as intended.
>
> The best would be to have a simpler testcase...
>
>
> (In reply to Nicolas Hoizey from comment #1)
> > 500px's new profile page[1] now opens JS popins for every image instead of
> > plain old pages, making this issue even more annoying… :-/
> >
> > [1] https://iso.500px.com/introducing-the-new-500px-experience/
>
> Do you have a direct link to such a profile page ?
Mine, for example: https://500px.com/nhoizey
Comment 4•10 years ago
|
||
With the devtools I see they have this code running on click:
o.prototype.onPhotoClicked = function(t) {
var e, o, r, n, s;
return o = this.model.getPhoto(), i() || t.metaKey || t.ctrlKey ? ("function" == typeof(n = this.model.collection).selectPhoto && n.selectPhoto(o), r = "function" == typeof(s = this.model.collection).buildBrowserUrlParams ? s.buildBrowserUrlParams() : void 0, e = o.get("url"), null != r && (e += "?" + $.param(r)), i() ? document.location = e : window.open(e, "_blank")) : App.vent.trigger(this.eventName, o, {
navigationContext: this.model.collection
}), !1
}
So I'd say that they call `window.open(..., "_blank")` when we ctrl + click. To be verified of course.
Comment 5•10 years ago
|
||
(In reply to Nicolas Hoizey from comment #3)
> (In reply to Julien Wajsberg [:julienw] from comment #2)
> > I reproduce the issue from comment 0 for 500px but not for pinterest.
> > I also see that middle clicking works as intended.
> >
> > The best would be to have a simpler testcase...
> >
> >
> > (In reply to Nicolas Hoizey from comment #1)
> > > 500px's new profile page[1] now opens JS popins for every image instead of
> > > plain old pages, making this issue even more annoying… :-/
> > >
> > > [1] https://iso.500px.com/introducing-the-new-500px-experience/
> >
> > Do you have a direct link to such a profile page ?
>
> Mine, for example: https://500px.com/nhoizey
OK, thanks, this seems to be the same behavior than on search pages.
Comment 6•10 years ago
|
||
I think this reproduces the issue properly.
Likely we should obey the setting when the app uses window.open() on a command+click event.
Updated•10 years ago
|
Keywords: testcase-wanted
Updated•10 years ago
|
status-firefox44:
--- → affected
| Reporter | ||
Comment 7•9 years ago
|
||
There is no more issue on Pinterest, but still on 500px.
Comment 8•9 years ago
|
||
Andrew, do you know who could help us with that? thanks
| Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(mconley)
Comment 9•9 years ago
|
||
Olli and and I chatted a bit about this and he said "Pushing information that click event + ctrl is on stack when window.open is called [may be possible]. This would be mostly WindowWatcher and FF UI stuff."
Mike's going to take a look (thanks!).
Flags: needinfo?(overholt)
| Assignee | ||
Comment 10•9 years ago
|
||
This is now on my plate. A few other things are currently on fire at the moment, but I hope to get to this later in the week if possible.
Flags: needinfo?(mconley)
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → mconley
| Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(mconley)
| Assignee | ||
Comment 11•9 years ago
|
||
This feels kind of related to bug 1310677, fwiw.
See Also: → 1310677
Comment 12•9 years ago
|
||
Well, not completely; in the context of this bug, it's a question that "command + click" is not obeyed. There is nothing about this in the other bug :) "command + click" makes it really clear about what the user intention is: open in the background the clicked tab.
| Assignee | ||
Comment 13•9 years ago
|
||
So some JS is responding to a click event and calling window.open. Bleh.
Hey smaug, here's my plan for this one:
1) Augment AutoHandlingUserInputStatePusher so that it looks at key modifiers, and tells the ESM about it via static void StartHandlingUserInput
2) Add a static EventStateManager::CurrentUserInputModifiers that returns modifier keys if there's currently a user event being handled on the stack
3) Have nsGlobalWindow::OpenJS (or maybe nsGlobalWindow::OpenInternal?) query EventStateManager::CurrentUserInputModifiers, and pass any modifiers along to nsWindowWatcher
4) Have nsWindowWatcher pass those modifiers along to ProvideWindow. If ProvideWindow determines that we're opening a new tab, pass those modifiers along to nsIBrowserDOMWindow's openURI
5) Have the browser front end determine how to deal with any modifiers that are being passed in. From there, the front-end JS can trivially decide to open a new tab in the background if the modifiers seem appropriate.
Does that sound like a reasonable way forward? Or is there a better path that I'm not seeing?
Flags: needinfo?(mconley) → needinfo?(bugs)
Comment 14•5 years ago
|
||
Sounds reasonable (tiny bit delay with replying ;) )
Flags: needinfo?(bugs)
| Reporter | ||
Comment 15•4 years ago
|
||
I now have this issue in Flickr's search results:
https://www.flickr.com/search/?text=firefox
Updated•3 years ago
|
Severity: normal → S3
| Reporter | ||
Comment 16•1 year ago
|
||
It looks like the issue is not there anymore, at least on Flickr.
On the 500px page I listed when opening the bug, the behavior is now different, the linked page opens in current tab even if I click Command. I wish they knew how to develop for the Web.
On Pinterest, the issue is still there, the browser switch to the newly opened tab immediately.
So I guess Flickr did fix something on their side.
So the issue in Firefox is still there IMHO.
You need to log in
before you can comment on or make changes to this bug.
Description
•