Переглянути джерело

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