Node.js + Nativefier应用程序不会下载文件

这真的开始,但我。

我使用nativefire从Web应用程序创build桌面应用程序,而我似乎无法实现的一件事是允许文件下载。

我有一个脚本,将表转换成excel文件和备份function,都应该下载文件,在浏览器中很好地工作,但创build桌面应用程序后,没有任何反应后点击button。

有没有人find一种方法来实现这一目标?

  • 本地化版本:v7.0.1
  • Node.js版本:v6.9.1
  • 操作系统:Windows 7
  • build筑64

在nativefier生成的应用程序,但在浏览器中不工作的JS代码:

function fnExcelReport() { var tab_text="<table border='1px'><tr bgcolor='#ebebeb'>"; var textRange; var j=0; tab = document.getElementById('Export'); for(j = 0 ; j < tab.rows.length ; j++) { tab_text=tab_text+tab.rows[j].innerHTML+"</tr>"; } tab_text=tab_text+"</table>"; tab_text= tab_text.replace(/<a[^>]*>|<\/a>/g, ""); tab_text= tab_text.replace(/<img[^>]*>/gi,""); tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { txtArea1.document.open("txt/html","replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); sa=txtArea1.document.execCommand("SaveAs",true,"Say Thanks to Sumit.xls"); } else sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); return (sa); }