diff --git a/src/popup.ts b/src/popup.ts index 3cc0b1ba2..50df55cf6 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -109,6 +109,10 @@ async function init() { } }); + if (ui.instance.isPopup()) { + ui.instance.fixPopupSize(); + } + return; } diff --git a/src/ui/menu.ts b/src/ui/menu.ts index 8439cbcf1..f9bccefe1 100644 --- a/src/ui/menu.ts +++ b/src/ui/menu.ts @@ -145,6 +145,18 @@ async function menu(_ui: UI) { new URLSearchParams(document.location.search.substring(1)); return params.get('popup'); }, + fixPopupSize: () => { + const zoom = Number(localStorage.zoom) / 100 || 1; + const correctHeight = 480 * zoom; + const correctWidth = 320 * zoom; + if (window.innerHeight !== correctHeight || + window.innerWidth !== correctWidth) { + chrome.windows.getCurrent((currentWindow) => { + chrome.windows.update( + currentWindow.id, {height: correctHeight, width: correctWidth}); + }); + } + }, dropboxUpload: async () => { const dbox = new Dropbox(); const response = await dbox.upload(_ui.instance.encryption);