Chrome can only handle HREF with a length of about 2 million characters (or less).
You want to add output to Blob , and then create ObjectURL on this blob using URL.createObjectURL( MDN ) and attach this to the href attribute of the binding.
An example could be:
var csvContent = "";
data.forEach(function (infoArray, index) {
dataString = infoArray.join(",");
csvContent += dataString + "\n";
});
var blobdata = new Blob([csvContent],{type : 'text/csv'});
var link = document.createElement("a");
link.setAttribute("href", window.URL.createObjectURL(blobdata));
link.setAttribute("download", "Data.csv");
document.body.appendChild(link);
link.click();