From 43d4d6f0bb06a770800561a179bc88c5c28f9ee4 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 11 Jun 2025 15:32:04 +0200 Subject: [PATCH] increase download waiting --- src/tab.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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;