Handle error if _waitForFrontendReady fails when creating a popup proxy (#760)

This commit is contained in:
toasted-nutbread 2020-09-04 17:55:25 -04:00 committed by GitHub
parent d8f488e28c
commit 4cd1676ddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -357,7 +357,12 @@ class Frontend {
async _getIframeProxyPopup() {
const targetFrameId = 0; // Root frameId
await this._waitForFrontendReady(targetFrameId);
try {
await this._waitForFrontendReady(targetFrameId);
} catch (e) {
// Root frame not available
return await this._getDefaultPopup();
}
const {popupId} = await api.crossFrame.invoke(targetFrameId, 'getPopupInfo');
if (popupId === null) {