Gildas 7 anni fa
parent
commit
939baf0c07
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      lib/single-file/single-file-core.js

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

@@ -18,7 +18,7 @@
  *   along with SingleFile.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* global CSSRule, HTMLElement */
+/* global CSSRule */
 
 this.SingleFileCore = this.SingleFileCore || (() => {
 
@@ -432,7 +432,9 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 
 		preProcessPage() {
 			this.doc.querySelectorAll("singlefile-infobar, singlefile-mask").forEach(element => element.remove());
-			this.doc.body.querySelectorAll(":not(svg) title, meta").forEach(element => element instanceof HTMLElement && this.doc.head.appendChild(element));
+			if (this.options.win) {
+				this.doc.body.querySelectorAll(":not(svg) title, meta").forEach(element => element instanceof this.options.win.HTMLElement && this.doc.head.appendChild(element));
+			}
 			if (this.options.imageData) {
 				const dataAttributeName = DOM.imagesAttributeName(this.options.sessionId);
 				this.doc.querySelectorAll("img").forEach(imgElement => {