diff --git a/src/client/lazy-app/Compress/index.tsx b/src/client/lazy-app/Compress/index.tsx index b34755699..77fa1011e 100644 --- a/src/client/lazy-app/Compress/index.tsx +++ b/src/client/lazy-app/Compress/index.tsx @@ -967,15 +967,16 @@ export default class Compress extends Component { return await Promise.allSettled(jobs); } - private downloadFromUrl(url: string) { - let a = document.createElement('a'); - a.setAttribute('href', url); - a.setAttribute('download', ''); - a.setAttribute('target', '_blank'); + private downloadFromUrl(url: string, fileName: string = 'download.zip') { + const a = document.createElement('a'); + a.href = url; + a.download = fileName; + a.target = '_blank'; + document.body.appendChild(a); a.click(); - a.remove(); + document.body.removeChild(a); + URL.revokeObjectURL(url); } - /** * Download all using settings from one of the two sides by * queuing each image in succession.