From 447e6ece0beca7f90c49d475b5b20c7063f6cb75 Mon Sep 17 00:00:00 2001 From: elsigh Date: Tue, 13 Jan 2026 14:01:39 -0800 Subject: [PATCH] Expand tilde in profile path to home directory --- src/browser.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/browser.ts b/src/browser.ts index e0c20de..b861586 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -661,7 +661,9 @@ export class BrowserManager { this.isPersistentContext = true; } else if (hasProfile) { // Profile uses persistent context for durable cookies/storage - context = await launcher.launchPersistentContext(options.profile!, { + // Expand ~ to home directory since it won't be shell-expanded + const profilePath = options.profile!.replace(/^~\//, os.homedir() + '/'); + context = await launcher.launchPersistentContext(profilePath, { headless: options.headless ?? true, executablePath: options.executablePath, viewport,