Safari Extension for right click menu: Open in Google Chrome

adobe-flashgoogle-chromesafarisafari-extensions

Is it possible for an extension to add items to the right click menu in Safari? If you enable developer mode, there is a menu item called "Open Page With…" and Google Chrome is a choice if it's installed. Can the Open Page With… menu get added to the right click menu, so I can use one less step when viewing a page in Chrome? Right now I'm required to load the page in safari, then choose the Chrome option, whereas I'd rather just right click on links and send them to Chrome quickly.

I would make it myself if I knew how!

Best Answer

Open in Chrome Service

You can make a Service in 10.6 or 10.7 using Automator that will open a selected URL in Chrome.

Here's how:

  1. Open Automator Automator Icon
  2. When Automator asks you to Choose a type for your document window, select Service Service Icon

  3. Change the "Service receives selected" drop-down to "URLs" Service options

  4. Add a Run AppleScript action (found under the Automator Library, or just search) by dragging from the left pane to the right
  5. Copy the code below to the text field (replacing all the existing text)
  6. Save and give the service a name (it will be added automatically to the services menu)

Code:

on run {input}
    set theURL to input
    tell application "Google Chrome"
        if not (exists first window) then
            make new window
            set URL of last tab of first window to theURL
        else
            tell first window
                set newTab to make new tab with properties {URL:theURL}
            end tell
        end if
        activate
    end tell
end run

This will open any selected URL in Safari or other application in Chrome, either in a new tab in the most recent window, or a new window if there is no open Chrome window. To access it, right-click and under the Services item at the bottom of the menu, you should see an item with the name you assigned.

One important caveat: OS X seems to be a bit picky/buggy about passing link to this sort of service. It works fine if you have text selected as a URL, but it only seems to work on some links. If I discover a better method, I'll update this post with it.

You may also need to restart Safari for the service to appear.