diff --git a/src/tab.ts b/src/tab.ts index 5d4e93a..f5f0c9e 100644 --- a/src/tab.ts +++ b/src/tab.ts @@ -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;