Browse Source

fix: popup may run before browser resized it

tophf 1 year ago
parent
commit
f2df8ee910
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/popup/index.js

+ 1 - 1
src/popup/index.js

@@ -86,7 +86,7 @@ async function setPopup(data, { [kFrameId]: frameId, url }) {
   }
   if (isTop) mutexResolve(); // resolving at the end after all `await` above are settled
   if (!hPrev) {
-    hPrev = innerHeight;
+    hPrev = Math.max(innerHeight, 100); // ignore the not-yet-resized popup e.g. in Firefox
     window.onresize = onResize;
     // Mobile browsers show the popup maximized to the entire screen, no resizing
     if (isTouch && hPrev > document.body.clientHeight) onResize();