Reputation: 111
Is it possible using Javascript and Html to open a Save As Dialog from a chrome extension on a Windows OS machine?
I have tried the following without luck:
Please let me know if there are any other ways to get around this. Any help would be appreciated. Thanks!
Upvotes: 4
Views: 2718
Reputation: 111
To force the Save Dialog from a chrome extension, use chrome extension's download api and set the saveAs options flag to true. Something like this:
chrome.downloads.download({
url: window.location.href + '/' + fileName,
filename: fileName,
saveAs: true
}, function (downloadId) {
console.log(downloadId);
});
Upvotes: 5