Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main process XHR requests are pending while downloading #45

Open
fabriziopoggi opened this issue Dec 1, 2019 · 2 comments
Open

Main process XHR requests are pending while downloading #45

fabriziopoggi opened this issue Dec 1, 2019 · 2 comments
Labels
needs more info info about the bug is not complete and can't be reproduceable

Comments

@fabriziopoggi
Copy link

I'm downloading big files from a renderer calling remote.require("electron-download-manager").download.
Everything works fine but all XHR requests made by the Main process after that the download has began remain in pending state until the dowload is completed.
Is there something I can do to allow the Main process to make requests and receive webservice results while downloading? Thanks

@danielnieto
Copy link
Owner

can you provide code to reproduce this?

@danielnieto danielnieto added the needs more info info about the bug is not complete and can't be reproduceable label Feb 13, 2020
@fabriziopoggi
Copy link
Author

Sure!

Renderer process:
ipcRenderer.send ('download', { url: uri , properties: {}, filename: path.basename (uri) });

Main process:
const DownloadManager = require ("electron-download-manager")

ipcMain.on ('download', (event, arg) => { const dlId = uuidv4 (); DownloadManager.download ( { url: arg.url, onProgress: (progress, item) => { mainWindow.webContents.send ("download_progress", progress, item, arg.url, dlId) } }, function (error, info) { if (error) { console.log ("Download error: " + error) return } //console.log ("DONE: " + info.url); mainWindow.webContents.send ("download_done", info.filePath, dlId) } ) mainWindow.webContents.send ("download_start", arg.filename, dlId); })

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info info about the bug is not complete and can't be reproduceable
Projects
None yet
Development

No branches or pull requests

2 participants