You are here: Reference > JavaScript > client-side > browser > methods > registerProtocolHandler (navigator)

registerProtocolHandler method (navigator)

Browser support:
Allows registering a web site as a possible handler for a protocol.
Note: The registerProtocolHandler method is supported in Firefox from version 3.
Because of security restrictions, only those web sites can be registered as protocol handlers that are located in the same domain that the page is served from.
Registered protocol handlers can be removed manually. Choose Tools/Options menu (preferences dialog on Mac). Select the Applications tab and search for the 'mailto' item. Choose 'Applications Details' from the drop-down list of 'mailto' handlers on the right side. Select and remove the required protocol handler.


object.registerProtocolHandler (protocol, URI, title);
You can find the related objects in the Supported by objects section below.


Required. String that specifies the protocol to handle.
Required. String that specifies the URI to the handler. The '%s' substring will be replaced with the escaped URI that needs to be handled.
Required. String that specifies a title for the handler. This title will be displayed in the confirmation box when the handler is being registered.

Return value:

This method has no return value.

Example HTML code 1:

This example shows the use of the registerProtocolHandler method (note that the '' file is not a valid protocol handler, this example is only an illustration).
    <script type="text/javascript">
        function RegisterHandler () {
            navigator.registerProtocolHandler ("mailto", "", "Dottoro mailto protocol handler");
    <button onclick="RegisterHandler ();">Register a handler for the mailto protocol!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content