It really starts, but me.
I use nativefire to create a desktop application from a web application, and one thing that I can't seem to do is allow file downloads.
I have a script that turns a table into an excel file, as well as a backup function, and both should load files that work fine in the browser, but nothing happens after creating the desktop after clicking the buttons.
Has anyone found a way to achieve this?
- Nativefier Version: v7.0.1
- Node.js Version: v6.9.1
- OS: Windows 7
- Architecture 64
JS code that does not work in a nativefier-generated application but works in a browser:
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); }
source share