Fixed soft reload messing with non UTF-8 encodings (thanks "Quest" for reporting).
This commit is contained in:
parent
486da3bb0b
commit
911469eb27
|
@ -41,7 +41,6 @@
|
||||||
|
|
||||||
let softReload = ev => {
|
let softReload = ev => {
|
||||||
try {
|
try {
|
||||||
//let html = document.documentElement.outerHTML;
|
|
||||||
debug("Soft reload", ev); // DEV_ONLY
|
debug("Soft reload", ev); // DEV_ONLY
|
||||||
try {
|
try {
|
||||||
let doc = window.wrappedJSObject.document;
|
let doc = window.wrappedJSObject.document;
|
||||||
|
@ -52,15 +51,13 @@
|
||||||
if (isDir || document.contentType !== "text/html") {
|
if (isDir || document.contentType !== "text/html") {
|
||||||
throw new Error(`Can't document.write() on ${isDir ? "directory listings" : document.contentType}`)
|
throw new Error(`Can't document.write() on ${isDir ? "directory listings" : document.contentType}`)
|
||||||
}
|
}
|
||||||
|
DocumentFreezer.unfreeze();
|
||||||
|
let html = document.documentElement.outerHTML;
|
||||||
doc.open();
|
doc.open();
|
||||||
console.debug("Opened", doc.documentElement);
|
console.debug("Opened", doc.documentElement);
|
||||||
DocumentFreezer.unfreeze();
|
doc.write(html);
|
||||||
(async () => {
|
doc.close();
|
||||||
let html = await ((await fetch(document.URL)).text());
|
debug("Written", html);
|
||||||
doc.write(html);
|
|
||||||
doc.close();
|
|
||||||
debug("Written", html)
|
|
||||||
})();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debug("Can't use document.write(), XML document?", e);
|
debug("Can't use document.write(), XML document?", e);
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue