fix(core): update

This commit is contained in:
Philipp Kunz 2019-06-03 13:00:06 +02:00
parent e4287e9943
commit 63f4321b04

View File

@ -11,16 +11,22 @@ export class SmartPdf {
htmlServerInstance: Server;
serverPort: number;
headlessBrowser: plugins.puppeteer.Browser;
externalBrowser: boolean = false;
private _readyDeferred: plugins.smartpromise.Deferred<void>;
private _candidates: { [key: string]: PdfCandidate } = {};
constructor() {
constructor(headlessBrowserArg?) {
this.headlessBrowser = headlessBrowserArg
this._readyDeferred = new plugins.smartpromise.Deferred();
}
async start() {
// setup puppeteer
if (!this.headlessBrowser) {
this.headlessBrowser = await plugins.puppeteer.launch();
} else {
this.externalBrowser = true;
}
// setup server
const app = plugins.express();