If you register a protocol handler with navigator.registerProtocolHandler() and follow a link for that protocol containing a space, then the space will be escaped as "%20" instead of "+". This makes Chrome consistent with other browsers such as Firefox.

Motivation

* Improve interoperability with the other browser implementing registerProtocolHandler * Make consistent with other escaped characters. * Adhere to the specification.

Specification

Editor's draft

Status in Chromium

Blink


No active development (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Shipped/Shipping
  • N/A
  • No signal
  • Positive

Owner

Comments

Here is an example (be sure to follow usual registerProtocolHandler restrictions e.g. same-origin and https): <script> navigator.registerProtocolHandler("mailto", "https://example.org/?value=%s") </script> <a href="mailto:frederic wang@example.com">send email</a> this would redirect to https://example.org/?value=frederic%20wang@example.com rather than https://example.org/?value=frederic+wang@example.com which is handled the same by e.g. URLSearchParams

Last updated on 2020-11-09