window type may be 'app'

This commit is contained in:
tophf 2022-06-04 18:02:41 +03:00
parent 2e1961bdf7
commit a77996df60

View File

@ -236,7 +236,8 @@ function EditorHeader() {
async function initWindowedMode() { async function initWindowedMode() {
chrome.tabs.onAttached.addListener(onTabAttached); chrome.tabs.onAttached.addListener(onTabAttached);
const isSimple = (await browser.windows.getCurrent()).type === 'popup'; // Chrome 96+ bug: the type is 'app' for a window that was restored via Ctrl-Shift-T
const isSimple = ['app', 'popup'].includes((await browser.windows.getCurrent()).type);
if (isSimple) require(['/edit/embedded-popup']); if (isSimple) require(['/edit/embedded-popup']);
editor.isWindowed = isSimple || ( editor.isWindowed = isSimple || (
history.length === 1 && history.length === 1 &&