diff --git a/ts/smartpdf.classes.smartpdf.ts b/ts/smartpdf.classes.smartpdf.ts index 8e8b9ab..b4501fb 100644 --- a/ts/smartpdf.classes.smartpdf.ts +++ b/ts/smartpdf.classes.smartpdf.ts @@ -15,12 +15,13 @@ export class SmartPdf { private _readyDeferred: plugins.smartpromise.Deferred; private _candidates: { [key: string]: PdfCandidate } = {}; - constructor(headlessBrowserArg?) { - this.headlessBrowser = headlessBrowserArg + constructor() { this._readyDeferred = new plugins.smartpromise.Deferred(); } - async start() { + async start(headlessBrowserArg?) { + // lets set the external browser in case one is provided + this.headlessBrowser = headlessBrowserArg // setup puppeteer if (!this.headlessBrowser) { let chromeArgs: string[] = [];