Intent to Implement and Ship: Add "matrix" to registerProtocolHandler safelisted schemes

151 views
Skip to first unread message

Joey Arhar

unread,
Apr 26, 2021, 2:00:32 PMApr 26
to blink-dev

Contact emails

jar...@chromium.org

Explainer

None

Specification

https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers

https://github.com/whatwg/html/pull/6320


Summary

Extend list of URL schemes that can be overridden via registerProtocolHandler() to include "matrix"


Similar changes were discussed in these previous blink-dev threads:

https://groups.google.com/a/chromium.org/g/blink-dev/c/29sFh4tTdcs

https://groups.google.com/a/chromium.org/g/blink-dev/c/7nHTRUP1EGY


Blink component

Blink>HTML>CustomHandlers

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility



Gecko: No signal

WebKit: No signal

Web developers: No signals


Is this feature fully tested by web-platform-tests?

Yes 

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1169258

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4991245464109056

This intent message was generated by Chrome Platform Status.

Frédéric Wang

unread,
Apr 26, 2021, 2:17:40 PMApr 26
to blin...@chromium.org
Thanks for implementing this. Some quick notes:

Le 26/04/2021 à 20:00, Joey Arhar a écrit :

Gecko: No signal

I cannot speak for Mozilla, but as I see they implemented it and supported the WHATWG change:

https://bugzilla.mozilla.org/show_bug.cgi?id=1688030

https://github.com/whatwg/html/pull/6320


WebKit: No signal

