browser(firefox): fix screencast start event for popups (#3834)

This commit is contained in:
Yury Semikhatsky 2020-09-10 14:37:48 -07:00 committed by GitHub
parent 1e8e24c3d0
commit 25b199b40a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 10 deletions

View File

@ -1,2 +1,2 @@
1172
Changed: yurys@chromium.org Wed Sep 9 23:06:13 PDT 2020
1173
Changed: yurys@chromium.org Thu Sep 10 12:35:25 PDT 2020

View File

@ -196,11 +196,6 @@ class TargetRegistry {
const browserContext = this._userContextIdToBrowserContext.get(userContextId);
if (browserContext && browserContext.defaultViewportSize)
setViewportSizeForBrowser(browserContext.defaultViewportSize, tab.linkedBrowser, window);
const linkedBrowser = tab.linkedBrowser;
const target = this._browserToTarget.get(linkedBrowser);
if (target)
target._pageWindowReadyCallback();
};
const onTabCloseListener = event => {
@ -325,7 +320,6 @@ class TargetRegistry {
});
if (browserContext && browserContext.defaultViewportSize)
setViewportSizeForBrowser(browserContext.defaultViewportSize, browser, window);
target._pageWindowReadyCallback();
browser.focus();
if (browserContext.settings.timezoneId) {
if (await target.hasFailedToOverrideTimezone())
@ -382,7 +376,10 @@ class PageTarget {
browserContext._firstPageCallback();
this._registry._browserToTarget.set(this._linkedBrowser, this);
this._registry._browserBrowsingContextToTarget.set(this._linkedBrowser.browsingContext, this);
this._pageWindowReady = new Promise(r => this._pageWindowReadyCallback = r);
}
async windowReady() {
await waitForWindowReady(this._window);
}
linkedBrowser() {

View File

@ -140,7 +140,7 @@ class PageHandler {
// On Mac the window may not yet be visible when TargetCreated and its
// NSWindow.windowNumber may be -1, so we wait until the window is known
// to be initialized and visible.
await this._pageTarget._pageWindowReady;
await this._pageTarget.windowReady();
await this.startVideoRecording(Object.assign({file}, options));
}
}