Fixed rendering bug with scrolled file:// pages on soft reload (thanks Iouri for report).

This commit is contained in:
hackademix 2020-09-16 22:21:13 +02:00
parent a5e0b72252
commit aded3b2ce4
1 changed files with 4 additions and 0 deletions

View File

@ -53,11 +53,15 @@
}
DocumentFreezer.unfreeze();
let html = document.documentElement.outerHTML;
let sx = window.scrollX, sy = window.scrollY;
doc.open();
console.debug("Opened", doc.documentElement);
doc.write(html);
doc.close();
debug("Written", html);
// Work-around this rendering bug: https://forums.informaction.com/viewtopic.php?p=103105#p103050
debug("Scrolling back to", sx, sy);
window.scrollTo(sx, sy);
} catch (e) {
debug("Can't use document.write(), XML document?", e);
try {