A TOTP authenticator in a browser extension keeps two-factor codes next to the account they belong to. In Mosaic that extension is the companion, which runs inside every profile's browser, and since 29 September 2026 it has had an Auth panel. Codes are saved on the profile, read from a QR code or a pasted key, and the setup key can always be read back out. Building it turned up four faults, and every one was found by driving the popup over CDP and reading what it actually did. None of them shows in the source.

Why the TOTP authenticator lives in the profile
The usual set-up is one authenticator app on a phone with every account in it. You look at the phone and type six digits by hand, many times a day. For people running several accounts they are entitled to run, it also leaves one shared object holding all of them, which is what the rest of the product works to avoid.
So each profile keeps its own. The logins and 2FA vault is per profile, the secret is sealed on disk under the vault's key, and the page never receives it. A code is filled into the page as real keystrokes. If the current code is about to expire, the fill waits for the next one rather than typing a dead code. (What a TOTP code is, and how the 30-second window works, is in the glossary.)
Each profile keeps its own passwords and its own 2FA codesIn Mosaic: Logins and 2FA codes. A password vault and TOTP codes for each profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.
Mosaic is a desktop app
Email yourself the link and open it on your computer.
How it works: Logins and 2FA codes
Getting a key in without a library
BarcodeDetector is native in our engine, Tesseract Chrome. We checked that qr_code is in getSupportedFormats(), with macOS supplying the implementation. So a QR code can arrive by drag and drop, by paste, from a file, or from a capture of the tab you are looking at, and nothing about the image leaves the computer.
A scan fills the form instead of saving. QR codes come off screenshots at the wrong scale, and now and then off the wrong QR code on a busy page, so what is about to be stored is on screen first.
Fault 1: a startup call ran before its code existed
The popup chose its opening panel from ?tab=, near the top of the file. showPanel reaches into the panel it opens, and the code timer sits next to const authRows, several hundred lines further down. The call threw Cannot access 'authRows' before initialization at the top level, which stops the rest of the script: no tools panel, no notes wiring, a blank page.
The full-screen button always navigates to ?full=1&tab=<panel>, so full screen had been dead from every tab, the new one included. The file parses, so nothing reported it. check:companion now asserts the panel selection comes after every top-level const it could reach. With the fault put back, it failed and named six bindings.
Fault 2: a key checked only where it was read
The base32 decoder threw on a bad setup key, but only when somebody asked for a code. So not a key!! was accepted, encrypted and stored, and rendered as a row reading --- --- for ever, under a toast that said "Saved to this profile." The check moved to where the value is written, in the store method the window, the REST API and MCP all go through. The next post in this series tells that one in full.
Fault 3: a timer that threw away what you opened
The panel rebuilt every row once a second. Revealing a setup key swapped the row's second line for the key, and the next tick, at most a second later, drew a fresh row without it. The secret flashed and vanished.
A tick now updates the digits and the countdown ring in place, and rebuilds a row only when the list's shape changes. Which key is shown is remembered by credential id, so it survives a reload of the list as well.
Fault 4: icons that rendered as nothing
icon() answers an unknown name with an empty fragment, so the plus on the Add button and the trash on every row's Remove had been drawing nothing. The loop that adds icons read .seg-btn, .ghost-btn, which was the complete set of icon-carrying classes when it was written and was not one class later. It reads [data-icon] now: the attribute is the request, and a list of classes that happen to make it was a second description of one fact.
And the generated file, twice more
The companion's popup.js is built inside a template literal, so a backtick in a comment ends the string. That cost three parse failures in this one session. The other half is worse because the file still parses: backslashes are consumed too. \s becomes s, a regex arrives as a different regex, and '\n\n' becomes a literal line break inside a string. Everything bound for the generated file doubles its backslashes, and check:companion caught all four cases.
The popup talks to Mosaic with a token that reaches only its own profile, which is the subject of the companion's old API key. For running codes across many client accounts, managing 2FA codes for multiple accounts has the set-up.






