fix: allow empty userDataDir (#34730)

This commit is contained in:
Max Schmitt 2025-02-12 14:21:57 +01:00 committed by GitHub
parent bd74fc4964
commit c052627138
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,7 +100,7 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel> imple
ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs), ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs),
env: options.env ? envObjectToArray(options.env) : undefined, env: options.env ? envObjectToArray(options.env) : undefined,
channel: options.channel, channel: options.channel,
userDataDir: path.isAbsolute(userDataDir) ? userDataDir : path.resolve(userDataDir), userDataDir: (path.isAbsolute(userDataDir) || !userDataDir) ? userDataDir : path.resolve(userDataDir),
}; };
return await this._wrapApiCall(async () => { return await this._wrapApiCall(async () => {
const result = await this._channel.launchPersistentContext(persistentParams); const result = await this._channel.launchPersistentContext(persistentParams);