Przeglądaj źródła

refactored htmlImports function

Gildas 7 lat temu
rodzic
commit
464ae1400a
1 zmienionych plików z 4 dodań i 13 usunięć
  1. 4 13
      lib/single-file/single-file-core.js

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

@@ -497,19 +497,10 @@ const SingleFileCore = (() => {
 			await Promise.all(linkElements.map(async linkElement => {
 				if (initialization) {
 					const resourceURL = linkElement.href;
-					const options = {
-						insertSingleFileComment: false,
-						insertFaviconLink: false,
-						url: resourceURL,
-						removeHiddenElements: this.options.removeHiddenElements,
-						removeUnusedCSSRules: this.options.removeUnusedCSSRules,
-						jsEnabled: this.options.jsEnabled,
-						removeScripts: this.options.removeScripts,
-						saveRawPage: this.options.saveRawPage,
-						compress: this.options.compress,
-						lazyLoadImages: this.options.lazyLoadImages,
-						framesData: this.options.framesData
-					};
+					const options = Object.create(this.options);
+					options.insertSingleFileComment = false;
+					options.insertFaviconLink = false;
+					options.url = resourceURL;
 					if (resourceURL) {
 						if (resourceURL && resourceURL != this.baseURI && DomUtil.testValidPath(resourceURL)) {
 							const processor = new PageProcessor(options);