Skip to content

Commit 911469e

Browse files
committed
Fixed soft reload messing with non UTF-8 encodings (thanks "Quest" for reporting).
1 parent 486da3b commit 911469e

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/content/syncFetchPolicy.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
let softReload = ev => {
4343
try {
44-
//let html = document.documentElement.outerHTML;
4544
debug("Soft reload", ev); // DEV_ONLY
4645
try {
4746
let doc = window.wrappedJSObject.document;
@@ -52,15 +51,13 @@
5251
if (isDir || document.contentType !== "text/html") {
5352
throw new Error(`Can't document.write() on ${isDir ? "directory listings" : document.contentType}`)
5453
}
54+
DocumentFreezer.unfreeze();
55+
let html = document.documentElement.outerHTML;
5556
doc.open();
5657
console.debug("Opened", doc.documentElement);
57-
DocumentFreezer.unfreeze();
58-
(async () => {
59-
let html = await ((await fetch(document.URL)).text());
60-
doc.write(html);
61-
doc.close();
62-
debug("Written", html)
63-
})();
58+
doc.write(html);
59+
doc.close();
60+
debug("Written", html);
6461
} catch (e) {
6562
debug("Can't use document.write(), XML document?", e);
6663
try {

0 commit comments

Comments
 (0)