Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As an extension of previous question, how would one add a keyboard shortcut for right-clicking a URL and selecting "Go to http:// ..." in Chrome?

Could it be done using the same shortcut as in the previous question ( + + L)? Say, by adding some reg-exp for "http://"?

Thank you for any help.

share|improve this question
Please clarify, do you want a new entry in the context menu of a URL that opens the selected URL in Chrome? – Daniel Beck Dec 26 '11 at 12:14
@DanielBeck I'm looking for a keyboard shortcut, so as to avoid right-clicking some-selected-URL and choosing Go to Analogous to what Lri managed in my previous question. – courteous Dec 26 '11 at 16:39
Thanks for clarifying. You only want that in Chrome, or in any application? – Daniel Beck Dec 26 '11 at 16:53
@DanielBeck Only in Chrome (for avoiding any potential conflicts, I guess). I'm fairly new to OSx, so any help is greatly appreciated. :) – courteous Dec 26 '11 at 16:58
up vote 1 down vote accepted

Unlike the Search With Google service, Open URL actually works with other browsers than Safari.

A service that opens a URL or a Google search page

input="${input%\n}" # remove a possible trailing newline
if [[ "$input" =~ '://' ]]; then
    open "$input"
    open "$(echo -En "$input" |
    ruby -e 'require "cgi"; print CGI.escape($<.read.chomp)')"
share|improve this answer
Lri, thank you once again. The extension of your Bash script from the previous question did the trick (that is, it uses a single shortcut). (I'd also vote-up, if only I had 15 reputation points.) – courteous Dec 28 '11 at 11:10

Chrome's AppleScript API makes this task non-obvious, so I'll stick to the basics, once again using Automator:

enter image description here

for f in "$@"
    if [[ "${f:0:7}" != "http://" && "${f:0:8}" != "https://" ]] ; then
    open -a "Google Chrome" "$f"

There's some rudimentary logic that makes e.g. "" into a proper URL with http:// scheme.

Since you also want the scope to be different (all applications vs. just Chrome) it's not possible to limit it to a single keyboard shortcut. Just assign a different one for this.

share|improve this answer
Thanks for the help, but I'll have to go with Lri's more complete answer (which uses a single shortcut). – courteous Dec 28 '11 at 11:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.