Websites may store data in a user’s web browser. Especially complex webapps use this feature to persist user data.
The most common data stores offered by web browsers are cookies,
As an example, the Matrix client Element Web uses both stores to persist a logged in session, cache events and store crypto secrets.
A user may want to synchronise this data to Matrix for the following reasons:
- Back up website data in case the computer breaks or is lost.
- Back up website data in case of corruption or data loss, to roll back to an older version.
- Synchronising website data across multiple devices of the same user.
- Synchronising website data across different browsers, which cannot usually synchronise their data.
- Sharing website data with another person to share an account.
- Sharing website data with another person if the website does not support or does not allow collaboration.
- Sharing website data with developers to debug a state of the website storage.
How could it work
- A browser or browser add-on asks to log into a Matrix account and verify the session.
- For every visted domain saving data, a new Matrix room is created.
- After every significant change of website data, the data is sent to the Matrix room.
- The amount of data stored in
IndexDbis likely too large for a single Matrix event. It might be necessary to upload an archive to the media store which can be referenced in a Matrix event.
- Using a Matrix sync, a browser can subscribe to changes posted by other browsers.
- The user owns their backup storage.
- Inviting others to a room allows to intentionally share website data of specific websites.
- The permissions in a room allow to configure who has read and/or write access to shared website data.
- Website data is often very sensitive data, which is likely to contain personal data, login data and online banking data. An implementation should get audited for security.
- If implemented as an add-on, an implementation depends on web browser APIs to read and write this sensitive data.
- Synchronisation conflicts may need to be resolved.
- Web browser differences may lead to incompatibilities when trying to synchronise website data across different web browsers.
- No known projects built with Matrix.
- Most major browsers offer a built-in syncronisation.
- This is usually limited to passwords, bookmarks and open tabs
- No known implementations as of 2023-06-13.