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

browser(firefox): remove the hack around setting viewport size #4010

Conversation

aslushnikov
Copy link
Contributor

Juggler code had a bug where we subscribed to window and tab
events, but did not iterate collections of current windows and tabs.

As a result, we were sometimes failing to set viewport size for the
initial window, and implemented an artificial promise to workaround
the problem.

This patch:

  • starts calling onOpenWindow and onOpenTabListener callbacks
    for all windows and tabs - current and future, eliminating the
    race condition.

This worked too well and we started overriding window sizes that
were set by users with window.open(url, 'width=300;height=400') (we
have a test for this). To fix this, we now plumb CHROME_WITH_SIZE
flag from appWindow and override viewport iff this flag is not set.

After this patch, we will use the onTabOpened event to move user
agent emulation to the browser-side.

References #3995

Juggler code had a bug where we subscribed to window and tab
events, but did not iterate collections of current windows and tabs.

As a result, we were sometimes failing to set viewport size for the
initial window, and implemented an artificial promise to workaround
the problem.

This patch:
- starts calling `onOpenWindow` and `onOpenTabListener` callbacks
  for *all* windows and tabs - current and future, eliminating the
  race condition.

This worked too well and we started overriding window sizes that
were set by users with `window.open(url, 'width=300;height=400')` (we
have a test for this). To fix this, we now plumb `CHROME_WITH_SIZE`
flag from appWindow and override viewport iff this flag is not set.

After this patch, we will use the `onTabOpened` event to move user
agent emulation to the browser-side.

References microsoft#3995
@aslushnikov aslushnikov merged commit 24bc0e3 into microsoft:master Sep 30, 2020
@aslushnikov aslushnikov deleted the fff-remove-hach-that-waits-for-first-page-sometimes branch September 30, 2020 07:36
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