matrix-org / matrix-org/matrix.to

Automatically redirect to your main client

Open
#355 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.4k
Forks
318
PR merge metrics
No merged PRs in 30d

Description

Having had another bad onboarding experience during a discussion about not using MS Teams (I sent the "Copy room link" from the element web client), I thought about how to make this experience better.

Going a bit through the archives (#15 #197 #16 #74 https://github.com/flaki/matrix.to/commit/7eeadc4d21d569a86ea139b5301853ee694cdd53 #23 and others), I see that there are already quite some options, but neither of which makes it as easy as "click on the link"...

# Proposition

## Preparation of the web clients (e.g., element-web):

1. add a `default_client_storage` configuration option to element-web to point to a "matrix.to" server - by default it's off
a) there can be a per-user configuration option which overrides the global setting either way (on -> off; off -> on; override the URL)
b) for this to work, the inviter and the follower need to have the same `default_client_storage`
2. if the configuration is set, the element-web regularly opens a page from the `default_client_storage` server with an URL like:
`${default_client_storage}#mymatrix.mydomain.mytld` in the background. This is necessary, because the localStorage is private to a domain
3. This page from the `default_cliet_storage` stores the data after the `#` in the localStorage of the browser

## Sharing a room

1. click the three dots on the room and choose "Copy room link - default client" (or make this the default if `default_client_storage` is set)
2. the link points to the `default_client_storage` server with an additional tag, e.g., `?use_default_server`
3. if the page from `default_client_storage` detects a stored client in the localStorage of the browser, it shows a countdown (5 seconds) to redirect to the default client
a) if multiple default clients are stored, it could redirect to the most used after 5 seconds, but display the other ones

## Commets

- For mobile clients, matrix.to would need to recognize that it's running on mobile, and propose a rewritten `matrix://` scheme

# Problems

- need to open the link in the open tab, else the element web client complains that it's already open in another tab
- will not work with the desktop apps, as the `matrix://` protocol is not implemented yet, from what I gather
- this breaks my first idea of getting the web-client to store data in a privacy-preserving way (using an iFrame to store data in the localStorage): https://developers.google.com/privacy-sandbox/cookies/storage-partitioning

Do you think this would be an acceptable extension to matrix.io and element-web?

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by reviewing the referenced issues and commit, then inspect the current matrix.to redirect flow and how element-web handles shared links, localStorage, and client selection. Done would require an agreed design and coordinated changes for default-client storage, redirects, and mobile or desktop behavior.

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
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.