Procházet zdrojové kódy

added "retrieveLinks" options

Gildas před 5 roky
rodič
revize
a2f3bb3d34
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      lib/single-file/single-file-core.js

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

@@ -511,6 +511,9 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 			if (this.options.addProof) {
 				pageData.hash = await util.digest("SHA-256", content);
 			}
+			if (this.options.retrieveLinks) {
+				pageData.links = Array.from(new Set(Array.from(this.doc.links).map(linkElement => linkElement.href)));
+			}
 			return pageData;
 		}