close all pages to avoid EPERM error on Windows 10 (#830)

This commit is contained in:
Alex Dehe Ng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent de320fa549
commit a8cc10e9b8

View File

@@ -139,6 +139,8 @@ function getCode() {
});
emitter.once('done', async (shouldReplay) => {
const pages = await browser.pages();
await Promise.all(pages.map((page) => page.close()));
await browser.close();
if (shouldReplay) {
await replay(url, shouldReplay === 'replayWithFakeURL');