Skip to content

Commit

Permalink
Proper cleanup of url and link element in saveBlob
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed May 28, 2024
1 parent d26a511 commit f7d37d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/editor/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();
}

export function areVectorsEqual(v1, v2) {
Expand Down

0 comments on commit f7d37d3

Please sign in to comment.