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(connect): make selectors.register work in connected browser #3664

Merged
merged 2 commits into from
Sep 2, 2020
Merged

fix(connect): make selectors.register work in connected browser #3664

merged 2 commits into from
Sep 2, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Aug 27, 2020

This is a large rework of selectors:

  • Each BrowserContext now has a separate Selectors instance that has its own registrations. Most of them share a single sharedSelectors instance, but contexts created for a connected browser have their own instance.
  • Connected browser now gets a RemoteBrowser object that encapsulates Selectors and Browser. This Selectors object is registered with the api selectors.
  • Public selectors.register api iterates over all registered Selectors channels and registers in each of them.
  • createSelector testing method migrated to ElementHandle._createSelectorForTest.

This is a large rework of selectors:
- each BrowserContext now has a separate Selectors instance that
  has its own registrations;
- public selectors.register api iterates over all contexts and
  registers in each of them;
- connected browser reuses Selectors instance from the parent
  BrowserType;
- rpc methods migrated to BrowserContext.registerSelectorEngine
  and ElementHandle._createSelectorForTest.

Selectors could be per-browser, but launchPersistentContext does
not report a Browser over rpc, so it has to be per-context now.
@dgozman dgozman merged commit de547d7 into microsoft:master Sep 2, 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.

2 participants