Work-around for window position not always changing on first update() call.
This commit is contained in:
parent
2731eeaa45
commit
9ba2ae0749
|
@ -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") {
|
||||
|
|
Loading…
Reference in New Issue