Przeglądaj źródła

moved singlefile.lib.getClass into singlefile.lib.SingleFile

Gildas 6 lat temu
rodzic
commit
4ad5b6c534

+ 1 - 1
cli/back-ends/puppeteer.js

@@ -112,7 +112,7 @@ exports.getPageData = async options => {
 			[options.framesData] = await Promise.all(preInitializationPromises);
 			options.doc = document;
 			options.win = window;
-			const SingleFile = singlefile.lib.getClass();
+			const SingleFile = singlefile.lib.SingleFile.getClass();
 			const singleFile = new SingleFile(options);
 			await singleFile.run();
 			return await singleFile.getPageData();

+ 1 - 1
cli/back-ends/webdriver-chromium.js

@@ -174,7 +174,7 @@ function getPageDataScript() {
 		[options.framesData] = await Promise.all(preInitializationPromises);
 		options.doc = document;
 		options.win = window;
-		const SingleFile = singlefile.lib.getClass();
+		const SingleFile = singlefile.lib.SingleFile.getClass();
 		const singleFile = new SingleFile(options);
 		await singleFile.run();
 		return await singleFile.getPageData();

+ 1 - 1
cli/back-ends/webdriver-gecko.js

@@ -181,7 +181,7 @@ function getPageDataScript() {
 		[options.framesData] = await Promise.all(preInitializationPromises);
 		options.doc = document;
 		options.win = window;
-		const SingleFile = singlefile.lib.getClass();
+		const SingleFile = singlefile.lib.SingleFile.getClass();
 		const singleFile = new SingleFile(options);
 		await singleFile.run();
 		return await singleFile.getPageData();

+ 1 - 1
extension/core/bg/autosave.js

@@ -120,7 +120,7 @@ singlefile.extension.core.bg.autosave = (() => {
 				singlefile.extension.ui.bg.main.onEnd(tabId, { autoSave: true });
 			}
 		};
-		const processor = new (singlefile.lib.getClass())(options);
+		const processor = new (singlefile.lib.SingleFile.getClass())(options);
 		await processor.run();
 		const page = await processor.getPageData();
 		page.url = URL.createObjectURL(new Blob([page.content], { type: "text/html" }));

+ 1 - 1
extension/core/content/content-main.js

@@ -31,7 +31,7 @@ this.singlefile.extension.core.content.main = this.singlefile.extension.core.con
 
 	const MAX_CONTENT_SIZE = 64 * (1024 * 1024);
 	const DOWNLOADER_FRAME_ID = "single-file-downloader";
-	const SingleFile = singlefile.lib.getClass();
+	const SingleFile = singlefile.lib.SingleFile.getClass();
 
 	let processing = false;
 

+ 1 - 1
extension/ui/content/content-ui-main.js

@@ -25,7 +25,7 @@
 
 this.singlefile.extension.ui.content.main = this.singlefile.extension.ui.content.main || (() => {
 
-	const SingleFile = this.singlefile.lib.getClass();
+	const SingleFile = this.singlefile.lib.SingleFile.getClass();
 
 	const MASK_TAGNAME = "singlefile-mask";
 	const PROGRESS_BAR_TAGNAME = "singlefile-progress-bar";

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

@@ -31,7 +31,7 @@
 	TextDecoder,
 	TextEncoder */
 
-this.singlefile.lib.getClass = this.singlefile.lib.getClass || (() => {
+this.singlefile.lib.SingleFile = this.singlefile.lib.SingleFile || (() => {
 
 	const singlefile = this.singlefile;
 
@@ -57,7 +57,9 @@ this.singlefile.lib.getClass = this.singlefile.lib.getClass || (() => {
 	};
 	const SingleFile = singlefile.lib.core.getClass(singlefile.lib.util.getInstance(modules, util), singlefile.lib.vendor.cssTree);
 	const fetchResource = (singlefile.lib.fetch.content.resources && singlefile.lib.fetch.content.resources.fetch) || fetch;
-	return () => SingleFile;
+	return {
+		getClass: () => SingleFile
+	};
 
 	async function getResourceContent(resourceURL) {
 		const resourceContent = await fetchResource(resourceURL);

+ 1 - 1
maff2html/back-ends/webdriver-gecko.js

@@ -161,7 +161,7 @@ function getPageDataScript() {
 		[options.framesData] = await Promise.all(preInitializationPromises);
 		options.doc = document;
 		options.win = window;
-		const SingleFile = singlefile.lib.getClass();
+		const SingleFile = singlefile.lib.SingleFile.getClass();
 		const singleFile = new SingleFile(options);
 		await singleFile.run();
 		return await singleFile.getPageData();