فهرست منبع

remove the infobar if present before proscessing the page

Gildas 7 سال پیش
والد
کامیت
0490381d40
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      lib/single-file/single-file-core.js

+ 5 - 0
lib/single-file/single-file-core.js

@@ -87,6 +87,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 
 
 		async initialize() {
 		async initialize() {
 			this.onprogress(new ProgressEvent(RESOURCES_INITIALIZING, { pageURL: this.options.url }));
 			this.onprogress(new ProgressEvent(RESOURCES_INITIALIZING, { pageURL: this.options.url }));
+			this.processor.removeInfoToolbar();
 			if (!this.options.jsEnabled || (this.options.saveRawPage && this.options.removeScripts)) {
 			if (!this.options.jsEnabled || (this.options.saveRawPage && this.options.removeScripts)) {
 				this.processor.insertNoscriptContents();
 				this.processor.insertNoscriptContents();
 			}
 			}
@@ -299,6 +300,10 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			this.doc.querySelectorAll("base").forEach(element => element.remove());
 			this.doc.querySelectorAll("base").forEach(element => element.remove());
 		}
 		}
 
 
+		removeInfoToolbar() {
+			this.doc.querySelectorAll("singlefile-infobar").forEach(element => element.remove());
+		}
+
 		removeScripts() {
 		removeScripts() {
 			this.doc.querySelectorAll("script:not([type=\"application/ld+json\"])").forEach(element => element.remove());
 			this.doc.querySelectorAll("script:not([type=\"application/ld+json\"])").forEach(element => element.remove());
 		}
 		}