# Labelling a Chrome window by its profile

> Chrome names a window by profile only once a second profile shares its data folder. Ours never do, so we draw the name beside the address bar.

Source: https://mosaicbrowser.com/blog/five-identical-windows

## Five open profiles were five identical windows

Chrome names a window by profile only once a second profile shares its data folder. Ours never do, so we draw the name beside the address bar.

![Five open profiles were five identical windows, beside a screenshot: six Mosaic profile windows arranged in a grid, each with its own name in the title bar](https://mosaicbrowser.com/covers/five-identical-windows.webp)

Chrome labels a window with its profile's name only when there is more than one profile in the same user data directory. Then the avatar button grows the name and the title carries it. Mosaic gives every profile its own `--user-data-dir`, so Chrome never reaches that point, and five open profiles looked like five copies of one browser. A change in our engine fixes it: a `--profile-label` switch that draws the profile's name in a chip immediately left of the address bar.

## Why Chrome stayed silent

Nothing in Chrome was broken. Each Mosaic browser keeps exactly one entry in `ProfileAttributesStorage`, the list Chrome uses to tell its own profiles apart. With one entry there is nothing to disambiguate, and the avatar button concludes, correctly, that it has nothing to say. The feature answers a question about a world this product does not have.

The separate directories are the point of an [anti-detect browser](https://mosaicbrowser.com/guides/what-is-an-anti-detect-browser) like Mosaic. Cookies, storage, history and saved passwords live in a folder per profile, so the browsers share nothing. That separation is also what made the windows indistinguishable. The engine never learns the profile's name, and the one process that knows it is the launcher. So the name comes in on the command line.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Machines that exist](https://mosaicbrowser.com/features/real-fingerprints)

## Where the chip goes

We put it on the toolbar, immediately left of the address bar. That is where the eye already goes when you check which site you are on, and it is where we were asked to put it. We left the tab strip alone: in Chromium 153 it is an abstract interface with the implementation split between horizontal and vertical versions, and a change there would have to be redone for every major version.

Three decisions sit inside the change.

- **It is a label, not a button.** It names the window and switches nothing. A control that looks pressable and does nothing is worse than no control.
- **It uses the browser's own colour pair**, `kColorSysTonalContainer` with `kColorSysOnTonalContainer`, so it follows Chrome's theme in light and dark instead of carrying a colour of its own.
- **It never leaves the browser process.** The switch is declared in `chrome/common`, not in the fingerprint component, and it is the one switch in our series that must not be forwarded to renderers. A renderer has no business knowing which profile it is running, and no web content can read the label. Our `check:chromium-switches` script asserts that, and we watched it fail when we added the entry to the forwarding list on purpose.

## Two faults a photograph found

Both of these passed review as code. They turned up when we opened three windows and photographed them side by side.

**An em dash erased a name.** The first build read the switch with `GetSwitchValueASCII`, which returns an empty string for any value that is not ASCII. "Amazon buyer" got a chip. "Facebook Ads — main" got nothing, silently, because of one em dash. Three windows stacked into one image showed one chip. The engine now reads the native value and converts it per platform, because the command line is UTF-16 on Windows and bytes on macOS, and there is no single helper for both.

**The ordering ran backwards.** Toolbar items in Chromium's views code carry a flex order, and when space runs out a higher order drops out sooner. We gave the chip 1004, one past the extensions container, expecting it to hold on longer. It went first: on a 500-pixel Android profile it vanished while a forward button that had already overflowed kept its slot. At order 3 it outranks the toolbar buttons.

![Six Mosaic profile windows arranged in a grid, each named beside its address bar](https://mosaicbrowser.com/shots/windows-arranged.png)
*Each window carries its profile's name next to the address bar*

## Where it shows and where it does not

We then resized one window from 480 to 1280 pixels over the DevTools protocol and photographed each step. The chip is present from 640 pixels up and absent below. Mosaic opens a desktop profile at 1280 pixels or the screen's available width, whichever is smaller, so every desktop window is above the line. An Android profile opens at the phone's own width, which is below it, and those windows go without the chip.

The change was later carried over to Chromium 154, which deleted `chrome_switches.cc` and moved every switch into the header as an inline constant. The declaration and the definition had been two hunks in two files and became one.

A label is a small thing to carry through every Chromium release. We carry it because owning the engine makes it a small fix in the engine instead of a workaround; [why we built our own Chromium](https://mosaicbrowser.com/blog/why-we-built-our-own-chromium) explains that choice and the measurements behind it. Each window is still a separate profile with its own [real-device fingerprint](https://mosaicbrowser.com/features/real-fingerprints), and the label is the only part of it you see.

## Questions

### Why doesn't Chrome show the profile name on every window?

Chrome labels windows to tell its own profiles apart. With only one profile in a user data directory there is nothing to tell apart, so the avatar button and title stay plain.

### Can a website read the profile label Mosaic draws?

No. The --profile-label switch is read in the browser process only and is never forwarded to a renderer, so no page, frame or worker can see it.

### Why does the label disappear on narrow windows?

Below 640 pixels the toolbar runs out of room and the chip gives way, which keeps the address bar usable. Desktop profiles open wider than that; Android profiles open at the phone's own width and do not show it.

## Related

[Why we built our own Chromium instead of injecting JavaScript](https://mosaicbrowser.com/blog/why-we-built-our-own-chromium): Mosaic changes fingerprint values inside its own engine. Three measured differences between Chrome and plain Chromium explain why that matters.

[Introducing Mosaic, an anti-detect browser that lives on your machine](https://mosaicbrowser.com/blog/introducing-mosaic): Mosaic runs its own Chromium, draws each profile from a real machine and matches it to the proxy IP. Profiles stay on disk. One plan, no per-profile fees.

[Machines that exist: fingerprints drawn from real hardware](https://mosaicbrowser.com/features/real-fingerprints): Mosaic draws each profile's GPU, screen, CPU, memory and fonts from one real device, so the parts of a fingerprint agree with each other and with the host.

[What is an anti-detect browser?](https://mosaicbrowser.com/guides/what-is-an-anti-detect-browser): An anti-detect browser gives each profile its own fingerprint, proxy and cookies, so sites see separate visitors. What it changes, how, and its limits.









[outerHeight minus innerHeight is the browser chrome a page can measure](https://mosaicbrowser.com/blog/outer-minus-inner-height): innerHeight is the page's viewport, outerHeight the whole window. Subtract one from the other and a page has the height of your tabs and toolbar.

[screen.availTop is where your menu bar is](https://mosaicbrowser.com/blog/screen-availtop-menu-bar): screen.availTop is the height of OS chrome at the top of the screen: 25 on most Macs, 0 on Windows. It names a platform before navigator.platform does.

## Mosaic, on your own computer

The browser this blog is about: its own Chromium, fingerprints from real machines and a proxy IP per 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.
