From 8da88be5e81d0b759ed6ce18d99451b1a340f6ca Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 3 Jun 2019 13:02:01 +0200 Subject: [PATCH] fix(core): update --- ts/smartpdf.classes.smartpdf.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; }