Files
HackBrowserData/browser/firefox/source.go
T
Roger 1b8bb1df3d feat: add Chromium Browser with new v2 architecture (#530)
* feat: add Chromium Browser implementation with new architecture
* refactor: replace Walk with ReadDir+Stat for profile discovery
* refactor: remove queries override, use extractors for Yandex passwords
* refactor: remove dataSource wrapper, use []sourcePath directly
* fix: address Copilot review feedback on chromium_new.go
* fix: always call key retriever regardless of Local State existence
2026-04-04 01:41:02 +08:00

34 lines
1.2 KiB
Go

package firefox
import (
"path/filepath"
"github.com/moond4rk/hackbrowserdata/types"
)
// sourcePath describes a single candidate location for browser data,
// relative to the profile directory.
type sourcePath struct {
rel string // relative path from profileDir
isDir bool // true for directory targets
}
func file(rel string) sourcePath { return sourcePath{rel: filepath.FromSlash(rel), isDir: false} }
// dataSource holds one or more candidate sourcePaths in priority order.
type dataSource struct {
candidates []sourcePath
}
// firefoxSources defines the Firefox file layout.
// Firefox does not support SessionStorage or CreditCard extraction.
var firefoxSources = map[types.Category]dataSource{
types.Password: {candidates: []sourcePath{file("logins.json")}},
types.Cookie: {candidates: []sourcePath{file("cookies.sqlite")}},
types.History: {candidates: []sourcePath{file("places.sqlite")}},
types.Download: {candidates: []sourcePath{file("places.sqlite")}},
types.Bookmark: {candidates: []sourcePath{file("places.sqlite")}},
types.Extension: {candidates: []sourcePath{file("extensions.json")}},
types.LocalStorage: {candidates: []sourcePath{file("webappsstore.sqlite")}},
}