Преглед изворни кода

add the canonical URL only if the page is served from the web (cf #411)

Former-commit-id: 57ff9801a46520daa632336e3fdd1db4496cecd4
Gildas пре 5 година
родитељ
комит
5c72f0d486
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -465,7 +465,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 					(infobarContent ? " \n info: " + infobarContent : "") + "\n");
 				this.doc.documentElement.insertBefore(commentNode, this.doc.documentElement.firstChild);
 			}
-			if (this.options.insertCanonicalLink) {
+			if (this.options.insertCanonicalLink && this.options.saveUrl.match(HTTP_URI_PREFIX)) {
 				let canonicalLink = this.doc.querySelector("link[rel=canonical]");
 				if (!canonicalLink) {
 					canonicalLink = this.doc.createElement("link");