This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The Navigator method unregisterProtocolHandler() removes a protocol handler for a given URL scheme.
This method is the inverse of registerProtocolHandler().
unregisterProtocolHandler(scheme, url)
schemeA string containing the permitted scheme in the protocol handler that will be unregistered. For example, you can unregister the handler for SMS text message links by passing the "sms" scheme.
urlA string containing the URL of the handler. %s.
None (undefined).
SecurityError DOMException
The user agent blocked unregistration. This might happen if:
https:, about:, etc.)SyntaxError DOMException
The %s placeholder is missing from the handler URL.
For security reasons, unregisterProtocolHandler() restricts which schemes can be unregistered.
A custom scheme may be unregistered as long as:
web+
web+ prefixFor example, web+burger, as shown in the Example below.
Otherwise, the scheme must be one of the following:
bitcoinftpftpsgeoimircircsmagnetmailtomatrixmmsnewsnntpopenpgp4fprsftpsipsmssmstosshtelurnwebcalwtaixmppIf your site is burgers.example.com, and you have a web+burger: scheme, you can unregister the handler for it like so:
navigator.unregisterProtocolHandler( "web+burger", "https://burgers.example.com/?burger=%s", );
This script must be run from the same origin as the handler URL (so any page at https://burgers.example.com), and the handler URL must be http or https.
| Specification |
|---|
| HTML> # dom-navigator-unregisterprotocolhandler-dev> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
unregisterProtocolHandler |
38 | 79 | No | 25≤12.1–15 | No | No | No | No | No | No | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/unregisterProtocolHandler