chrome-tools 1.1.16 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,629 +1,29 @@
1
1
  /**
2
- * Chromium-browser registry — the single source of truth for what differs
3
- * between Chromium-based browsers (Chrome, Edge, Brave, Comet, …).
4
- *
5
- * Every supported browser is a Chromium fork, so the *decryption* is identical
6
- * per OS (AES-128-CBC + PBKDF2 on macOS/Linux, AES-256-GCM + DPAPI on Windows).
7
- * Only two things vary by browser:
8
- * 1. the default profile data directory, and
9
- * 2. the OS-keystore "Safe Storage" label (macOS Keychain service name /
10
- * Linux Secret Service application).
11
- *
12
- * "Browser" is therefore a small dimension orthogonal to "platform": the
13
- * platform backends (darwin/win32/linux) receive a browser descriptor and stay
14
- * otherwise unchanged.
15
- */
16
- type BrowserId = "chrome" | "chrome-beta" | "chrome-canary" | "chromium" | "edge" | "brave" | "comet" | "vivaldi" | "opera";
17
- /** Subpaths to a browser's User Data dir, relative to each OS's app-data base. */
18
- interface BrowserDirs {
19
- /** Under `~/Library/Application Support`. */
20
- darwin: string;
21
- /** Under the selected Windows app-data root. Includes any `User Data` segment. */
22
- win32: string;
23
- /** Windows application-data root. Chromium browsers normally use Local. */
24
- win32Base?: "local" | "roaming";
25
- /** Under `$XDG_CONFIG_HOME` (or `~/.config`). */
26
- linux: string;
27
- }
28
- interface BrowserDescriptor {
29
- /** Stable identifier used on the CLI (`--browser <id>`) and in the API. */
30
- readonly id: BrowserId;
31
- /** Human-readable display name, e.g. "Microsoft Edge". */
32
- readonly name: string;
33
- /** Extra names accepted on the CLI (case-insensitive), e.g. "msedge". */
34
- readonly aliases?: readonly string[];
35
- /**
36
- * macOS Keychain service name (a.k.a. the "<Browser> Safe Storage" item) used
37
- * as the basis for the AES key. Also reused as a human label in messages.
38
- */
39
- readonly safeStorageLabel: string;
40
- /** Linux Secret Service `application` attribute used by `secret-tool lookup`. */
41
- readonly linuxSecretApp?: string;
42
- /** Per-OS User Data subpaths. */
43
- readonly dirs: BrowserDirs;
44
- }
45
- /**
46
- * Supported browsers. macOS paths/labels are verified; a few Windows/Linux
47
- * paths for niche browsers (Comet, Opera) are best-effort and easy to correct —
48
- * each is a single edit here, with no other code change required.
49
- */
50
- declare const BROWSERS: Record<BrowserId, BrowserDescriptor>;
51
- /** All supported browsers, in a stable display order. */
52
- declare function listBrowsers(): BrowserDescriptor[];
53
- /**
54
- * Resolves a browser by id, display name, or alias (case-insensitive).
55
- * @returns The descriptor, or `null` if unrecognized.
56
- */
57
- declare function resolveBrowser(idOrName: string): BrowserDescriptor | null;
58
- /** Resolves a browser or throws an actionable error without changing global state. */
59
- declare function requireBrowser(idOrName: string): BrowserDescriptor;
60
- /** The browser currently targeted by dir/key lookups. Defaults to Chrome. */
61
- declare function getActiveBrowser(): BrowserDescriptor;
62
- /**
63
- * Sets the active browser for subsequent dir/key lookups.
64
- *
65
- * Caches in the platform backends are keyed by their real inputs (Keychain
66
- * service label, chromeDir, Linux secret app), so switching browsers never
67
- * returns a stale key — no cache flush is needed here.
68
- *
69
- * @param idOrName - Browser id/name/alias. Empty/undefined resets to Chrome.
70
- * @returns The now-active descriptor.
71
- * @throws If `idOrName` is non-empty but unrecognized.
72
- */
73
- declare function setActiveBrowser(idOrName?: string): BrowserDescriptor;
74
-
75
- interface DiscoveredProfile {
76
- name: string;
77
- path: string;
78
- }
79
- interface ProfileMetadata {
80
- directory: string;
81
- name: string;
82
- gaiaName: string;
83
- userName: string;
84
- email: string;
85
- avatarIcon: string;
86
- isUsingDefaultName: boolean;
87
- isEphemeral: boolean;
88
- activeTime: number;
89
- }
90
- interface ProfileState {
91
- directory: string;
92
- path: string;
93
- displayName: string;
94
- gaiaName: string;
95
- email: string;
96
- avatarIcon: string;
97
- isEphemeral: boolean;
98
- activeTime: number;
99
- dataFiles: Record<string, boolean>;
100
- }
101
- interface ResolveProfilesOptions {
102
- profilePath?: string;
103
- chromeDir?: string;
104
- profile?: string;
105
- /** Target a specific browser (id/name/alias). Applied only when provided. */
106
- browser?: string;
107
- }
108
- /**
109
- * Returns the default Chrome User Data directory for the current OS.
110
- * Delegates to the active platform backend (macOS/Windows/Linux).
111
- * @returns The absolute path to Chrome's User Data.
112
- */
113
- declare function getDefaultChromeDir(browser?: string | BrowserDescriptor): string;
114
- interface InstalledBrowser {
115
- /** Registry descriptor for the detected browser. */
116
- browser: BrowserDescriptor;
117
- /** Absolute path to this browser's default User Data directory. */
118
- chromeDir: string;
119
- /** Whether the data directory exists on disk. */
120
- installed: boolean;
121
- /** Number of discovered profiles (0 when not installed). */
122
- profileCount: number;
123
- }
124
- /**
125
- * Probes every supported browser for an on-disk profile directory.
126
- *
127
- * @param options.includeMissing - When true, also returns browsers with no data
128
- * directory (installed: false). Defaults to false (installed browsers only).
129
- * @returns One entry per matching browser.
130
- */
131
- declare function detectInstalledBrowsers({ includeMissing }?: {
132
- includeMissing?: boolean;
133
- }): InstalledBrowser[];
134
- /**
135
- * Scans the Chrome User Data directory for profile subdirectories.
136
- * A directory is considered a profile if it contains at least one known data file.
137
- *
138
- * Also handles "flat" layouts (e.g. some Opera installs, or when `chromeDir`
139
- * already points at a single profile folder): if no child profiles are found
140
- * but the user-data directory itself has profile indicators, it is returned
141
- * as a single profile.
142
- *
143
- * @param chromeDir - Chrome User Data path. Defaults to standard macOS location.
144
- * @returns Discovered profiles with name and absolute path.
145
- */
146
- declare function discoverProfiles(chromeDir?: string): DiscoveredProfile[];
147
- /**
148
- * Parses the Chrome "Local State" JSON file to extract profile metadata.
149
- * Returns enriched profile info including display name, email, avatar, etc.
150
- *
151
- * @param chromeDir - Chrome User Data path.
152
- * @returns Profile metadata objects.
153
- */
154
- declare function getProfileMetadata(chromeDir?: string): ProfileMetadata[];
155
- /**
156
- * Combines filesystem profile discovery with Local State metadata
157
- * to provide a comprehensive view of each profile's state.
158
- *
159
- * @param chromeDir - Chrome User Data path.
160
- * @returns Enriched profile state objects.
161
- */
162
- declare function getProfileStates(chromeDir?: string): ProfileState[];
163
- /**
164
- * Resolves a profile name to its directory path.
165
- *
166
- * @param chromeDir - Chrome User Data path.
167
- * @param profileName - Profile directory name (e.g., "Default", "Profile 1").
168
- * @returns Absolute path to profile directory, or null if not found.
169
- */
170
- declare function resolveProfilePath(chromeDir: string, profileName: string): string | null;
171
- /**
172
- * Helper to get the profiles to operate on based on options.
173
- * If a specific profile is specified, returns only that one.
174
- * Otherwise returns all discovered profiles.
175
- *
176
- * @param options - Resolution options.
177
- * @returns Array of targeted profiles.
178
- */
179
- declare function resolveTargetProfiles({ profilePath, chromeDir, profile, browser, }?: ResolveProfilesOptions): DiscoveredProfile[];
180
-
181
- /**
182
- * The platform-specific backend contract.
183
- *
184
- * Everything that differs between operating systems is bundled here because the
185
- * three concerns are coupled — a Windows key only works with the Windows cipher,
186
- * etc. Each backend (darwin/win32/linux) implements this once; the rest of the
187
- * codebase stays platform-agnostic and talks to the selected backend through the
188
- * facades in `./index.ts`.
189
- */
190
- interface ChromePlatform {
191
- /** Node platform identifier this backend handles (e.g. "darwin", "win32", "linux"). */
192
- readonly name: string;
193
- /** Absolute path to Chrome's User Data directory for this OS. */
194
- getDefaultChromeDir(browser?: BrowserDescriptor): string;
195
- /**
196
- * Returns the symmetric key used to decrypt this profile's secrets, ready to
197
- * hand to {@link decrypt}. May read the OS key store and is cached internally.
198
- *
199
- * @param chromeDir - User Data dir, needed on platforms (Windows) where the
200
- * key lives inside `Local State`. Defaults to {@link getDefaultChromeDir}.
201
- * @throws An actionable Error if the key cannot be obtained.
202
- */
203
- getDecryptionKey(chromeDir?: string, browser?: BrowserDescriptor): Buffer;
204
- /**
205
- * Returns the App-Bound Encryption key for Chrome 127+ on Windows.
206
- * Only the win32 backend implements this; others return `undefined`.
207
- *
208
- * @param chromeDir - User Data dir containing the `Local State` file.
209
- * @param browser - Browser to target (needed to select the COM CLSID).
210
- * @returns The decrypted 32-byte AES key, or `undefined` if ABE is
211
- * unavailable or unsupported on this platform.
212
- */
213
- getAppBoundKey?(chromeDir?: string, browser?: BrowserDescriptor): Buffer | undefined;
214
- /**
215
- * Decrypts a single Chrome `v10`/`v11`/`v20` blob using this platform's
216
- * scheme (AES-128-CBC on macOS/Linux, AES-256-GCM on Windows).
217
- *
218
- * @returns The plaintext bytes, or a `<...>` placeholder string on a
219
- * recognized but undecryptable blob (never throws).
220
- */
221
- decrypt(blob: Buffer, key: Buffer): Buffer | string;
222
- /** Clears any cached key material. Useful for tests / re-authentication. */
223
- clearCache(): void;
224
- }
225
-
226
- type KeychainPasswordProvider = (service: string) => string;
227
- /**
228
- * Returns the current global keychain password provider hook.
229
- */
230
- declare function getKeychainPasswordProvider(): KeychainPasswordProvider | null;
231
- /**
232
- * Sets the global keychain password provider hook, allowing downstream apps (like Electron)
233
- * to intercept keychain password lookups and resolve them (e.g. via native node-keytar).
234
- */
235
- declare function setKeychainPasswordProvider(provider: KeychainPasswordProvider | null): void;
236
- /**
237
- * Retrieves a browser's "Safe Storage" password from the macOS Keychain.
238
- * Caches the result per service for subsequent calls within the same process.
239
- *
240
- * @param service - Keychain service name, e.g. "Chrome Safe Storage".
241
- * @returns The raw keychain password.
242
- * @throws If the password could not be retrieved.
243
- */
244
- declare function getKeychainPassword(service?: string): string;
245
- /**
246
- * Backward-compatible alias for {@link getKeychainPassword} using Chrome's item.
247
- * @deprecated Prefer {@link getKeychainPassword} with an explicit service name.
248
- */
249
- declare function getChromeKeychainPassword(): string;
250
- /**
251
- * Clears cached keychain data for all browsers. Useful for testing or
252
- * re-authentication.
253
- */
254
- declare function clearKeychainCache(): void;
255
-
256
- /**
257
- * Platform selection + facades.
258
- *
259
- * This is the ONLY place that reads `process.platform`. Everything else in the
260
- * codebase imports the facades below (`getPlatformChromeDir`, `deriveEncryptionKey`,
261
- * `decryptValue`, `decryptValueBuffer`, `clearKeyCache`) and stays OS-agnostic.
262
- */
263
-
264
- /**
265
- * Returns the backend for the current OS, cached after first call.
266
- * @throws On an unsupported platform.
267
- */
268
- declare function selectPlatform(): ChromePlatform;
269
- /** Default Chrome User Data directory for the current OS. */
270
- declare function getPlatformChromeDir(browser?: string | BrowserDescriptor): string;
271
- /**
272
- * Returns the symmetric key for decrypting this profile's secrets.
273
- * @param chromeDir - Needed on Windows, where the key lives in `Local State`.
274
- */
275
- declare function deriveEncryptionKey(chromeDir?: string, browser?: string | BrowserDescriptor): Buffer;
276
- /** Decrypts a Chrome blob and returns the plaintext bytes (or a placeholder string). */
277
- declare function decryptValueBuffer(blob: Buffer | Uint8Array | null | undefined, key: Buffer): Buffer | string;
278
- /** Decrypts a Chrome blob and returns the plaintext as a UTF-8 string. */
279
- declare function decryptValue(blob: Buffer | Uint8Array | null | undefined, key: Buffer): string;
280
- /** Clears the active backend's cached key material. */
281
- declare function clearKeyCache(): void;
282
-
283
- /**
284
- * Converts a Chrome/Webkit timestamp (microseconds since 1601-01-01)
285
- * to a readable local Date string.
286
- *
287
- * @param chromeTimestamp - Timestamp in microseconds.
288
- * @returns Human-readable date-time string, or "N/A".
289
- */
290
- declare function chromeTimeToDate(chromeTimestamp: bigint | number | string | null | undefined): string;
291
-
292
- /**
293
- * Creates a transactionally consistent snapshot of a Chrome SQLite database,
294
- * executes a query against it, and cleans up. `VACUUM INTO` reads through
295
- * SQLite itself, so live WAL contents are included without racing raw file
296
- * copies while Chrome is writing. A store the browser holds exclusively cannot
297
- * be opened that way at all, and falls back to a file copy (see below).
298
- *
299
- * @param dbFilePath - Absolute path to the Chrome database file.
300
- * @param sql - SQL query to execute.
301
- * @param params - Bound parameters for the query.
302
- * @returns Query result rows.
303
- * @throws If the file doesn't exist or query fails.
304
- */
305
- declare function queryDatabase(dbFilePath: string, sql: string, params?: unknown[]): any[];
306
- /**
307
- * Checks whether a specific table exists in the given database file.
308
- *
309
- * @param dbFilePath - Absolute path to the database file.
310
- * @param tableName - Name of the table to check.
311
- * @returns True if the table exists.
312
- */
313
- declare function tableExists(dbFilePath: string, tableName: string): boolean;
314
-
315
- interface PasswordOptions extends ResolveProfilesOptions {
316
- search?: string;
317
- decryptionKey?: Buffer;
318
- }
319
- /** Which on-disk store a password came from. */
320
- type PasswordSource = "device" | "account";
321
- interface PasswordEntry {
322
- profile: string;
323
- /** "device" = local "Login Data"; "account" = synced "Login Data For Account". */
324
- source?: PasswordSource;
325
- url?: string;
326
- username?: string;
327
- password?: string;
328
- lastUsed?: string;
329
- error?: string;
330
- }
331
- /** What a single password store looked like when it was read. */
332
- interface PasswordStoreReport {
333
- /** The User Data directory searched; "default" when the platform picked it. */
334
- root: string;
335
- profile: string;
336
- /** "Login Data" (device) or "Login Data For Account" (synced). */
337
- file: string;
338
- source: PasswordSource;
339
- exists: boolean;
340
- /** Rows in `logins`, before any search filter. Null when the read failed. */
341
- rows: number | null;
342
- /** Why the read failed, when it did. No credential value is ever included. */
343
- error?: string;
344
- }
345
- /**
346
- * Reports what a `getPasswords` call would read, and what it could not.
347
- *
348
- * `getPasswords` skips a store it cannot open — a missing file, a schema it does
349
- * not know, a database another process is holding — and an empty result cannot
350
- * tell "nothing saved here" from "could not look". This runs the same profile
351
- * resolution and opens the same databases, and answers with row counts and
352
- * errors only. It decrypts nothing, so no password value can escape through it.
353
- */
354
- declare function describePasswordStores({ chromeDir, profilePath, profile, browser, }?: PasswordOptions): PasswordStoreReport[];
355
- /**
356
- * Extracts and decrypts saved passwords from Chrome's password databases.
357
- * Reads both the device-local and account-synced stores, labelling each entry
358
- * with its `source` (no de-duplication across the two).
359
- *
360
- * @param options - Options for profile selection and filtering.
361
- * @returns Array of decrypted password entries.
362
- */
363
- declare function getPasswords({ chromeDir, profilePath, profile, search, browser, decryptionKey, }?: PasswordOptions): PasswordEntry[];
364
-
365
- interface BookmarkOptions extends ResolveProfilesOptions {
366
- folder?: string;
367
- search?: string;
368
- }
369
- interface BookmarkEntry {
370
- profile?: string;
371
- title: string;
372
- url: string;
373
- folder: string;
374
- dateAdded: string;
375
- dateLastUsed: string;
376
- id?: string;
377
- guid?: string;
378
- }
379
- /**
380
- * Reads and parses bookmarks from Chrome's Bookmarks JSON file.
381
- *
382
- * @param options - Options for filtering and targeting.
383
- * @returns Filtered bookmark entries.
384
- */
385
- declare function getBookmarks({ chromeDir, profilePath, profile, folder, search, browser, }?: BookmarkOptions): BookmarkEntry[];
386
-
387
- interface HistoryOptions extends ResolveProfilesOptions {
388
- search?: string;
389
- limit?: number;
390
- }
391
- interface HistoryEntry {
392
- profile: string;
393
- url: string;
394
- title: string;
395
- visitCount: number;
396
- lastVisit: string;
397
- }
398
- interface SearchTermOptions extends ResolveProfilesOptions {
399
- limit?: number;
400
- }
401
- interface SearchTermEntry {
402
- profile: string;
403
- term: string;
404
- url: string;
405
- }
406
- /**
407
- * Retrieves browsing history from Chrome's History database.
408
- *
409
- * @param options - Filtering and targeting options.
410
- * @returns Array of history entries.
411
- */
412
- declare function getHistory({ chromeDir, profilePath, profile, search, limit, browser, }?: HistoryOptions): HistoryEntry[];
413
- /**
414
- * Retrieves search terms from Chrome's History database.
415
- *
416
- * @param options - Targeting and limit options.
417
- * @returns Array of search term entries.
418
- */
419
- declare function getSearchTerms({ chromeDir, profilePath, profile, limit, browser, }?: SearchTermOptions): SearchTermEntry[];
420
-
421
- interface CookieOptions extends ResolveProfilesOptions {
422
- domain?: string;
423
- url?: string;
424
- decrypt?: boolean;
425
- limit?: number;
426
- decryptionKey?: Buffer;
427
- }
428
- interface CookieEntry {
429
- profile: string;
430
- domain: string;
431
- name: string;
432
- value: string;
433
- path: string;
434
- expires: string;
435
- secure: boolean;
436
- httpOnly: boolean;
437
- sameSite: string;
438
- created: string;
439
- lastAccessed: string;
440
- }
441
- /**
442
- * Extracts cookies from Chrome's Cookies database.
443
- * Encrypted values are decrypted using the same mechanism as passwords.
444
- *
445
- * @param options - Targeting and filtering options.
446
- * @returns Array of cookie entries.
447
- */
448
- declare function getCookies({ chromeDir, profilePath, profile, browser, domain, url, decrypt, limit, decryptionKey, }?: CookieOptions): CookieEntry[];
449
-
450
- interface LocalStorageOptions extends ResolveProfilesOptions {
451
- origin?: string;
452
- url?: string;
453
- key?: string;
454
- search?: string;
455
- limit?: number;
456
- }
457
- interface LocalStorageEntry {
458
- profile: string;
459
- origin: string;
460
- key: string;
461
- value: string;
462
- }
463
- /**
464
- * Reads localStorage key/value pairs from Chrome's Local Storage LevelDB store.
465
- *
466
- * @param options - Targeting and filtering options.
467
- * @returns Array of localStorage entries.
468
- */
469
- declare function getLocalStorage({ chromeDir, profilePath, profile, browser, origin, url, key, search, limit, }?: LocalStorageOptions): LocalStorageEntry[];
470
-
471
- interface AutofillOptions extends ResolveProfilesOptions {
472
- search?: string;
473
- limit?: number;
474
- }
475
- interface AutofillEntry {
476
- profile: string;
477
- name: string;
478
- value: string;
479
- dateCreated: string;
480
- dateLastUsed: string;
481
- count: number;
482
- }
483
- interface CreditCardOptions extends ResolveProfilesOptions {
484
- decryptionKey?: Buffer;
485
- }
486
- interface CreditCardEntry {
487
- profile: string;
488
- guid: string;
489
- nameOnCard: string;
490
- expirationMonth: number;
491
- expirationYear: number;
492
- cardNumber: string;
493
- nickname: string;
494
- origin: string;
495
- useCount: number;
496
- dateModified: string;
497
- }
498
- interface AddressOptions extends ResolveProfilesOptions {
499
- }
500
- interface AddressEntry {
501
- profile: string;
502
- guid: string;
503
- fullName: string;
504
- email: string;
505
- phone: string;
506
- companyName: string;
507
- streetAddress: string;
508
- city: string;
509
- state: string;
510
- zipcode: string;
511
- countryCode: string;
512
- origin: string;
513
- useCount: number;
514
- dateModified: string;
515
- }
516
- /**
517
- * Retrieves autofill entries from Chrome's Web Data database.
518
- *
519
- * @param options - Filtering and targeting options.
520
- * @returns Array of autofill entries.
521
- */
522
- declare function getAutofillEntries({ chromeDir, profilePath, profile, browser, search, limit, }?: AutofillOptions): AutofillEntry[];
523
- /**
524
- * Retrieves saved credit cards from Chrome's Web Data database.
525
- * Card numbers are encrypted and will be decrypted.
526
- *
527
- * @param options - Targeting options.
528
- * @returns Array of credit card entries.
529
- */
530
- declare function getCreditCards({ chromeDir, profilePath, profile, browser, decryptionKey, }?: CreditCardOptions): CreditCardEntry[];
531
- /**
532
- * Retrieves saved addresses from Chrome's Web Data database.
533
- *
534
- * @param options - Targeting options.
535
- * @returns Array of address entries.
536
- */
537
- declare function getAddresses({ chromeDir, profilePath, profile, browser }?: AddressOptions): AddressEntry[];
538
-
539
- interface DownloadOptions extends ResolveProfilesOptions {
540
- search?: string;
541
- limit?: number;
542
- }
543
- interface DownloadEntry {
544
- profile: string;
545
- targetPath: string;
546
- url: string;
547
- siteUrl: string;
548
- referrer: string;
549
- totalBytes: number;
550
- receivedBytes: number;
551
- mimeType: string;
552
- state: string;
553
- dangerType: string;
554
- opened: boolean;
555
- startTime: string;
556
- endTime: string;
557
- }
558
- /**
559
- * Retrieves download history from Chrome's History database.
560
- *
561
- * @param options - Targeting, filtering, and limit options.
562
- * @returns Array of download entries.
563
- */
564
- declare function getDownloads({ chromeDir, profilePath, profile, browser, search, limit, }?: DownloadOptions): DownloadEntry[];
565
-
566
- interface ExtensionOptions extends ResolveProfilesOptions {
567
- search?: string;
568
- }
569
- interface ExtensionEntry {
570
- profile: string;
571
- id: string;
572
- name: string;
573
- version: string;
574
- description: string;
575
- enabled: boolean;
576
- homepageUrl: string;
577
- updateUrl: string;
578
- installTime: string;
579
- fromWebstore: boolean;
580
- location: number;
581
- }
582
- /**
583
- * Retrieves installed Chrome extensions from the Preferences JSON file.
584
- *
585
- * @param options - Targeting and filtering options.
586
- * @returns Array of extension entries.
587
- */
588
- declare function getExtensions({ chromeDir, profilePath, profile, search, browser, }?: ExtensionOptions): ExtensionEntry[];
589
-
590
- interface SearchEngineOptions extends ResolveProfilesOptions {
591
- }
592
- interface SearchEngineEntry {
593
- profile: string;
594
- id: number;
595
- name: string;
596
- keyword: string;
597
- url: string;
598
- suggestionsUrl: string;
599
- faviconUrl: string;
600
- isDefault: boolean;
601
- isActive: boolean;
602
- }
603
- /**
604
- * Retrieves search engines configured in Chrome from the Web Data database.
605
- *
606
- * @param options - Targeting options.
607
- * @returns Array of search engine entries.
608
- */
609
- declare function getSearchEngines({ chromeDir, profilePath, profile, browser, }?: SearchEngineOptions): SearchEngineEntry[];
610
-
611
- interface TopSiteOptions extends ResolveProfilesOptions {
612
- }
613
- interface TopSiteEntry {
614
- profile: string;
615
- url: string;
616
- title: string;
617
- rank: number;
618
- redirects: string;
619
- }
620
- /**
621
- * Retrieves top sites from Chrome's Top Sites database.
622
- *
623
- * @param options - Targeting options.
624
- * @returns Array of top site entries.
625
- */
626
- declare function getTopSites({ chromeDir, profilePath, profile, browser }?: TopSiteOptions): TopSiteEntry[];
627
-
628
- export { BROWSERS, chromeTimeToDate, clearKeyCache, clearKeychainCache, decryptValue, decryptValueBuffer, deriveEncryptionKey, describePasswordStores, detectInstalledBrowsers, discoverProfiles, getActiveBrowser, getAddresses, getAutofillEntries, getBookmarks, getChromeKeychainPassword, getCookies, getCreditCards, getDefaultChromeDir, getDownloads, getExtensions, getHistory, getKeychainPassword, getKeychainPasswordProvider, getLocalStorage, getPasswords, getPlatformChromeDir, getProfileMetadata, getProfileStates, getSearchEngines, getSearchTerms, getTopSites, listBrowsers, queryDatabase, requireBrowser, resolveBrowser, resolveProfilePath, resolveTargetProfiles, selectPlatform, setActiveBrowser, setKeychainPasswordProvider, tableExists };
629
- export type { AddressEntry, AddressOptions, AutofillEntry, AutofillOptions, BookmarkEntry, BookmarkOptions, BrowserDescriptor, BrowserId, ChromePlatform, CookieEntry, CookieOptions, CreditCardEntry, CreditCardOptions, DiscoveredProfile, DownloadEntry, DownloadOptions, ExtensionEntry, ExtensionOptions, HistoryEntry, HistoryOptions, InstalledBrowser, KeychainPasswordProvider, LocalStorageEntry, LocalStorageOptions, PasswordEntry, PasswordOptions, PasswordSource, PasswordStoreReport, ProfileMetadata, ProfileState, ResolveProfilesOptions, SearchEngineEntry, SearchEngineOptions, SearchTermEntry, SearchTermOptions, TopSiteEntry, TopSiteOptions };
2
+ * chrome-tools — Public API
3
+ *
4
+ * This module re-exports all feature modules for use as a Node.js library.
5
+ *
6
+ * @example
7
+ * import { getPasswords, getBookmarks, discoverProfiles } from 'chrome-tools';
8
+ *
9
+ * const passwords = getPasswords({ profile: 'Default' });
10
+ * const bookmarks = getBookmarks({ search: 'github' });
11
+ * const profiles = discoverProfiles();
12
+ */
13
+ export { getDefaultChromeDir, discoverProfiles, getProfileMetadata, getProfileStates, resolveProfilePath, resolveTargetProfiles, detectInstalledBrowsers, type DiscoveredProfile, type ProfileMetadata, type ProfileState, type ResolveProfilesOptions, type InstalledBrowser, } from "./chromium/profiles.js";
14
+ export { BROWSERS, listBrowsers, resolveBrowser, requireBrowser, getActiveBrowser, setActiveBrowser, type BrowserId, type BrowserDescriptor, } from "./chromium/browsers.js";
15
+ export { selectPlatform, getPlatformChromeDir, deriveEncryptionKey, decryptValue, decryptValueBuffer, clearKeyCache, type ChromePlatform, } from "./platform/index.js";
16
+ export { getKeychainPassword, getChromeKeychainPassword, clearKeychainCache, setKeychainPasswordProvider, getKeychainPasswordProvider, type KeychainPasswordProvider, } from "./core/keychain.js";
17
+ export { chromeTimeToDate, } from "./core/crypto.js";
18
+ export { queryDatabase, tableExists, } from "./storage/sqlite.js";
19
+ export { describePasswordStores, getPasswords, type PasswordEntry, type PasswordOptions, type PasswordSource, type PasswordStoreReport, } from "./modules/passwords.js";
20
+ export { getBookmarks, type BookmarkEntry, type BookmarkOptions, } from "./modules/bookmarks.js";
21
+ export { getHistory, getSearchTerms, type HistoryEntry, type HistoryOptions, type SearchTermEntry, type SearchTermOptions, } from "./modules/history.js";
22
+ export { getCookies, type CookieEntry, type CookieOptions } from "./modules/cookies.js";
23
+ export { getLocalStorage, type LocalStorageEntry, type LocalStorageOptions } from "./modules/local-storage.js";
24
+ export { getAutofillEntries, getCreditCards, getAddresses, type AddressEntry, type AddressOptions, type AutofillEntry, type AutofillOptions, type CreditCardEntry, type CreditCardOptions, } from "./modules/autofill.js";
25
+ export { getDownloads, type DownloadEntry, type DownloadOptions, } from "./modules/downloads.js";
26
+ export { getExtensions, type ExtensionEntry, type ExtensionOptions, } from "./modules/extensions.js";
27
+ export { getSearchEngines, type SearchEngineEntry, type SearchEngineOptions, } from "./modules/search-engines.js";
28
+ export { getTopSites, type TopSiteEntry, type TopSiteOptions, } from "./modules/top-sites.js";
29
+ export type { ProfileReadDiagnostic, ProfileReadReporter, StoreReadIssue } from "./storage/errors.js";