From 7d335ed7879f0b540ec1fe19c3f7832139298b2a Mon Sep 17 00:00:00 2001 From: hackademix Date: Sun, 21 May 2023 21:33:23 +0200 Subject: [PATCH] Avoid unnecessary prompt resizing. --- src/ui/Prompts.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ui/Prompts.js b/src/ui/Prompts.js index 08ee1d4..d32efa0 100644 --- a/src/ui/Prompts.js +++ b/src/ui/Prompts.js @@ -70,11 +70,15 @@ var Prompts = (() => { if (width && height && (popupWidth !== width || popupHeight !== height)) { left += Math.round((popupWidth - width) / 2); top += Math.round((popupHeight - height) / 2); - } - - for (let attempts = 2; attempts-- > 0;) // position gets set only 2nd time, moz bug? await browser.windows.update(popup.id, {left, top, width, height, focused: false}); + } + + for (let attempts = 2; attempts-- > 0;) { + // position gets set only 2nd time, moz bug? + await browser.windows.update(popup.id, + {left, top, focused: false}); + } if (parent) { await browser.windows.update(parent.id, {focused: true}); }