|
|
@@ -62,6 +62,7 @@ singlefile.download = (() => {
|
|
|
return await downloadPage(message, { confirmFilename: message.confirmFilename, incognito: tab.incognito, filenameConflictAction: message.filenameConflictAction });
|
|
|
} catch (error) {
|
|
|
console.error(error); // eslint-disable-line no-console
|
|
|
+ URL.revokeObjectURL(message.url);
|
|
|
singlefile.ui.onError(sender.tab.id, {});
|
|
|
return {};
|
|
|
}
|
|
|
@@ -99,6 +100,7 @@ singlefile.download = (() => {
|
|
|
} else if (errorMessage == "conflictaction prompt not yet implemented" && options.filenameConflictAction) {
|
|
|
return downloadPage(page, { confirmFilename: options.confirmFilename });
|
|
|
} else if (errorMessage.includes("canceled")) {
|
|
|
+ URL.revokeObjectURL(page.url);
|
|
|
return {};
|
|
|
} else {
|
|
|
throw error;
|
|
|
@@ -118,8 +120,8 @@ singlefile.download = (() => {
|
|
|
browser.downloads.onChanged.removeListener(onChanged);
|
|
|
}
|
|
|
if (event.state.current == "interrupted") {
|
|
|
- URL.revokeObjectURL(page.url);
|
|
|
if (event.error && event.error.current == "USER_CANCELED") {
|
|
|
+ URL.revokeObjectURL(page.url);
|
|
|
resolve({});
|
|
|
} else {
|
|
|
reject(new Error(event.state.current));
|