Skip to content

Commit

Permalink
Add Base.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Battis committed Dec 29, 2024
1 parent 6e7e9f8 commit e66ac2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/datadirect-puppeteer/src/PuppeteerSession/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,12 @@ export class Base extends EventEmitter {
init
);
}

public async close() {
if (this.page.browser().pages.length === 1) {
await this.page.browser().close();
} else {
await this.page.close();
}
}
}

0 comments on commit e66ac2e

Please sign in to comment.