registerProtocolHandler() is not supported there are various old bugs and threads ( https://bugs.webkit.org/show_bug.cgi?id=92726 ). IIUC the WebKit people would like to keep the list minimal.

-- 
Frédéric Wang

Yoav Weiss

unread,
Apr 29, 2021, 2:53:10 PMApr 29
to blink-dev, Joey Arhar
On Monday, April 26, 2021 at 8:00:32 PM UTC+2 Joey Arhar wrote:

Contact emails

jar...@chromium.org

Explainer

None

A short (maybe even inline :D) explainer outlining what this new scheme is and what it does would  be helpful here when evaluating if this is something we want to add to the platform.

Yoav Weiss

unread,
Apr 29, 2021, 2:54:22 PMApr 29
to blink-dev, Yoav Weiss, Joey Arhar
Also, signals from other vendors as well as from developers would be useful.

Joey Arhar

unread,
May 6, 2021, 1:35:44 AMMay 6
to Yoav Weiss, blink-dev
Thanks Frédéric for the signals from other vendors!

A short (maybe even inline :D) explainer outlining what this new scheme is and what it does would be helpful here when evaluating if this is something we want to add to the platform.

To be honest I don’t actually have a much context on this yet, I just came across this while triaging bugs. The spec pr says this:

> Matrix is an open and secure communication protocol, designed for an

open federation of servers, much like e-mail or xmpp.


It sounds kind of abstract to me, so maybe i should ask for another TLDR... There is a more substantial explainer linked from the spec pr here: 

Some relevant sounding passages from the explainer:

opening a Matrix client by clicking on a link from an email message

export identifiers of Matrix resources to non-Matrix environment so that they could be resolved in another time-place in a uniform way. An example of this case is the "Share via…" action in a mobile Matrix client

Chris Harrelson

unread,
May 7, 2021, 5:26:14 PMMay 7
to Joey Arhar, Yoav Weiss, blink-dev
The API owners discussed this intent yesterday. If there's a good use case for adding matrix, we think it would be ok. But we weren't sure where the request was ultimately coming from.

However, I subsequently read in more detail some of the supporting documentation for this intent. I see that Mozilla has started using Matrix instead of IRC (comment here), and there is evidence of Matrix gaining popularity.

Based on that, LGTM1 to ship, contingent on asking Webkit for a signal. Joey can you do that?

The Gecko signal should be: Shipped/Shipping.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK6btwL3Tsmke4566cO08cUKfx6N1QW%3Dn3G0t8ugUv9ArN1YDw%40mail.gmail.com.

Alex Russell

unread,
May 13, 2021, 3:16:49 PMMay 13
to blink-dev, Chris Harrelson, Yoav Weiss, blink-dev, Joey Arhar
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Manuel Rego Casasnovas

unread,
May 13, 2021, 3:18:54 PMMay 13
to Alex Russell, blink-dev, Chris Harrelson, Yoav Weiss, Joey Arhar
LGTM3

On 13/05/2021 21:16, Alex Russell wrote:
> LGTM2
>
> On Friday, May 7, 2021 at 2:26:14 PM UTC-7 Chris Harrelson wrote:
>
> The API owners discussed this intent yesterday. If there's a good
> use case for adding matrix, we think it would be ok. But we weren't
> sure where the request was ultimately coming from.
>
> However, I subsequently read in more detail some of the supporting
> documentation for this intent. I see that Mozilla has started using
> Matrix instead of IRC (comment here
> <https://github.com/whatwg/html/pull/6320>), and there is evidence
> of Matrix gaining popularity
> <https://matrix.org/faq/#what-is-the-current-project-status>.
>
> Based on that, LGTM1 to ship, contingent on asking Webkit for a
> signal. Joey can you do that?
>
> The Gecko signal should be: Shipped/Shipping
> <https://bugzilla.mozilla.org/show_bug.cgi?id=1688030>.
> jar...@chromium.org <mailto:jar...@chromium.org>
>
>
> Explainer
>
> None
>
>
> A short (maybe even inline :D) explainer outlining what
> this new scheme is and what it does would  be helpful
> here when evaluating if this is something we want to add
> to the platform.
>
>
>
> Specification
>
> https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
> <https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers>
>
>
> https://github.com/whatwg/html/pull/6320
> <https://github.com/whatwg/html/pull/6320>
>
>
> Summary
>
> Extend list of URL schemes that can be overridden
> via registerProtocolHandler() to include "matrix"
>
>
> Similar changes were discussed in these previous
> blink-dev threads:
>
> https://groups.google.com/a/chromium.org/g/blink-dev/c/29sFh4tTdcs
> <https://groups.google.com/a/chromium.org/g/blink-dev/c/29sFh4tTdcs>
>
> https://groups.google.com/a/chromium.org/g/blink-dev/c/7nHTRUP1EGY
> <https://groups.google.com/a/chromium.org/g/blink-dev/c/7nHTRUP1EGY>
>
>
> Blink component
>
> Blink>HTML>CustomHandlers
> <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EHTML%3ECustomHandlers>
>
>
> TAG review
>
> None
>
>
> TAG review status
>
> Not applicable
>
>
> Risks
>
>
>
> Interoperability and Compatibility
>
>
>
> Gecko: No signal
>
> WebKit: No signal
>
> Web developers: No signals
>
>
> Is this feature fully tested
> by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?
>
> Yes 
> https://wpt.fyi/results/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html
> Status <https://www.chromestatus.com/>.
>
> --
> You received this message because you are subscribed to the
> Google Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK6btwL3Tsmke4566cO08cUKfx6N1QW%3Dn3G0t8ugUv9ArN1YDw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/70bf5c85-3feb-416c-8df2-d6154a7660c4n%40chromium.org
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/70bf5c85-3feb-416c-8df2-d6154a7660c4n%40chromium.org?utm_medium=email&utm_source=footer>.

Joey Arhar

unread,
May 14, 2021, 4:03:23 PMMay 14
to Manuel Rego Casasnovas, Alex Russell, blink-dev, Chris Harrelson, Yoav Weiss
Thanks for the LGTMs!

Here is a better justification for why matrix should be allowed in registerProtocolHandler:
The matrix URI scheme allows for rich context to be passed to a multitude of Matrix client websites, such as Fluffychat. As Chris pointed out, there is a large number of matrix users. The HTML spec PR has comments and reactions from several users and the matrix-doc repo has >500 stars.

> Based on that, LGTM1 to ship, contingent on asking Webkit for a signal. Joey can you do that?

I noticed that the HTML spec PR says that WebKit doesn't support registerProtocolHandler in the first place.
I found a WebKit bug about registerProtocolHandler including a negative comment about the feature.
I also found a webkit-dev thread about registerProtocolHandler which doesn't appear to include any positive remarks from WebKit maintainers.
As far as I can see, nobody has ever asked for WebKit's support regarding a particular safelisted scheme as this intent is concerned with. Should I email webkit-dev just for matrix support, even though they don't seem interested in registerProtocolHandler in the first place...?

Chris Harrelson

unread,
May 14, 2021, 5:17:59 PMMay 14
to Joey Arhar, Manuel Rego Casasnovas, Alex Russell, blink-dev, Yoav Weiss
On Fri, May 14, 2021 at 1:03 PM Joey Arhar <jar...@chromium.org> wrote:
Thanks for the LGTMs!

Here is a better justification for why matrix should be allowed in registerProtocolHandler:
The matrix URI scheme allows for rich context to be passed to a multitude of Matrix client websites, such as Fluffychat. As Chris pointed out, there is a large number of matrix users. The HTML spec PR has comments and reactions from several users and the matrix-doc repo has >500 stars.

> Based on that, LGTM1 to ship, contingent on asking Webkit for a signal. Joey can you do that?

I noticed that the HTML spec PR says that WebKit doesn't support registerProtocolHandler in the first place.
I found a WebKit bug about registerProtocolHandler including a negative comment about the feature.
I also found a webkit-dev thread about registerProtocolHandler which doesn't appear to include any positive remarks from WebKit maintainers.
As far as I can see, nobody has ever asked for WebKit's support regarding a particular safelisted scheme as this intent is concerned with. Should I email webkit-dev just for matrix support, even though they don't seem interested in registerProtocolHandler in the first place...?

No. I agree that there would be no point in doing so.

I think you're good to go, no further action needed than landing the CL.

Mayeul Cantan

unread,
May 19, 2021, 12:06:50 PMMay 19
to blink-dev, Chris Harrelson, Manuel Rego, sligh...@chromium.org, blink-dev, yoav...@chromium.org, Joey Arhar
Sorry for only noticing this thread now.

> The Gecko signal should be: Shipped/Shipping.

+1. I am also intent on updating the MDN docs, as was suggested to me.

> But we weren't sure where the request was ultimately coming from

I am the requester, but just a contributor to the open source Matrix ecosystem in my spare time.
The requester should probably be the Matrix foundation, I am doing this with tacit approval of the other contributors:

>                 A short (maybe even inline :D) explainer outlining what
>                 this new scheme is and what it does would  be helpful
>                 here when evaluating if this is something we want to add
>                 to the platform.

> It sounds kind of abstract to me, so maybe i should ask for another TLDR

As the  original reporter and the whatwg PR author, I would have been happy to give you a bit more context.
I did try to do so in the whatwg PR, but the curse of knowledge made me feel this was unnecessary on the chromium bugtracker.

So, in a few words:

Matrix was designed as an instant messaging protocol. Like xmpp or e-mail, it is built on a federation of servers.
It is actually closer to a distributed database, or a CRDT conceptually.

Here's how it works:
A user from a server sends a message to a "room" on their server, and other servers that participate in that room will receive the message.
Matrix builds on this, and specifies how to merge diverging histories, as well as access control. More info is available on https://matrix.org/

Here's why this scheme is needed:
Users need to refer to given rooms, messages, or other users, in a client-agnostic way.
Given that multiple clients exist, I would like to share a link to a message that the recipient can open in their own client, that's what URIs are designed for.

About registerProtocolHandler:
Multiple clients are actually web apps, and would need to register as protocol handlers to be able to open links to a given user, chatroom or message.
Examples of such clients are https://app.element.io/ (formerly Riot), https://hydrogen.element.io/ (experimental) and https://fluffychat.im/web/

What was done until now:

While the solution isn't perfect, especially as it requires a round-trip trough the web browser, it also provides a nicer first-time user experience if a user doesn't have a Matrix client installed, and doesn't know what Matrix is.

That's actually the reason I asked if chromium could have some default handlers: https://bugs.chromium.org/p/chromium/issues/detail?id=1169258#c5
Falling back to matrix.to when a user opens a matrix: URI and doesn't have a client installed would allow to make a broader use of the scheme. If that's not implemented, it is unlikely that users will ressort to using the new scheme, and clients will continue generating matrix.to links, as pointed out in https://github.com/matrix-org/matrix.to/issues/191#issuecomment-825671129

Matrix.to is a relatively neutral party, though matrix-specific. I imagine the same issue is playing for most other protocols as well (including ftp with its deprecation), so adding default protocol handlers or a landing website could help first-time users for any of these.

Anyway, thank you for moving this forward. May I ask which Chromium version this is expected to land in?

Best wishes,

Mayeul

Joey Arhar

unread,
May 20, 2021, 1:11:46 AMMay 20
to Mayeul Cantan, blink-dev, Chris Harrelson, Manuel Rego, sligh...@chromium.org, yoav...@chromium.org
> May I ask which Chromium version this is expected to land in?

This is going to be in Chromium 92.

> If that's not implemented, it is unlikely that users will ressort to using the new scheme, and clients will continue generating matrix.to links, as pointed out in https://github.com/matrix-org/matrix.to/issues/191#issuecomment-825671129

Won't lack of registerProtocolHandler support in WebKit/Safari lead to the same conclusion?
According to the comment you linked it looks like Firefox is using matrix.to by default, which is a good sign, but I still don't think any other protocols have particular websites registered by default in chromium, right?
Reply all
Reply to author
Forward
0 new messages