DOM:window.navigator.registerProtocolHandler
De MDC
Este artigo cobre características introduzidas no Firefox 3
Tabela de conteúdo |
[editar] Summary
Allows web sites to register themselves as possible handlers for particular protocols.
[editar] Syntax
window.navigator.registerProtocolHandler(protocol, uri, title);
-
protocolis the protocol the site wishes to handle, specified as a string. -
uriis 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. -
titleis 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.