Work-around for window position not always changing on first update() call.

This commit is contained in:
hackademix 2022-11-21 22:21:29 +01:00
parent 2731eeaa45
commit 9ba2ae0749
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
1 changed files with 7 additions and 5 deletions

View File

@ -136,11 +136,13 @@
}
let win = await browser.windows.getCurrent();
let delta = document.documentElement.offsetHeight - window.innerHeight;
await browser.windows.update(win.id, {
height: win.height + delta,
top: win.top - Math.round(delta / 2),
focused: false
});
for (let attempts = 2; attempts-- > 0;) {
await browser.windows.update(win.id, {
height: win.height + delta,
top: win.top - Math.round(delta / 2),
focused: false
});
}
await browser.windows.update(win.id, {focused: true});
}
if (document.readyState === "complete") {