How do I change the URL handler for Apple Mail?

1

1

When I highlight and right-click on text in an email message in Apple Mail 4.4 (1082), I can select "Search in Google".

Despite having either Google Chrome or Mozilla Firefox set as my default web browser within Apple Safari 5.0.3 (6533.19.4) preferences, Apple Mail will open Safari, then open a new window in Safari with the search results.

How do I change the default URL handler in Apple Mail, so that searches are opened in my default browser? Or is this a known bug?

Thanks for your advice!

Alex Reynolds

Posted 2011-03-17T22:43:52.483

Reputation: 601

Answers

1

This doesn't actually depend on what browser you've chosen as your default browser; rather, "Search with Google" is a special service that Safari offers to other applications. (This service is defined in Safari's Info.plist file under the NSServices key). Since it's Safari that makes this available to other applications, it should then make sense that it'll be Safari that handles this command.

When you click on a URL in an application like Mail, it will involve a Launch Services call to open the URL in your preferred web browser. With the Search With Google command, on the other hand, the text selection is put on the pasteboard and then sent directly to the app that defines the service.

Checking Firefox's Info.plist, it doesn't look like it offers any Services similar to Safari's. I'm not sure about Chrome though.

NSGod

Posted 2011-03-17T22:43:52.483

Reputation: 1 485

Any idea why the searchWithGoogle service is at the top of that context menu, not with the other applicable services at the bottom, and ignores being deactivated in Keyboard Preference Pane? And why the label is different (Search With Google / Search in Google)? Doesn't seem to be a service. – Daniel Beck – 2011-06-13T08:15:53.300

Interesting… I will re-test this as soon as I'm back in Snow Leopard. – NSGod – 2011-06-13T17:12:29.880