Pages

Tuesday, May 21, 2013

When accessing Google Mail or Google Calendar from Chrome,a protocol handler icon may appear in thein address bar (omnibox in Google parlance) that indicates installing a service handlerfor this page.

What does this mean?

There are certain URL linksthat are listed on the HTML Page that can associated to open programs or applications on your computer.

When you click link to activate the associated program, that program will launch. You get the warning if Chrome can open the same link and wants control.

Lets take and email address link on a webpage for example (metadataconsult@gmail.com). For many uses with Microsoft Office installed, click the email address will open a new email in Outlook mail client, for others, it maybe Mail App client in Mac OSX.

This email address is referred to as a "mailto:" link. Inherits its name from the HTML code used to construct the link, which looks like <a h ref="mailto:metadataconsulting@gmail.com?Subject=Test%20Email"> .

The mailto: (called a URI Scheme) gets associated to Outlook mail client, when Microsoft Office is installed. The link tells your associated mail client, in this case Outlook to create a email to metadataconsulting@gmail.com with a subject line "Test Email".

Google Chrome would like to take that over in some applications associations, and that is why you get installing a service handler the pop-up.

Mailto: and webcal: are common (URI schemas) that Google Chrome wants to commandeer, but there are many described here. Webcal is short for web calendar, and used to set appointments from links.

The tooltip for the protocol handler icon is: This page wants to install a service handler.

If you Use Gmail option, it will allow mailto: links in page while in Chrome to be opened in GMail. Similarly, you can enable webcal: links to be opened in Google Calendar, visit the Google Calendar page to enable. There is no penalty for performance using this handler service.

Soln: To disable "...to install a service handler" Warning

Type this in address bar to get to current handlers in Chrome.

Scroll down to Handlers section and select “Do not allow any site to handle protocols.” You can click Manage handlers (button) to view current handlers for a website.

Or to disable or re-enable these messages in Chrome, follow the steps below.

Click the Chrome menu on the browser toolbar.

Select Settings > Show advanced settings.

In the "Privacy" section, click Content settings.

In the dialog that appears, find the “Handlers” section:

To allow requests, select “Allow sites to ask to become default handlers for protocols.”

To disable requests, select “Do not allow any site to handle protocols.”

How to Enable Gmail to handle mailto: links

Type this in address bar to get to current handlers in Chrome.

Chrome://settings/content

Scroll down to Handlers section and select “All sites to ask to become default handlers for protocols (recommended).”

Goto GMailand now the protocol handler icon will appear in address bar. Now you are ready to add Gmail to open mailto links.

You must be in Gmail (https://mail.google.com/mail/u/0/#inbox) for this script to work

The protocol handler should be indicated

Open Chrome Console window - Press <ctrl><shift><j>keys simultaneously (Windows) and this will open the Console tab:

Cut and paste the following script at line with blue greater than sign >navigator.registerProtocolHandler("mailto", "https://mail.google.com/mail/?extsrc=mailto&url=%s", "Gmail");or cut from here

To check if this you added Gmail to open mailto links correctly;

Type this in address bar to get to current handlers in Chrome.

Chrome://settings/content

Scroll to Handlers and click Manage handlers (button) and you should see Type mailto and Site Gmail.

You can create your own service handlers !

For Chrome (13+), Firefox (3.0+) and Opera (11.60+) it is possible to register web application as service handler for custom URI scheme using JavaScript API:

window.navigator.registerProtocolHandler(protocol, uri, title);

protocol is the protocol the site wishes to handle, specified as a string.

uri is the URI to the handler as a string. You can include "%s" to indicate where to insert the escaped URI of the document to be handled.

title is the title of the handler presented to the user as a string.

Specifically for Chrome there is a limitation that does not allow to use custom schemes that don't start with web+ prefix (except standard ones: mailto, mms, nntp, rtsp and webcal). So if you want to register your web app as service handler as GMail do, you should write something like this: