Gildas hace 7 años
padre
commit
cd5ec38088

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

@@ -63,7 +63,7 @@ singlefile.processor = (() => {
 		};
 		const processor = new (SingleFile.getClass())(options);
 		await processor.initialize();
-		await processor.preparePageData();
+		await processor.run();
 		const page = await processor.getPageData();
 		page.url = URL.createObjectURL(new Blob([page.content], { type: "text/html" }));
 		return singlefile.download.downloadPage(page, options);

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

@@ -113,7 +113,7 @@ this.singlefile.top = this.singlefile.top || (() => {
 		};
 		[options.framesData] = await Promise.all(preInitializationPromises);
 		await processor.initialize();
-		await processor.preparePageData();
+		await processor.run();
 		const page = await processor.getPageData();
 		if (options.selected) {
 			unmarkSelectedContent();

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

@@ -46,8 +46,8 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			await this.processor.loadPage();
 			await this.processor.initialize();
 		}
-		async preparePageData() {
-			await this.processor.preparePageData();
+		async run() {
+			await this.processor.run();
 		}
 		async getPageData() {
 			return this.processor.getPageData();
@@ -173,7 +173,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			}
 		}
 
-		async preparePageData() {
+		async run() {
 			if (!this.options.windowId) {
 				this.processor.initialize(this.batchRequest);
 				this.onprogress(new ProgressEvent(RESOURCES_INITIALIZED, { pageURL: this.options.url, index: 0, max: this.processor.maxResources }));
@@ -772,7 +772,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 						if (frameData) {
 							if (frameData.processor) {
 								this.stats.add("processed", "frames", 1);
-								await frameData.processor.preparePageData();
+								await frameData.processor.run();
 								const pageData = await frameData.processor.getPageData();
 								frameElement.removeAttribute(DOM.windowIdAttributeName(this.options.sessionId));
 								if (pageData.content.match(NOSCRIPT_TAG_FOUND) || pageData.content.match(SCRIPT_TAG_FOUND)) {