Skip to content

Conversation

@JoelEinbinder
Copy link
Contributor

slowMo was missing in launchPersistentContext, and I refactored the types a bit.

async launchPersistentContext(userDataDir: string, options: LaunchOptions = {}): Promise<BrowserContext> {
const {
timeout = 30000,
slowMo = undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it should be ok to drop = undefined initialization and leave just slowMo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to = 0. I don't like destructing an optional value without a default. Feels like a bug to me at first glance, even though it isn't.

wsEndpoint: string
} & BrowserOptions;

type BrowserOptions = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am personally lost in all these types. For example, I don't understand why BrowserOptions include slowMo. Can we just inline all the one-offs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I inlined BrowserOptions, and changed the types we export.

BrowserArgsOptions: For default args method
LaunchOptions: For the launch and launchPersistent methods
LaunchServerOptions: For launchServer and _launchServer methods
ConnectOptions: For connect method

Hopefully things are easier to follow now!

@JoelEinbinder JoelEinbinder merged commit 6053784 into microsoft:master Mar 31, 2020
debs-obrien pushed a commit to debs-obrien/playwright that referenced this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants