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

Download start even Save as not appear #170

Open
rtritto opened this issue Jul 7, 2024 · 0 comments
Open

Download start even Save as not appear #170

rtritto opened this issue Jul 7, 2024 · 0 comments

Comments

@rtritto
Copy link

rtritto commented Jul 7, 2024

After I trigger download channel, I get the onProgress.progress log before the Save as popup appears.

ipcMain.on('download', async (event: Electron.IpcMainInvokeEvent, downloadUrl: string) => {
  const win = BrowserWindow.getFocusedWindow()!
  try {
    await download(win, downloadUrl, {
      saveAs: true,
      onProgress: (progress) => {
        console.log('onProgress.progress: ', progress);
        mainWindow.webContents.send('download-progress', progress)
      },
      onCompleted: (item) => {
        mainWindow.webContents.send('download-completed', item)
      }
    })
  } catch (error) {
    if (error instanceof CancelError) {
      console.info('item.cancel() was called')
    } else {
      console.error(error)
    }
  }
})

Additional informations:

  • OS: Windows 11
  • electron v31.1.0, electron-dl v4.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant