refactor(browser): publicize key-injection capability api (#597)

Promote keyRetrieversSetter to public KeyManager and lift
keychainPasswordSetter from browser_darwin.go into browser.go as
KeychainPasswordReceiver. Engines already implement these methods;
only type-assertion sites switch to the public interface names.
This commit is contained in:
Roger
2026-05-16 12:26:57 +08:00
committed by GitHub
parent f8bd391923
commit 00be145044
4 changed files with 16 additions and 25 deletions
+7 -4
View File
@@ -111,13 +111,16 @@ func pickFromConfigs(configs []types.BrowserConfig, opts PickOptions) ([]Browser
return browsers, nil
}
// keyRetrieversSetter is an optional capability interface. Chromium variants implement it to
// receive the per-tier master-key retrievers (V10 / V11 / V20) as a single Retrievers struct;
// Firefox and Safari do not.
type keyRetrieversSetter interface {
// KeyManager is implemented by engines that accept externally-provided master-key retrievers (Chromium family only).
type KeyManager interface {
SetKeyRetrievers(keyretriever.Retrievers)
}
// KeychainPasswordReceiver is implemented by engines that need the macOS login password (Safari only).
type KeychainPasswordReceiver interface {
SetKeychainPassword(string)
}
// resolveGlobs expands glob patterns in browser configs' UserDataDir.
// This supports MSIX/UWP browsers on Windows whose package directories
// contain a dynamic publisher hash suffix (e.g., "TheBrowserCompany.Arc_*").