Selaa lähdekoodia

fixed favicon displaying issue when present in the body tag

Gildas 7 vuotta sitten
vanhempi
sitoutus
2f2f074cb3
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      lib/single-file/single-file-core.js

+ 2 - 2
lib/single-file/single-file-core.js

@@ -379,14 +379,14 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		}
 
 		insertFaviconLink() {
-			let faviconElement = this.doc.querySelectorAll("link[href][rel*=\"icon\"]")[0];
+			let faviconElement = this.doc.querySelector("link[href][rel*=\"icon\"]");
 			if (!faviconElement) {
 				faviconElement = this.doc.createElement("link");
 				faviconElement.setAttribute("type", "image/x-icon");
 				faviconElement.setAttribute("rel", "shortcut icon");
 				faviconElement.setAttribute("href", "/favicon.ico");
-				this.doc.head.appendChild(faviconElement);
 			}
+			this.doc.head.appendChild(faviconElement);
 		}
 
 		resolveHrefs() {