Kaynağa Gözat

merge SFZ code

Gildas 2 yıl önce
ebeveyn
işleme
49536c1e8b

+ 5 - 1
src/core/content/content-bootstrap.js

@@ -45,7 +45,11 @@ browser.runtime.sendMessage({ method: "bootstrap.init" }).then(message => {
 			openEditor(document);
 		}
 	} else {
-		refresh();
+		if (document.readyState == "loading") {
+			document.addEventListener("DOMContentLoaded", refresh);
+		} else {
+			refresh();
+		}
 	}
 });
 browser.runtime.onMessage.addListener(message => {

+ 1 - 1
src/lib/single-file/core/content/content-hooks-frames-extension-injection.js

@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2022 Gildas Lormeau
+ * Copyright 2010-2020 Gildas Lormeau
  * contact : gildas.lormeau <at> gmail.com
  * 
  * This file is part of SingleFile.

+ 2 - 2
src/lib/single-file/core/content/content-hooks-frames-inline-injection.js

@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2022 Gildas Lormeau
+ * Copyright 2010-2020 Gildas Lormeau
  * contact : gildas.lormeau <at> gmail.com
  * 
  * This file is part of SingleFile.
@@ -78,8 +78,8 @@ function injectedScript() {
 			getDetailObject(...arguments).then(detail => dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail })));
 			return new FontFace(...arguments);
 		};
-		globalThis.FontFace.toString = function () { return "function FontFace() { [native code] }"; };
 		globalThis.FontFace.prototype = FontFace.prototype;
+		globalThis.FontFace.toString = function () { return "function FontFace() { [native code] }"; };
 		const deleteFont = document.fonts.delete;
 		document.fonts.delete = function (fontFace) {
 			getDetailObject(fontFace.family).then(detail => dispatchEvent(new CustomEvent(DELETE_FONT_EVENT, { detail })));