increase download waiting

This commit is contained in:
Simon Knott 2025-06-11 15:32:04 +02:00
parent 6c98594b7a
commit 43d4d6f0bb

View File

@ -83,11 +83,10 @@ export class Tab {
|| e.message.includes('Download is starting'); // firefox + webkit
if (!mightBeDownload)
throw e;
// on chromium, the download event is fired *after* page.goto rejects, so we wait a lil bit
const download = await Promise.race([
downloadEvent,
new Promise(resolve => setTimeout(resolve, 500)),
new Promise(resolve => setTimeout(resolve, process.platform === 'win32' ? 1000 : 500)),
]);
if (!download)
throw e;