Read-only MVP for analyzing Microsoft Edge storage quota and Service Worker snapshots.
Using this tool may cause your Edge profile and account LOGOUT. You may need to login and sync again after analyze.
npm install
cd engine && cargo testmkdir -p out
cp fixtures/raw.json out/raw.json
bin/swsx --skip-collectClose Microsoft Edge before collecting. By default, the tool scans the Edge User Data
directory at $HOME/Library/Application Support/Microsoft Edge and outputs to ./out:
bin/swsxTo analyze a different profile:
bin/swsx --profile /path/to/other/profileThe MVP does not clear browser data, kill browser processes, or run destructive Chrome DevTools Protocol commands. Cleanup output is guidance only.
主入口脚本为 bin/swsx(可直接执行)。脚本行为要点:
- 会在开始采集前检查 Microsoft Edge 是否在运行;若检测到正在运行会退出并提示先关闭浏览器。
- 默认 profile 为
$HOME/Library/Application Support/Microsoft Edge,输出目录默认./out。 - 支持参数
--profile、--out、--top、--threshold、--skip-collect、--dry-run。 - 当未使用
--skip-collect时,脚本会调用采集器node collector/collect.mjs进行数据抓取;采集完成后用cargo run启动engine进行分析并打印报告。
示例:
采集并分析(默认行为):
bin/swsx仅分析现有 out/raw.json(跳过采集):
bin/swsx --skip-collect指定 profile、输出目录与参数:
bin/swsx --profile "/path/to/profile" --out ./out --top 5 --threshold "100 MiB"Dry-run 校验采集器启动参数:
bin/swsx --dry-run- 原始快照(采集器写入
out/raw.json,下面为裁剪后的示例片段):
{
"capturedAt": "2026-05-14T00:00:00.000Z",
"browser": "edge",
"pages": {
"quotaInternals": {
"url": "edge://quota-internals",
"html": "<table>...<tr><td>https://example.com</td><td>640 MiB</td><td>600 MiB</td></tr>..."
},
"serviceWorkerInternals": { "url": "edge://serviceworker-internals", "html": "<div class=\"serviceworker\">..." },
"extensions": { "url": "edge://extensions", "html": "<extensions-item id=\"abc123def456\">Sample Extension</extensions-item>" }
}
}- 分析报告(实际运行输出,基于 fixtures/raw.json):
SWSX Report
========================
Parsed: 4 quota records, 2 service workers, 1 extensions
Total usage: 712.00 MiB
Top Storage Consumers
┌─────────────────────────────────┬────────────┬──────────────┬───────────┐
│ Origin ┆ Usage ┆ CacheStorage ┆ Kind │
╞═════════════════════════════════╪════════════╪══════════════╪═══════════╡
│ https://example.com ┆ 640.00 MiB ┆ 600.00 MiB ┆ Website │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ chrome-extension://abc123def456 ┆ 42.00 MiB ┆ 40.00 MiB ┆ Extension │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ chrome-extension://missing999 ┆ 18.00 MiB ┆ 18.00 MiB ┆ Extension │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ https://orphan.test ┆ 12.00 MiB ┆ 1.00 MiB ┆ Website │
└─────────────────────────────────┴────────────┴──────────────┴───────────┘
Orphaned Storage Candidates
┌───────────────────────────────┬───────────┬──────────────┬───────────┐
│ Origin ┆ Usage ┆ CacheStorage ┆ Kind │
╞═══════════════════════════════╪═══════════╪══════════════╪═══════════╡
│ https://orphan.test ┆ 12.00 MiB ┆ 1.00 MiB ┆ Website │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ chrome-extension://missing999 ┆ 18.00 MiB ┆ 18.00 MiB ┆ Extension │
└───────────────────────────────┴───────────┴──────────────┴───────────┘
Cache Bloat Risk Candidates
┌─────────────────────┬────────────┬──────────────┬─────────┐
│ Origin ┆ Usage ┆ CacheStorage ┆ Kind │
╞═════════════════════╪════════════╪══════════════╪═════════╡
│ https://example.com ┆ 640.00 MiB ┆ 600.00 MiB ┆ Website │
└─────────────────────┴────────────┴──────────────┴─────────┘
Extension Residue Candidates
┌───────────────────────────────┬───────────┬──────────────┬───────────┐
│ Origin ┆ Usage ┆ CacheStorage ┆ Kind │
╞═══════════════════════════════╪═══════════╪══════════════╪═══════════╡
│ chrome-extension://missing999 ┆ 18.00 MiB ┆ 18.00 MiB ┆ Extension │
└───────────────────────────────┴───────────┴──────────────┴───────────┘
Cleanup Guidance
- Inspect and clear site data for https://orphan.test from Edge settings. CDP reference only: Stor
age.clearDataForOrigin(origin: "https://orphan.test", storageTypes: "all")
- Inspect and clear site data for chrome-extension://missing999 from Edge settings. CDP reference
only: Storage.clearDataForOrigin(origin: "chrome-extension://missing999", storageTypes: "all")
- Inspect and clear site data for https://example.com from Edge settings. CDP reference only: Stor
age.clearDataForOrigin(origin: "https://example.com", storageTypes: "all")
- Inspect and clear site data for chrome-extension://missing999 from Edge settings. CDP reference
only: Storage.clearDataForOrigin(origin: "chrome-extension://missing999", storageTypes: "all")采集(在采集前请关闭 Edge):
node collector/collect.mjs --profile "$HOME/Library/Application Support/Microsoft Edge" --out out
# 或(仅做 dry-run 校验)
node collector/collect.mjs --profile /path/to/profile --dry-run离线分析(使用现有 out/raw.json):
mkdir -p out
cp fixtures/raw.json out/raw.json
bin/swsx --skip-collect
# 或直接在 engine 目录运行(需先构建)
cd engine && cargo run -- --input ../fixtures/raw.json --top 10 --threshold "500 MiB"