Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListBrowsers ¶
func ListBrowsers() []string
ListBrowsers returns sorted keys of all platform browsers.
Types ¶
type Browser ¶
type Browser interface {
BrowserName() string
ProfileName() string
ProfileDir() string
Extract(categories []types.Category) (*types.BrowserData, error)
CountEntries(categories []types.Category) (map[types.Category]int, error)
}
Browser is the interface implemented by every engine package — chromium.Browser, firefox.Browser, and safari.Browser.
func DiscoverBrowsers ¶ added in v0.5.0
func DiscoverBrowsers(opts PickOptions) ([]Browser, error)
DiscoverBrowsers returns browsers for metadata-only workflows — listing, profile paths, per-category counts. Decryption dependencies are NOT injected, so calling b.Extract on the returned browsers will not successfully decrypt protected data (passwords, cookies, credit cards). CountEntries, BrowserName, ProfileName, and ProfileDir all work correctly without injection.
Unlike PickBrowsers, DiscoverBrowsers never prompts for the macOS Keychain password, making it the correct choice for `list`-style commands that have no use for the credential.
func PickBrowsers ¶
func PickBrowsers(opts PickOptions) ([]Browser, error)
PickBrowsers returns browsers that are fully wired up for Extract: the key retriever chain and (on macOS) the Keychain password are already injected, so the caller can call b.Extract directly. This is the entry point for extraction workflows like `dump`.
On macOS this may trigger an interactive prompt for the login password when the target set includes a Chromium variant or Safari. Commands that only need metadata (name, profile path, per-category counts) should use DiscoverBrowsers instead to skip injection — and thereby the prompt.
When Name is "all", all known browsers are tried. ProfilePath overrides the default user data directory (only when targeting a specific browser).
type PickOptions ¶ added in v0.5.0
type PickOptions struct {
Name string // browser name filter: "all"|"chrome"|"firefox"|...
ProfilePath string // custom profile directory override
KeychainPassword string // macOS only — see browser_darwin.go
}
PickOptions configures which browsers to pick.