Fixed deferred scripts in file:// pages may run twice (issue #155).
This commit is contained in:
parent
ca2a1b5a07
commit
16dfcd8c6f
|
@ -51,7 +51,9 @@
|
|||
if (isDir || document.contentType !== "text/html") {
|
||||
throw new Error(`Can't document.write() on ${isDir ? "directory listings" : document.contentType}`)
|
||||
}
|
||||
|
||||
DocumentFreezer.unfreeze();
|
||||
|
||||
let html = document.documentElement.outerHTML;
|
||||
let sx = window.scrollX, sy = window.scrollY;
|
||||
doc.open();
|
||||
|
@ -133,11 +135,11 @@
|
|||
}
|
||||
};
|
||||
|
||||
if (readyState === "loading") {
|
||||
if (DocumentFreezer.firedDOMContentLoaded) {
|
||||
softReload();
|
||||
} else {
|
||||
debug("Deferring softReload to DOMContentLoaded...");
|
||||
addEventListener("DOMContentLoaded", softReload, true);
|
||||
} else {
|
||||
softReload();
|
||||
}
|
||||
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue