code: function makeDownload(url,fname){
              fname = fname === ""  ? "feta_output.js" : fname;
              //this code is from SO, but I'm missing the link right now
              var s = "var a = document.createElement('a');";
                  s+= "a.href = '"+url+"';";
                  s+= "a.download = '"+ fname +"';"; // set the file name
                  s+= "a.style.display = 'none';";
                  s+= "document.body.appendChild(a);";
                  s+= "a.click();"; //this is probably the key - simulatating a click on a download link
                  s+= "delete a;";// we don't need this anymore
              runInPage(s,doNothing);
          }
docs: create a link element and click it to download the file