Used signed URLs and ability to use session.on('will-download') event


I asked this as an issue on the repo and they closed it and didn’t really give me an answer (also didn’t seem to actually read my whole question), so no I give it to y’all.


var session = mainWindow.webContents.session;
session.on('will-download', function(event, item, webContents) {
         // event.preventDefault();
   item.on('updated', function() {
       console.log('Received bytes: ' + item.getReceivedBytes());
   console.log('play more Queen');
   item.on('done', function(e, state) {
       if (state == "completed") {
          console.log("Download successfully");
       } else {
          console.log("Download is cancelled or interrupted that can't be resumed");


dialog.showSaveDialog({ title: 'Output Downloader', defaultPath: '/' + testName },
                function (id) {
                    var fileStream = fs.createWriteStream(id, {defaultEncoding: 'binary'});
                    fileStream.on('open', function(fd) {
                        $http.get('' + testName)
                            .success(function(data, status, headers, config){
                            .error(function(data, status, headers, config){
                                console.log('product download failed');

The files are being downloaded, but the will-download event is not firing for us to get the progress.


Looks like the bug was reopened and answered.


So it has finally come to the attention that we can’t use requests and initiate the download ourselves. Now the question is, how do we go about being able to check credentials, get signed URLs, and still have access to the will-download event and the downloaditems?