diff --git a/ts/smartpdf.classes.smartpdf.ts b/ts/smartpdf.classes.smartpdf.ts index 967b74e..1310979 100644 --- a/ts/smartpdf.classes.smartpdf.ts +++ b/ts/smartpdf.classes.smartpdf.ts @@ -48,7 +48,11 @@ export class SmartPdf { this.htmlServerInstance.close(() => { done.resolve(); }); - await this.headlessBrowser.close(); + + if (!this.externalBrowser) { + await this.headlessBrowser.close(); + } + await done.promise; }