Several Element tabs, each with a coloured ring

Open Element Web in a second browser tab and you get “Element is connected in another tab”. Element runs in one tab at a time, and for good reasons. In a study we asked: can a module change that without touching Element itself? The answer is multi-tab, an Element Web module that lets you keep as many Element tabs open as you like.

The idea and the architecture in 98 seconds

How it works

  • One main tab syncs with the server and holds the encryption keys, just as Element does with a single tab. The server sees one session.
  • Every other tab gets its updates from the main tab over a BroadcastChannel inside the browser, and asks it to decrypt and encrypt. Room keys never leave the main tab.
  • Close the main tab and another one takes over within about 0.2 seconds, thanks to the browser’s Web Locks. If it hangs, another tab takes over after about 35 seconds.
  • Which tab is which is listed in Settings → Preferences → Open tabs. A coloured ring around your avatar follows in the next version.

Built on the Element Web Module API

multi-tab is a single JavaScript file that Element loads through its module API: no fork and no custom build of Element. Because the API doesn’t cover syncing or encryption, the module also uses some Element internals. It checks for them on start and stays off if anything is missing.

A study, not a product

multi-tab is a study and a prototype, developed with agentic coding. We tested it in Chrome, Firefox and Safari, with accounts of 300 rooms, real logins with token refresh and chaos tests that randomly open, close and crash ten tabs. Still: please don’t use it in production.

Links

Categories:

Tags:

Comments are closed