sindresorhus/electron-dl

Utilizing session.enableNetworkEmulation with ElectronDL

Opened this issue · 1 comments

How could you use the enableNetworkEmulation call with electronDL? I have been trying for a few days and there seems to be no changes in the speed.

calling this

const throttle = '5'; //Bps
    browserWindow.webContents.session.enableNetworkEmulation({
      downloadThroughput: parseInt(throttle),    
    });

before

  const res = await download(browserWindow, info.url, {
        directory: appPath + '/packages',
        onProgress: progressHandler
      });

EDIT:
Just found this.
electron/electron#21250
If anyone has any other thoughts please leave them, otherwise this seems borked from the start

My package has the ability to throttle file transfers and fixes a lot of issues mentioned in the electron-dl issue tickets:

https://github.com/theogravity/electron-dl-manager