|
@@ -393,14 +393,14 @@ Menubar.File = function ( editor ) {
|
|
|
//
|
|
|
|
|
|
var link = document.createElement( 'a' );
|
|
|
- link.style.display = 'none';
|
|
|
- document.body.appendChild( link ); // Firefox workaround, see #6594
|
|
|
+ link.style.display = 'none';
|
|
|
+ var clickEvent = new MouseEvent('click');
|
|
|
|
|
|
function save( blob, filename ) {
|
|
|
|
|
|
link.href = URL.createObjectURL( blob );
|
|
|
link.download = filename || 'data.json';
|
|
|
- link.click();
|
|
|
+ link.dispatchEvent( clickEvent );
|
|
|
|
|
|
// URL.revokeObjectURL( url ); breaks Firefox...
|
|
|
|