What a Chrome Profile Checkpoint Actually Restores
A reproducible Chromium test for distinguishing persistent browser data, an unsubmitted form, and a copied profile’s later writes.
Author note. This article was prepared by the Cloudbrowser team with AI drafting assistance. The measurements below come from two runs against a disposable local Chromium profile and a loopback test page.
Decide what the next worker needs
When a browser automation worker picks up a task after a restart, the browser desktop can open without the task being ready to resume. A profile can make the worker recognizable to a site. The page can still ask the worker to sign in, and work that lived only in the previous tab may be gone. These outcomes call for different recovery actions. Replaying a click blindly can even commit the same change twice.
In a browser handoff I would record three things. First, which operation the previous worker was preparing, such as editing a draft. Second, whether the application has already returned a stable receipt. Third, the checks that will confirm the next worker has reached the right account and item. The browser profile is one of the inputs to those checks. Knowing that Chromium started is only the first observation.
The following experiment gives each of those statements a concrete boundary. It writes synthetic markers through Chromium's public web APIs, shuts down the browser, copies the closed profile, and starts two fresh instances from the two directories. It then writes different values in the copy and opens the source one more time.
Build a fixture with one stable origin
Serve a page over HTTP on loopback and keep that server running during the whole test. The scheme, host and port form the origin for local storage and IndexedDB. Changing the port between the seed run and the restore run can make an intact database look empty. A persistent profile with a temporary port is fine while the one fixture process stays alive.
The document in these runs had one labeled input, Unsubmitted note, with autocomplete=off. The fixture kept typed text in the page's live DOM. That isolates the form observation from writes to local storage or the server. A production application may implement its own autosave, which should be measured independently using the application’s own receipt or saved draft identifier.
Launch Chromium with Playwright's launchPersistentContext and a fresh user data directory. Use a disposable test profile outside your normal browser folder. Put the source and branch directories next to one another so that copying the source cannot recurse into its own output. Playwright documents the persistent context API, and Chromium describes the difference between a user data directory and the profile inside it.
Playwright persistent context · Chromium user data directory
Here is the fixture server used for the document. Start it once before creating either profile. Save the file as fixture.cjs, run node fixture.cjs, and keep the printed URL for every navigation. Running the browser test and the server in one Node process works as well. If your normal dev server redirects HTTP to HTTPS or injects live reload, use this minimal server so that every run starts with the same document.
const http = require('node:http');
const page = '<!doctype html><meta charset=utf-8>' +
'<label>Unsubmitted note <input id=note autocomplete=off></label>';
const server = http.createServer((req, res) => {
res.writeHead(200, {
'content-type': 'text/html; charset=utf-8',
'cache-control': 'no-store'
});
res.end(page);
});
server.listen(0, '127.0.0.1', () => {
console.log('http://127.0.0.1:' + server.address().port + '/');
});Playwright can open each profile with no prior tabs by using const page = context.pages()[0] ?? await context.newPage(). Navigate explicitly to the printed URL before an observation. Keep any diagnostic browser setup out of the copied directory. For example, write test output to the shell or the CI artifact directory so that copying the profile does not also copy the previous result.
At the end of a local run, stop the fixture and remove the two temporary directories. Keep the result table and Chromium version as your record. If you run this in CI, make the path unique to the worker and create a fresh pair of directories on retry. A pre-existing branch can make the initial comparison look reassuring even when the new copy never happened.
Seed four browser-state markers and one form field
At the top-level test origin, run the following browser code. A session cookie and a cookie with a defined lifetime make two separate observations. The IndexedDB write waits for the transaction's completion event. A successful put request by itself can precede an aborted transaction.
await page.evaluate(() => {
document.cookie = 'persistent-marker=seed; Max-Age=86400; Path=/; SameSite=Lax';
document.cookie = 'session-marker=seed; Path=/; SameSite=Lax';
localStorage.setItem('marker', 'seed');
});
await page.evaluate(() => new Promise((resolve, reject) => {
const open = indexedDB.open('checkpoint-lab', 1);
open.onupgradeneeded = () => open.result.createObjectStore('state');
open.onerror = () => reject(open.error);
open.onsuccess = () => {
const db = open.result;
const tx = db.transaction('state', 'readwrite');
tx.oncomplete = () => { db.close(); resolve(); };
tx.onabort = () => { db.close(); reject(tx.error); };
tx.objectStore('state').put('seed', 'marker');
};
}));
await page.getByLabel('Unsubmitted note').fill('unsubmitted');Read the values back before you stop the source. This catches fixture mistakes such as a wrong origin, a blocked first-party cookie, a field being filled on the wrong tab, or a rejected storage transaction. For the IndexedDB read, open the same database and use transaction('state', 'readonly').objectStore('state').get('marker'). Wait for that request and read its result.
Shut down, make the copy, and open both
The copy belongs after the close has completed. That keeps the experiment about the data on disk after an orderly shutdown. It also releases the profile lock before the source is opened again. This example uses two independent paths and opens each in turn. A runtime that forks many clients concurrently must also manage profile ownership, checkpoint integrity, per-process access, and resource limits.
await sourceContext.close();
await fs.cp(sourceDir, branchDir, { recursive: true });
const reopened = await chromium.launchPersistentContext(sourceDir);
try {
const page = reopened.pages()[0] ?? await reopened.newPage();
await page.goto(fixtureUrl);
// Read both cookies, localStorage, the IndexedDB record and the form field.
} finally {
await reopened.close();
}Open the branch the same way and compare all the initial observations. Then write branch into both storage APIs on the branch. Close the branch, start the source one more time, and read the original markers again. Testing a changed value matters. Two pages initially showing seed could be reading from the same underlying state.
Results from two fresh runs
Both runs used Playwright's bundled Chromium 159.0.8154.6 on one macOS host. The test used fresh profiles in each run, an explicit navigation to the same loopback document at each observation, and ordinary shutdown. These are functional observations under that setup.
| Marker | Before shutdown | Reopened source | Branch before edits | Branch after edits | Source after branch edits |
|---|---|---|---|---|---|
Cookie with Max-Age | seed | seed | seed | seed | seed |
| Session cookie | seed | absent | absent | absent | absent |
localStorage | seed | seed | seed | branch | seed |
| IndexedDB | seed | seed | seed | branch | seed |
| Text typed into the input | unsubmitted | empty | empty | empty | empty |
The useful recovery contract is small enough to put into an acceptance test. Compare one observed value for each state category. Then perform a write and verify that the original remains unchanged. Record the browser version, shutdown type, origin, and session-restore settings alongside the result. In our runs the absence of the session cookie applied to the fresh navigations in this setup. Session-restore settings, browser policy, cookie configuration, and the application itself can change the outcome.
An abrupt stop is a separate test. A worker may have seen a request resolve before the browser or underlying storage reached the persistence boundary of interest. Check both branches against the same fixture and add one variable at a time, such as the interval between the application action and the stop. Run an abrupt-stop experiment only on a disposable profile. Keep older known checkpoints available until the newly written checkpoint has been reopened successfully.
Use an application receipt to decide what to replay
Turn the results into a rule your next worker can implement. Open the target, confirm the expected workspace and record using stable identifiers, and check the application for a durable receipt or a unique task marker. If the browser asks for authentication, pause the task at the human sign-in step. If the record contains the expected completed operation, resume after it. If the state is ambiguous, bring the case to the person who owns the workflow.
This check matters even when the source and copy have independent local profiles. Both may still be logged into the same application account, where each worker can change the same server-side row. For a parallel review, assign distinct records or require a server-side concurrency check. The browser-state experiment tells you that a write in one local profile stayed local. The application owns consistency for the business records.
Finally, treat an archived Chrome profile as sensitive. Keep it out of public logs and routine fixtures, restrict who can restore it, and test using accounts and pages you control. The lifecycle implementation we work on uses an orderly pause before branching and documents which browser data can be inherited. The loopback test above is portable to other browser runners with persistent profiles.

Zuch Huang
Technical Contributor
Contributing author and engineering practitioner at FutureStack.
Free Client-Side AI & Systems Calculators
Size GPU KV-cache VRAM, estimate LLM token costs, audit JWTs, or generate Zod schemas with zero server uploads.
Binary, Hex and Decimal Conversions Every Developer Should Know
Binary, hex and decimal are the three number systems developers actually meet every day — in colour codes, file permissions, bitwise flags, memory addresses and network masks. This guide shows how to convert between them by hand, the mistakes that bite, and when a converter earns its place.
Test this topic live in Fusta AI Code Canvas
Ask follow-up questions or generate a working React, TypeScript, or Python example based on “What a Chrome Profile Checkpoint Actually Restores”.