i use below codes :
download(BrowserWindow.getFocusedWindow(), url ,{saveAs:true,openFolderWhenDone:true,onProgress:function(pr){
//console.log(pr+" - ");
}})
.then(dl => console.log(dl.getSavePath()))
.catch(console.error);
but i get this error in consol :
E:\nodejs\bireport\node_modules\electron-dl\index.js:37 Uncaught TypeError: Cannot read property 'fromWebContents' of undefined
at listener (E:\nodejs\bireport\node_modules\electron-dl\index.js:37)
at CallbacksRegistry.apply (E:\nodejs\bireport\node_modules\electron\dist\resources\electron.asar\common\api\callbacks-registry…:48)
at EventEmitter. (E:\nodejs\bireport\node_modules\electron\dist\resources\electron.asar\renderer\api\remote.js:283)
at emitThree (events.js:116)
at EventEmitter.emit (events.js:194)
listener @ E:\nodejs\bireport\node_modules\electron-dl\index.js:37
apply @ E:\nodejs\bireport\node_modules\electron\dist\resources\electron.asar\common\api\callbacks-registry…:48
(anonymous) @ E:\nodejs\bireport\node_modules\electron\dist\resources\electron.asar\renderer\api\remote.js:283
emitThree @ events.js:116
emit @ events.js:194
how can i fix it ?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too