Skip to content

Commit

Permalink
Proper cleanup of url and link element in saveBlob (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin authored Jun 7, 2024
1 parent 22c7357 commit 0b8b8d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ export function saveBlob(blob, filename) {
var link = document.createElement('a');
link.style.display = 'none';
document.body.appendChild(link);
link.href = URL.createObjectURL(blob);
const url = URL.createObjectURL(blob);
link.href = url;
link.download = filename || 'ascene.html';
link.click();
// URL.revokeObjectURL(url); breaks Firefox...
URL.revokeObjectURL(url);
link.remove();
}

// Compares 2 vector objects up to size 4
Expand Down

0 comments on commit 0b8b8d5

Please sign in to comment.