25 November 2026 | Source-reviewed / not executed
Goal and cost
Check whether a browser debugging tool can reproduce a network failure and restore the successful state after removing its mock. Use only synthetic files, a loopback server and a disposable browser. No LLM, remote target, credentials, paid API or real outage. Reader-controlled time: 20–30 minutes. Prerequisites: Node 22.12+ on a supported LTS line, npm, current Chrome, Python 3 and normal package download access. Review packages before installation; do not attach to a personal browser or run in an existing agent workspace.
1. Prepare the fixture
In a new disposable directory, create the following files. The page displays the result of a same-origin fetch; a network failure should take the catch branch.
mkdir -p chrome-mock-lab
cd chrome-mock-lab
cat > index.html <<'EOF'
<!doctype html>
<html lang="en"><meta charset="utf-8">
<title>Local fetch regression</title>
<p id="result" role="status">loading</p>
<script>
fetch('/data.json').then(r => {
if (!r.ok) throw Error('HTTP ' + r.status);
return r.json();
}).then(d => {
document.querySelector('#result').textContent = d.message;
}).catch(() => {
document.querySelector('#result').textContent = 'offline fallback';
});
</script></html>
EOF
printf '{"message":"online success"}\n' > data.json
python3 -m http.server 8765 --bind 127.0.0.1Keep this terminal open. In another terminal, change into the same directory.
2. Install and start the pinned tool
npm view [email protected] version
npm init -y
npm install --save-exact [email protected]
export CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1
export CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1
npx --no-install chrome-devtools start --help
npx --no-install chrome-devtools start --headless --isolated --workspace="$PWD" --no-usage-statistics --no-performance-crux
npx --no-install chrome-devtools new_page http://127.0.0.1:8765/index.html
npx --no-install chrome-devtools list_pages --output-format=jsonDo not start if the version is unavailable or if an existing daemon uses a personal browser. Use a disposable OS account or container with Chrome support. The tagged CLI docs say it enables off-by-default categories except PWA; inspect tool help for network mock flags. Use the actual page ID shown by list_pages (the following examples use 2; substitute your ID). The CLI defaults to an isolated browser absent a userDataDir; do not provide one.
3. Establish baseline and abort the request
PAGE=2
URL=http://127.0.0.1:8765/data.json
npx --no-install chrome-devtools take_snapshot "$PAGE" --output-format=json > baseline.json
npx --no-install chrome-devtools mock_network --help
npx --no-install chrome-devtools mock_network "$PAGE" --route "$URL" --abort true --output-format=json
npx --no-install chrome-devtools navigate_page "$PAGE" --url http://127.0.0.1:8765/index.html
npx --no-install chrome-devtools take_snapshot "$PAGE" --output-format=json > aborted.json
npx --no-install chrome-devtools mock_network "$PAGE" --output-format=json > mock-hits.jsonExpected: baseline contains online success; after navigation the page contains offline fallback. Wait for the status to settle if the snapshot still says loading, and take it again. Mock inspection should report a matching route with a nonzero hit count. Save the actual CLI help and output; if the Boolean parser expects a bare --abort, use the documented local help and record the adjustment.
4. Remove the mock and check recovery
npx --no-install chrome-devtools remove_network_mock "$PAGE" --route "$URL"
npx --no-install chrome-devtools navigate_page "$PAGE" --url http://127.0.0.1:8765/index.html
npx --no-install chrome-devtools take_snapshot "$PAGE" --output-format=json > recovered.json
npx --no-install chrome-devtools mock_network "$PAGE" --output-format=json > mocks-after.jsonExpected: online success returns and no mock remains for this route. Repeat steps 3 and 4 three times, saving separate numbered outputs. Confirm each baseline before the next abort.
Scoring and interpretation
For each cycle award one point each for baseline success, observed fallback, matching mock hit, recovered success and no remaining mock. Maximum 15 across three cycles. Record actual values, exact version, browser version, OS, elapsed time and any failed command. A score of 15 would support reproducibility for this fixture only. Do not claim production fault coverage, model quality or network timing equivalence.
Troubleshooting and cleanup
- If port 8765 is occupied, choose another unused loopback port and change every URL consistently.
- If tool or daemon startup fails, review the tagged CLI help and logs; do not attach to a logged-in browser. A missing network-mocks category is a failed setup unless a documented enable flag resolves it.
- If no hit occurs, verify the exact route, page ID, no service worker, and that navigation occurred after setting the mock. Network mocks disable caching; avoid performance traces while changing them.
- If a snapshot still reads loading, capture again after the fetch settles. Do not count an absent response as a successful failure test.
- Stop the daemon with
npx --no-install chrome-devtools stopand stop the local Python server with Ctrl-C. Keep fixture and outputs for comparison, then remove the disposable directory when no longer needed.
Sources and validation
Source-reviewed only. The commands, CLI flags, expected outputs and scores have not been executed or observed in this edition. No model or browser experiment was run during publication.