-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
fix(chromium): select all on macos should work again #3006
fix(chromium): select all on macos should work again #3006
Conversation
223f83b
to
2e43bac
Compare
@@ -50,6 +51,8 @@ export class CRBrowser extends BrowserBase { | |||
const browser = new CRBrowser(connection, options); | |||
browser._devtools = devtools; | |||
const session = connection.rootSession; | |||
const version = await session.send('Browser.getVersion'); | |||
browser._isMac = version.userAgent.includes('Macintosh'); |
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.
Is this the remote-first world, i.e. now browser OS might be different from client OS?
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've always had .connect. Yes
constructor( | ||
private _client: CRSession, | ||
private _isMac: boolean, | ||
) { } |
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.
fancy ts! what does it do?
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.
it is a shortcut for:
class Foo {
private bar: number;
constructor(barOpt: number) {
this.bar = barOpt;
}
}
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.
takes an argument in the constructor and immediately sets it as a property. Lets you avoid declaring the type of everything twice and another line to set it.
const textarea = await page.$('textarea'); | ||
await textarea.type('some text'); | ||
// select one word backwards | ||
await page.keyboard.press('Shift+Control+Alt+KeyB'); |
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.
very fancy!
The patch that enabled this upstream for us got reverted. So we do it ourselves using our own list of macOS editing commands.