matrix-org / matrix-org/matrix.to
Support decoding matrix URI scheme
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Description
MSC2312: Matrix URI scheme proposal https://github.com/matrix-org/matrix-doc/pull/2312 is nearing completion.
As such, we can expect apps to progressively switch from `https://matrix.to` links to the `matrix:` scheme.
**Describe the solution you'd like**
In order to provide a smooth transition, as well as a fallback when no client is installed, I would like matrix.to to implement support for parsing `matrix:` URI as input, and work as usual with the decoded information:
- [ ] define a way for `matrix.to` to receive `matrix` URIs, it could be something like `https://matrix.to/#/url/%s` (percent-encoded of course)
- [ ] Implement parsing for it as specified in [MSC2312](https://github.com/matrix-org/matrix-doc/pull/2312)
- [ ] modify web browsers to add matrix.to as a default handler for these links
* For Firefox the magic happens [here](https://searchfox.org/mozilla-central/source/browser/locales/en-US/chrome/browser-region/region.properties) with the tests [there](https://searchfox.org/mozilla-central/source/uriloader/exthandler/tests/unit/test_handlerService_store.js#557)
* Unsure if Chromium has something similar
- [ ] ask visitors if they want to register matrix.to as a protocol handler for `matrix:` links (can also ease the transition)
**Describe alternatives you've considered**
Falling back to Element.io is another possibility that can be examined, I am not sure which one brings the best onboarding experience. Both are not exclusive.
However, Element.io is a lot less neutral, so it would make it a harder sell to browsers, does not educate users as well, and is already quite well emphasized in matrix.to.
**Additional Context**
Users might want to copy-paste a URL from the address bar? In that case, maybe rewrite them to regular matrix.to format?
-----
Firefox includes default handlers, as linked above, and from the following screenshot of a web browser that has never been on yahoo nor gmail:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading MSC2312 and the existing matrix.to URL handling; the issue does not name repository files. Review Firefox's browser/locales/en-US/chrome/browser-region/region.properties and uriloader/exthandler/tests/unit/test_handlerService_store.js references for protocol-handler context. Done would require an agreed scope covering matrix: parsing, browser fallback or registration, and compatibility with existing matrix.to links.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100