Skip to content
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

Merged
merged 2 commits into from Jul 17, 2020

Conversation

JoelEinbinder
Copy link
Contributor

The patch that enabled this upstream for us got reverted. So we do it ourselves using our own list of macOS editing commands.

@@ -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');
Copy link
Collaborator

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?

Copy link
Contributor Author

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,
) { }
Copy link
Collaborator

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?

Copy link
Contributor Author

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;
  }
}

Copy link
Contributor Author

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');
Copy link
Collaborator

Choose a reason for hiding this comment

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

very fancy!

@JoelEinbinder JoelEinbinder merged commit 631fbce into microsoft:master Jul 17, 2020
pavelfeldman added a commit to pavelfeldman/playwright that referenced this pull request Jul 17, 2020
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.

None yet

2 participants