From 4cd1676ddc8cbbf1e8ae645f896a6604677c83fa Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 4 Sep 2020 17:55:25 -0400 Subject: [PATCH] Handle error if _waitForFrontendReady fails when creating a popup proxy (#760) --- ext/fg/js/frontend.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 61789473..44690028 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -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) {