nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

nwjs ignored saveas options and always popup a saveas dialog when download file use chrome.downloads api

Open tiegeda opened this issue 8 years ago • 2 comments

I'm trying to implement a feature that Automatically start a download task use chrome.downloads api in nwjs. The code is:

var url = "http://wdl1.cache.wps.cn/wps/download/W.P.S.6135.19.552.exe"; chrome.downloads.download({"url": url, "saveAs": false}, function(id){ console.log(id); });

But when I start it, a saveas dialog always popup whether the saveAs option is true or false. I want to start download automatically, no need user to choose where to save.

I also run this code in chorme extensions, if you uncheck chrome "Ask where to save each file before downloading" options in Settings->Show advanced settings->"Downloads" section, the saveas dialog will popup when saveAs is true and not popup when saveAs is false as expect. If the option is checked, the behavior is the same as nwjs that always popup a saveas dialog whether the saveAs args is true or false.

So I wonder if there any way to start a download without popup a saveas dialog use chrome.downloads api in nwjs? like a setting "Ask where to save" in chrome

The version I use is nwjs 0.14.7 at windows 10

tiegeda avatar Dec 30 '16 02:12 tiegeda

I have the same problem: When using ... chrome.downloads.download({url:"https://...", saveAs: false}); ... nw.js always opens the file dialog. But it should save the file automatically to the downloads folder (as the normal Chrome does).

So this problem still exists in nw.js 0.66.1

Swift42 avatar Aug 02 '22 17:08 Swift42