Skip to content

Commit

Permalink
docs: improve JSDoc documentation for Chrome password retrieval
Browse files Browse the repository at this point in the history
- Restore detailed JSDoc for Chrome Safe Storage password retrieval

- Add context about password usage and platform support

- Document error conditions in throws clause
  • Loading branch information
mherod committed Jan 5, 2025
1 parent b1d90d5 commit 00f8467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/core/browsers/chrome/getChromePassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { platform } from "os";
import { getChromePassword as getMacOSPassword } from "./macos/getChromePassword";

/**
* Gets the Chrome Safe Storage password for the current platform
* Gets the Chrome Safe Storage password for the current platform.
* This password is used to decrypt cookies stored in Chrome's cookie database.
* Currently only supports macOS, where the password is stored in the system keychain.
* @returns A promise that resolves to the Chrome Safe Storage password
* @throws {Error} If the password cannot be retrieved or the platform is not supported
*/
Expand Down
5 changes: 3 additions & 2 deletions src/core/browsers/chrome/macos/getChromePassword.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { execSimple } from "../../../../utils/execSimple";

/**
* Gets the Chrome password from the keychain
* @returns The password
* Retrieves the Chrome Safe Storage password from the macOS keychain
* @returns A promise that resolves to the Chrome Safe Storage password
* @throws {Error} If the password cannot be retrieved from the keychain
*/
export async function getChromePassword(): Promise<string> {
const command = 'security find-generic-password -w -s "Chrome Safe Storage"';
Expand Down

0 comments on commit 00f8467

Please sign in to comment.