Explorar o código

move head tags found in body

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
f95432cd8a
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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() {