0

I allow the user to download a .json file using:

function downloadObjectAsJson(exportObj, exportName){
  var dataStr = "data:text/json;charset=utf-8," + 
  encodeURIComponent(JSON.stringify(exportObj));
  var downloadAnchorNode = document.createElement('a');
  downloadAnchorNode.setAttribute("href", dataStr);
  downloadAnchorNode.setAttribute("download", exportName + ".ipynb");
  downloadAnchorNode.click();
  downloadAnchorNode.remove();
}

This works perfectly in Safari, but in Chrome I get the following popup message:

There is no application set to open the document

Cybernetic
  • 11,188
  • 15
  • 76
  • 114

0 Answers0