Shortcut for "open in new tab _but_ stay in current tab" (ctrl-click idea)

[Old Forum bastijn] anonymous
Created: 7 years and 3 months ago
Is it possible to create a shortcut which opens the search result in a new tab just like "v" or " ' " do, but keep focus on the current tab instead of the recently opened tab? 

I know I can set my browser to not jump to a recently opened tab but i like this behaviour in other situations :).

I don't know if this is possible code-wise, but I sure hope so :).

This forum has been archived

Thank you all for the many comments, questions and suggestions. Particular thanks go to user x.15a2 for constantly monitoring, replying and helping so many users here. To continue these discussions, please head over to the DuckDuckGo subreddit.


yegg
I would absolutely love this as well. I've tried in the past to make it work, but it doesn't seem possible via JS. When you ctrl-click on the link itself, that is handled by the browser. 

That said, the new Google shortcuts seem to have it implemented (bound to ctrl-enter). It's on my list to investigate how they did that. If anyone wants to explore it would be greatly appreciated!
posted by yegg Staff7 years and 3 months ago Link
anonymous
Seems that option only works in Google Chrome browser though.
posted by [Old Forum bastijn] • 7 years and 3 months ago Link
yegg
Thx. On Firefox, you can make it open in a tab and a background tab via the settings (open in new tab) and type about:config into the address bar, search for browser.tabs.loadDivertedInBackground and then set it to true.
posted by yegg Staff7 years and 3 months ago Link
yegg
I have this working now--presumably the same way Google does. If you mouseover or use the keyboard shortcuts, it sets focus on the first link in that div such that cmd/ctrl-enter should open the link in the background.
posted by yegg Staff7 years and 3 months ago Link
anonymous
Great! Thanks!
posted by [Old Forum epifanio] • 7 years and 3 months ago Link
anonymous
Nice to see progress on this, however it doesn't work correctly yet.

When I use ctrl-enter in the newest stable Chrome 6.0.472.63 it opens a new tab in the background, but it opens a new tab with DDG and search option "same as first" + site:site-of-result.

E.g.

new tab == http://duckduckgo.com/?q=this is a test+site:www.dramaticpublishing.com




posted by [Old Forum bastijn] • 7 years and 3 months ago Link
yegg
Whoops :). Refresh and try again!
posted by yegg Staff7 years and 3 months ago Link
anonymous
Working, thumbs up for the quick implementation from idea to end-stage and the even quicker fix!

Just out of curiousity, is this a code-wise implementation or did you need to do something else? It kinda rocks to have this on your web-page :).
posted by [Old Forum bastijn] • 7 years and 3 months ago Link
yegg
Code-wise. What I did was set the focus of the right link when you hover or navigate there (and then hid the CSS outline). The effect of this is the same as if you tabbed to that particular link making it active, such that the browser command renders it in the background.
posted by yegg Staff7 years and 3 months ago Link
anonymous
Thanks, this will come in handy in the near future :). 
posted by [Old Forum bastijn] • 7 years and 3 months ago Link
anonymous
O btw, even google doesn't have it this advanced :). Their option only works in Chrome as the arrow keys cannot be used in firefox (at least for me) :).

Good job!
posted by [Old Forum bastijn] • 7 years and 3 months ago Link