refactor(browser): split installation and profile abstractions (#603)

* refactor(browser): split installation and profile abstractions

A Chromium installation shares one master key across its profiles, but
modeling each profile as its own Browser re-derived the key per profile.
Browser now represents one installation holding its profiles and derives
the key once; new types.Profile/ExtractResult/CountResult carry per-profile
results.

* style: gofumpt safari_test.go

* test(chromium): rename shadowed loop var to path
This commit is contained in:
Roger
2026-05-31 16:37:23 +08:00
committed by GitHub
parent d5dc81f1c0
commit b901f7dff0
28 changed files with 1359 additions and 1206 deletions
+6 -4
View File
@@ -17,12 +17,14 @@ func extractAndWrite(browsers []browser.Browser, categories []types.Category, ou
return err
}
for _, b := range browsers {
log.Infof("Extracting %s/%s...", b.BrowserName(), b.ProfileName())
data, extractErr := b.Extract(categories)
log.Infof("Extracting %s...", b.BrowserName())
results, extractErr := b.Extract(categories)
if extractErr != nil {
log.Errorf("extract %s/%s: %v", b.BrowserName(), b.ProfileName(), extractErr)
log.Errorf("extract %s: %v", b.BrowserName(), extractErr)
}
for _, r := range results {
w.Add(b.BrowserName(), r.Name, r.Data)
}
w.Add(b.BrowserName(), b.ProfileName(), data)
}
if err := w.Write(); err != nil {
return err