Просмотр исходного кода

merged SingleFile#initialize and SingleFile#run

Gildas 7 лет назад
Родитель
Сommit
bce1a196ab

+ 0 - 1
cli/back-ends/jsdom.js

@@ -96,7 +96,6 @@ exports.getPageData = async options => {
 		options.doc = doc;
 		const SingleFile = getSingleFileClass(win);
 		const singleFile = new SingleFile(options);
-		await singleFile.initialize();
 		await singleFile.run();
 		return singleFile.getPageData();
 	} finally {

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

@@ -104,7 +104,6 @@ exports.getPageData = async options => {
 			options.win = window;
 			const SingleFile = SingleFileBrowser.getClass();
 			const singleFile = new SingleFile(options);
-			await singleFile.initialize();
 			await singleFile.run();
 			return await singleFile.getPageData();
 		}, options);

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

@@ -118,7 +118,6 @@ function getPageDataScript() {
 		options.win = window;
 		const SingleFile = SingleFileBrowser.getClass();
 		const singleFile = new SingleFile(options);
-		await singleFile.initialize();
 		await singleFile.run();
 		return await singleFile.getPageData();
 	}

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

@@ -112,7 +112,6 @@ singlefile.autosave = (() => {
 			}
 		};
 		const processor = new (SingleFileBrowser.getClass())(options);
-		await processor.initialize();
 		await processor.run();
 		const page = await processor.getPageData();
 		page.url = URL.createObjectURL(new Blob([page.content], { type: "text/html" }));

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

@@ -129,7 +129,6 @@ this.singlefile.top = this.singlefile.top || (() => {
 		[options.framesData] = await Promise.all(preInitializationPromises);
 		options.doc = document;
 		options.win = window;
-		await processor.initialize();
 		await processor.run();
 		if (options.confirmInfobarContent) {
 			options.infobarContent = singlefile.ui.prompt("Infobar content", options.infobarContent) || "";

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

@@ -42,12 +42,10 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 				sessionId++;
 			}
 		}
-		async initialize() {
+		async run() {
 			this.runner = new Runner(this.options, true);
 			await this.runner.loadPage();
 			await this.runner.initialize();
-		}
-		async run() {
 			await this.runner.run();
 		}
 		async getPageData() {