From 4ce60bdd4dd10b6b0c9f27b64dc658cd98999009 Mon Sep 17 00:00:00 2001 From: Kyle McNally Date: Wed, 3 Apr 2024 13:07:27 -0400 Subject: [PATCH] more info on closing chromium --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index a1aeaf8..a5af33f 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,14 @@ for (const page of await browser.pages()) { await browser.close(); ``` +You can also try the following if one of the calls is hanging for some reason. + +```typescript +await Promise.race([browser.close(), browser.close(), browser.close()]); +``` + +Always `await browser.close()`, even if your script is returning an error. + ### I need Accessible pdf files This is due to the way @sparticuz/chromium is built. If you require accessible pdf's, you'll need to