https://www.duolingo.com/chrisfay

Detect 'control + click/command + click'

This goes for really any Duolingo application specific href – please detect 'command + click' so that I can open main nav links, discussion topics, etc... in a new tab without having to 'Right click → Open in new tab'. I am often paginated into the discussion list and accidentally command click a topic expecting it to spawn a tab and lose my place.

kthxbye!

http://stackoverflow.com/questions/10660360/command-click-doesnt-open-a-new-tab-but-middle-click-does

http://stackoverflow.com/questions/10910554/how-to-detect-command-shift-click-for-os-x-in-javascript

December 2, 2013

22 Comments


https://www.duolingo.com/bchan

What browser/version are you currently using?

December 2, 2013

https://www.duolingo.com/pont

Copy-pasting in my report from the previous discussion of this at http://www.duolingo.com/comment/1025495 :

Yes, I've noticed this too -- ctrl-click used to work at some point, but it changed a while ago. For reference, I've just tested ctrl-click with:

  • Chrome 30.0.1599.101 on Ubuntu 12.04 64-bit
  • Firefox 24.0 on Ubuntu 12.04 64-bit
  • Chrome 30.0.1599.101 m on Windows XP SP3 32-bit (VirtualBox, 64-bit Ubuntu host)

All these browsers open links in new tabs on ctrl-left-click, except within the main duolingo.com website, where the link replaces the content in the current tab (i.e. same behaviour as left-clicking with no modifier keys). For example, links from http://blog.duolingo.com/ open in new tabs if Ctrl is held down.

I personally would be keen to see this fixed. Most touchpads don't have a middle button so it makes the website (especially the forums) less convenient to use on a laptop.

dqxxmvyvoedn

December 2, 2013

https://www.duolingo.com/bchan

Odd - there was this discussion (http://www.duolingo.com/comment/576069) which indicated to me that it was working in Chrome 29, but perhaps it went back to not working in 30. I'll look into it more - thanks for the report (and the follow up investigations =P).

December 2, 2013

https://www.duolingo.com/chrisfay

For what it's worth, I just tested on Firefox and Safari (Mac 10.8.2 both latest browser stable) and experienced the same behavior – command+click failed to spawn a new tab, rendering the resource in the same window via xhr.

Rather than a browser bug, I have a feeling it is due to the nature of the click event handling within Duolingo's single page architecture. Just a thought, but maybe add some event handler logic to allow the browser to natively handle this specific key combo rather than preventDefault() + submitting the async request (as noted here http://stackoverflow.com/questions/10660360/command-click-doesnt-open-a-new-tab-but-middle-click-does, which I think accurately addresses this).

This isn't a huge deal, but would be nice for those of us who are link-spawn-trigger-happy :)

December 2, 2013

https://www.duolingo.com/chrisfay

Another similar note about this behavior with a similar resolution here http://stackoverflow.com/questions/10910554/how-to-detect-command-shift-click-for-os-x-in-javascript.

Just need to add a simple method like the below pseudocode to determine whether or not to handle the route in Backbone or native browser...

function followLink(e) {
..If command+click used (e.metaKey || e.ctrlKey)
....let the browser handle it natively
..else
....preventDefault
....navigate link via Backbone router
}

December 2, 2013

https://www.duolingo.com/_pinkodoug_

As an experiment, I just pasted the links from the top navbar into a bare-bones html file with no scripts. The hashes in the URLs had zero effect on ctrl-click behavior in Chrome (Version 31.0.1650.57 m) or in Firefox (25.0.1), yet they don't work correctly from the main Duo page. This supports chrisfay's suggestion that this is probably an event handling issue rather than a browser compatibility issue.

Another bit of evidence: ctrl-clicking any user's profile on this forum page will not open in another browser tab, yet there are no hashes in any of those URLs.

December 2, 2013

https://www.duolingo.com/chrisfay

Mac/Chrome, latest stable.

December 2, 2013

https://www.duolingo.com/nicole54843

Ctrl-click doesn't work for me. Chrome Version 33.0.1712.4 dev-m

December 2, 2013

https://www.duolingo.com/Whiterun

This works for me on Mac with Safari v7.0 but not with firefox 24.0.

December 2, 2013

https://www.duolingo.com/chrisfay

Are you sure? I just tested and it doesn't work. If you command + click a link in the Duolingo main nav using Safari it spawns in a new tab for you?

December 4, 2013

https://www.duolingo.com/swingophelia

I have this problem ongoingly, and am using Chrome Version 31.0.1650.63 on Mac OS 10.6.8

December 27, 2013

https://www.duolingo.com/pont

This has been reported previously, at http://www.duolingo.com/comment/1025495 . Unfortunately, judging by the lack of comments or upvotes on that report, not many people are troubled by this behaviour, so I'm not sure that there's much chance of it getting changed.

December 2, 2013

https://www.duolingo.com/slezadav

I use Firefox 25.0.1 under Win7 64bit and it doesn't work as well.

December 2, 2013

https://www.duolingo.com/raans
  • 2067

Confirmed. Really annoying (Chrome, Mac)! I don't click anything without "right"-click and "open in new tab". Otherwise everything will be gone.

December 26, 2013

https://www.duolingo.com/LingPenguin

If it helps any, I just click with the scroll wheel and it opens a link in a new tab. I'm using Ubuntu 13.10 and latest stable of Firefox, but I've also had it work fine on Windows and IE so I doubt it's just a Firefox-specific feature.

December 2, 2013

https://www.duolingo.com/pont

Yes, middle click does usually work -- however, this is difficult or impossible to do with many trackpads.

December 2, 2013

https://www.duolingo.com/olimo

I use the scroll wheel too, and I have experienced the same problem a few times. It is especially annoying when I middle-click a user name in discussion or some other link and it works like a normal left-click bringing me away from the unfinished lesson :-( In the same situation, right-click + Open in new tab always worked correctly.

For me, this bug usually disappeared after I refreshed the page. I also have to admit that I got it rather long ago for the last time.

December 2, 2013

https://www.duolingo.com/chrisfay

Yes, great point. I have also command + clicked a link during a lesson thinking it would spawn in another tab only to lose my unfinished progress.

December 3, 2013

https://www.duolingo.com/chrisfay

Thanks. I don't have a scroll wheel on my mac mouse :)

December 2, 2013

https://www.duolingo.com/chrisfay

I have moved this to 'Troubleshooting'.

@Duolingo Any chance of an update on this one? It would be really nice to have this fixed.

January 3, 2014

https://www.duolingo.com/HodofHod

I've included this behavior in my Duolingo Modifications userscript, for anybody who is interested: https://www.duolingo.com/comment/1738577

February 13, 2014

https://www.duolingo.com/V_Gabor

It's still an issue for me. Ctrl-Click does not work, Mouse Middle-Click does open in new tab.

But it's selective. Eg. the for external links line the two in chrisfay's original post it's OK, but for Duolingo page links (my name, top menu items, etc.) won't work.

I'm on WinXP + Chrome (v33.0.1750.154 m)

March 21, 2014
Learn a language in just 5 minutes a day. For free.