Skip to content

Commit 0eba7d4

Browse files
Manually merged Export fix
Fix from mrdoob#29
1 parent 83125bf commit 0eba7d4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

editor/js/Menubar.File.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ Menubar.File = function ( editor ) {
7878
function Export () {
7979

8080
var output = JSON.stringify( editor.toJSON(), null, '\t' );
81-
82-
var blob = new Blob( [ output ], { type: 'text/plain' } );
83-
var objectURL = URL.createObjectURL( blob );
84-
85-
window.open( objectURL, '_blank' );
86-
window.focus();
81+
var filename = 'framejs.json';
82+
var contentType = 'application/octet-stream';
83+
var a = document.createElement('a');
84+
var blob = new Blob([output], {'type':contentType});
85+
a.href = window.URL.createObjectURL(blob);
86+
a.download = filename;
87+
a.click();
8788

8889
}
8990

0 commit comments

Comments
 (0)