Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/playwright-extra/src/extra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface AugmentedLauncherAPIs
extends Pick<
PlaywrightBrowserLauncher,
'launch' | 'launchPersistentContext' | 'connect' | 'connectOverCDP'
> {}
> { }

/**
* Modular plugin framework to teach `playwright` new tricks.
Expand Down Expand Up @@ -119,6 +119,14 @@ export class PlaywrightExtraClass implements AugmentedLauncherAPIs {
options =
(await this.plugins.dispatchBlocking('beforeLaunch', options)) || options

if ('userDataDir' in options && !userDataDir) {
userDataDir = (options as any).userDataDir
debug(
"A plugin defined userDataDir during .launchPersistentContext", userDataDir
)
delete (options as any).userDataDir
}

const context = await this.launcher['launchPersistentContext'](
userDataDir,
options
Expand Down