more info on closing chromium

This commit is contained in:
Kyle McNally 2024-04-03 13:07:27 -04:00
parent 0f12e5f2d7
commit 4ce60bdd4d
1 changed files with 8 additions and 0 deletions

View File

@ -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