Explorar el Código

fixed issue with downloads > MAX_CONTENT_SIZE (cf. #190)

Gildas hace 6 años
padre
commit
f655778f01
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      extension/core/content/content.js

+ 2 - 3
extension/core/content/content.js

@@ -172,8 +172,7 @@ this.singlefile.top = this.singlefile.top || (() => {
 
 	async function downloadPage(page, options) {
 		if (options.backgroundSave) {
-			let response;
-			for (let blockIndex = 0; !response && (blockIndex * MAX_CONTENT_SIZE < page.content.length); blockIndex++) {
+			for (let blockIndex = 0; blockIndex * MAX_CONTENT_SIZE < page.content.length; blockIndex++) {
 				const message = { method: "downloads.download", confirmFilename: options.confirmFilename, filenameConflictAction: options.filenameConflictAction, filename: page.filename, saveToClipboard: options.saveToClipboard };
 				message.truncated = page.content.length > MAX_CONTENT_SIZE;
 				if (message.truncated) {
@@ -182,7 +181,7 @@ this.singlefile.top = this.singlefile.top || (() => {
 				} else {
 					message.content = page.content;
 				}
-				response = await browser.runtime.sendMessage(message);
+				await browser.runtime.sendMessage(message);
 			}
 		} else {
 			if (options.saveToClipboard) {