Expand tilde in profile path to home directory

This commit is contained in:
elsigh
2026-01-13 14:01:39 -08:00
parent d86de0e736
commit 447e6ece0b
+3 -1
View File
@@ -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,