From 2c8641fbbf4141e011918fe50e919f034cf6bd4c Mon Sep 17 00:00:00 2001 From: mbnuqw Date: Tue, 27 Feb 2024 19:51:58 +0500 Subject: [PATCH] fix: workaround for 1660564 in some cases lead to blank sidebar --- src/services/windows.actions.ts | 5 +++++ src/sidebar/sidebar.ts | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/services/windows.actions.ts b/src/services/windows.actions.ts index c43d977b..e35c3e2f 100644 --- a/src/services/windows.actions.ts +++ b/src/services/windows.actions.ts @@ -27,6 +27,11 @@ export async function loadWindowInfo(): Promise { const currentWindow = winData[0] let uniqWinId = winData[1] as string | undefined + // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1660564 + if (currentWindow.type !== 'normal') { + throw 'This code should not be launched in a window with a type other than "normal"' + } + // Generate unique window id if (!uniqWinId) { uniqWinId = Utils.uid() diff --git a/src/sidebar/sidebar.ts b/src/sidebar/sidebar.ts index b019d935..e460d740 100644 --- a/src/sidebar/sidebar.ts +++ b/src/sidebar/sidebar.ts @@ -27,10 +27,6 @@ import { Snapshots } from 'src/services/snapshots' import { updateWebReqHandlers } from 'src/services/web-req.fg' import { initUpgrading, showUpgradingScreen } from 'src/services/upgrading' -if (document.body.offsetHeight === 0 && document.body.offsetWidth === 0) { - throw 'Sidebar: Not enough space: 0px / 0px' -} - async function main(): Promise { Info.setInstanceType(InstanceType.sidebar) IPC.setInstanceType(InstanceType.sidebar)