Przeglądaj źródła

move head tags found in body

Gildas 7 lat temu
rodzic
commit
f95432cd8a
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      lib/single-file/single-file-core.js

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

@@ -73,7 +73,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 	// -------------
 	const STAGES = [{
 		sequential: [
-			{ action: "removeUIElements" },
+			{ action: "repairDocument" },
 			{ action: "replaceStyleContents" },
 			{ option: "removeVideoSrc", action: "insertVideoPosters" },
 			{ option: "removeSrcSet", action: "removeSrcSet" },
@@ -423,8 +423,9 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			}
 		}
 
-		removeUIElements() {
+		repairDocument() {
 			this.doc.querySelectorAll("singlefile-infobar, singlefile-mask").forEach(element => element.remove());
+			this.doc.body.querySelectorAll("title, meta, link").forEach(element => this.doc.head.appendChild(element));
 		}
 
 		removeScripts() {