MDN self-hosted library · e01.org

Navigator: registerProtocolHandler() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
<a href="mailto:webmaster@example.com">Web Master</a>
js
navigator.registerProtocolHandler("mailto", "https://mail.example.org/?to=%s");
js
navigator.registerProtocolHandler(
  "web+burger",
  "https://burgers.example.org/?burger=%s",
);
html
<a href="web+burger:cheeseburger">cheeseburger</a>