(browser: BrowserInfo)
| 617 | } |
| 618 | |
| 619 | async function getLinuxSecretPassword(browser: BrowserInfo): Promise<string | null> { |
| 620 | const attempts: string[][] = [ |
| 621 | ['secret-tool', 'lookup', 'Title', browser.keychainService], |
| 622 | ]; |
| 623 | |
| 624 | if (browser.linuxApplication) { |
| 625 | attempts.push( |
| 626 | ['secret-tool', 'lookup', 'xdg:schema', 'chrome_libsecret_os_crypt_password_v2', 'application', browser.linuxApplication], |
| 627 | ['secret-tool', 'lookup', 'xdg:schema', 'chrome_libsecret_os_crypt_password', 'application', browser.linuxApplication], |
| 628 | ); |
| 629 | } |
| 630 | |
| 631 | for (const cmd of attempts) { |
| 632 | const password = await runPasswordLookup(cmd, 3_000); |
| 633 | if (password) return password; |
| 634 | } |
| 635 | |
| 636 | return null; |
| 637 | } |
| 638 | |
| 639 | async function runPasswordLookup(cmd: string[], timeoutMs: number): Promise<string | null> { |
| 640 | try { |
no test coverage detected