Expand tilde in profile path to home directory
This commit is contained in:
+3
-1
@@ -661,7 +661,9 @@ export class BrowserManager {
|
|||||||
this.isPersistentContext = true;
|
this.isPersistentContext = true;
|
||||||
} else if (hasProfile) {
|
} else if (hasProfile) {
|
||||||
// Profile uses persistent context for durable cookies/storage
|
// 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,
|
headless: options.headless ?? true,
|
||||||
executablePath: options.executablePath,
|
executablePath: options.executablePath,
|
||||||
viewport,
|
viewport,
|
||||||
|
|||||||
Reference in New Issue
Block a user