My main problem is dsnt working downloads on Safari. For now i'm using FileSaver.js. It's working on all browsers but on safari, file is opened in new tab instead of downloading it. File is creating by user, its JSON data.
var dataAsText = JSON.stringify(data); //Convert JSON to text
var blob = new Blob([dataAsText], {type: "text/plain"});
saveAs(blob, $("#menu-save-text").val()+".leds");
How to use AJAX and PHP to make safari downloading file instead of opening it?