This page uses
navigator.registerProtocolHandler(scheme, url) to register
this site as a handler for a custom protocol. After registering, the
browser will usually prompt you to allow it. Once allowed, clicking a link
with that scheme opens the handler URL with %s replaced by
the full, percent-encoded link target.
Custom schemes must start with web+ (or be a browser
safelisted scheme). The handler URL must be same-origin and contain a
single %s placeholder.
Scheme:
web+playground
Handler URL:
Once the handler is allowed, click a link below. The browser should route it back to this site's handler page and show the payload.
web+playground:hello-world web+playground://open?id=42&name=demo web+playground:special chars & spaces
with %s replaced by the URL-encoded link.
./handle/) reads the encoded target
from the query string and displays it.
To remove the registration, use the browser's site settings (Chrome:
chrome://settings/handlers, Firefox: Settings →
Applications). The unregister button opens that page where supported.