Visit Mozilla.org

DOM:window.navigator.registerProtocolHandler

De MDC


Imagen:traduccion-pendiente.png Esta página está traduciéndose a partir del artículo DOM:window.navigator.registerProtocolHandler, razón por la cual puede haber algunos errores sintácticos o partes sin traducir. Puedes colaborar continuando con la traducción


« Referencia DOM de Gecko

Este artículo cubre características introducidas en Firefox 3

Tabla de contenidos

[editar] Summary

Allows web sites to register themselves as possible handlers for particular protocols.

[editar] Syntax

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.

[editar] Example

navigator.registerProtocolHandler("mailto",
                                 "https://mail.google.com/mail?view=cm&tf=0&to=%s",
                                 "Google Mail");

This creates a handler that allows mailto links to direct the user to Google Mail, inserting the email address specified in the link into the URL.

[editar] Specification

Specified by the WHATWG's Web Applications 1.0 working draft.