-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(browserContext): add BrowserContext.browser() #3849
feat(browserContext): add BrowserContext.browser() #3849
Conversation
src/client/browserContext.ts
Outdated
@@ -92,6 +92,10 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel, | |||
this._channel.setDefaultTimeoutNoReply({ timeout }); | |||
} | |||
|
|||
browser(): Browser { | |||
return this._browser!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about the !
. There should be always a browser instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably change the type of this field to Browser
and throw in the constructor if parent instanceof Browser
check fails.
26543ee
to
a1175f6
Compare
src/client/browserContext.ts
Outdated
@@ -92,6 +92,10 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel, | |||
this._channel.setDefaultTimeoutNoReply({ timeout }); | |||
} | |||
|
|||
browser(): Browser { | |||
return this._browser!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably change the type of this field to Browser
and throw in the constructor if parent instanceof Browser
check fails.
dbd503a
to
4cb4aab
Compare
4cb4aab
to
efdebf9
Compare
When a browser was launched with a persistent context, then browser was undefined. Changed it to null, so it reflects to our current API design. (We don't expose undefined only null for nil elements). |
Talked with Pavel about that.