I Built a Chrome Extension: Switch Browser Data
Introduction
When developing a web app, I often need to test with multiple accounts, such as an administrator and a regular user. And when regular users have several permission levels, the number of account types grows even more.
I used to go through “log out → log in with another account” every time I switched. It quietly ate up time and broke my rhythm, which got stressful.
Why I Didn’t Use an Existing Tool
If you’ve ever looked for “a tool to switch browser cookies,” you know there are a few options out there. What bothered me, though, was trust.
Cookies contain login session IDs. That means if a tool that handles cookies were malicious, it could in theory use that data to break into your accounts.
With closed-source tools, you can’t check what’s inside. I just couldn’t get comfortable using a tool while being unable to answer the question “Is this tool safe?”
What I Built: Switch Browser Data
So I decided to build one myself. One of the goals was to publish the code as open source so that anyone can look inside and check it.
Switch Browser Data is a Chrome / Edge extension that saves snapshots of browser data per domain and lets you switch between them with one click.
It supports the following data:
| Data type | What it holds |
|---|---|
| Cookie | Login sessions and the like |
| localStorage | Data stored persistently in the browser |
| sessionStorage | Data that disappears when the tab is closed |
| IndexedDB | Structured data storage |
All data is stored only on your device and is never sent anywhere.
How to Use It
1. Save a Snapshot
While logged in, open the popup, enter a snapshot name, and save. Naming them per account, like “Admin” or “Regular user A,” makes them easy to manage.
2. Switch with One Click
Just pick the snapshot you want from the dropdown. Reload the page, and that account’s state is restored.
Data is managed per domain, so it doesn’t affect other services’ data.
Source Code
The code is public on GitHub.
https://github.com/istb16/switch-browser-data-extension
It’s under the MIT license. Feel free to use it to see how it works or to verify that it doesn’t do anything suspicious.
Summary
- Switch between multiple accounts with one click, without “log out → log in”
- Cookies include login sessions, so I decided I needed a tool I could trust and built my own
- It’s open source, so you can read the code and check that it’s safe
- Works on both Chrome and Edge, and all data is stored locally
Related Posts
I Measured dev-orchestra: Time per Request, and Findings by Number of Reviewers
With dev-orchestra 1.2.1, I made one small feature request and measured how long it took (about 6 minutes, not counting my approval) and how many findings were reported and accepted with 1, 2, and 4 reviewers. More reviewers meant more accepted findings, but the extra ones were about tests.
Giving dev-orchestra Standing Instructions per Role
I tried instructions, added in dev-orchestra 1.2.1. Standing instructions for the implementer or reviewers written in the repository go into every prompt. I check, with real output, how they are shown, where they go, and how a change to the instructions is treated.
[Released] dev-orchestra: Parallel Work Units and Per-Role Instructions v1.1.0 - v1.2.1
A roundup of dev-orchestra's changes from v1.1.0 to v1.2.1: running a plan as work units side by side, standing instructions per role, questions before the design, and settings for progress reports. If you capture its output on Windows, note the encoding change.