fix(core): update
This commit is contained in:
parent
e4287e9943
commit
63f4321b04
@ -11,16 +11,22 @@ export class SmartPdf {
|
|||||||
htmlServerInstance: Server;
|
htmlServerInstance: Server;
|
||||||
serverPort: number;
|
serverPort: number;
|
||||||
headlessBrowser: plugins.puppeteer.Browser;
|
headlessBrowser: plugins.puppeteer.Browser;
|
||||||
|
externalBrowser: boolean = false;
|
||||||
private _readyDeferred: plugins.smartpromise.Deferred<void>;
|
private _readyDeferred: plugins.smartpromise.Deferred<void>;
|
||||||
private _candidates: { [key: string]: PdfCandidate } = {};
|
private _candidates: { [key: string]: PdfCandidate } = {};
|
||||||
|
|
||||||
constructor() {
|
constructor(headlessBrowserArg?) {
|
||||||
|
this.headlessBrowser = headlessBrowserArg
|
||||||
this._readyDeferred = new plugins.smartpromise.Deferred();
|
this._readyDeferred = new plugins.smartpromise.Deferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
// setup puppeteer
|
// setup puppeteer
|
||||||
|
if (!this.headlessBrowser) {
|
||||||
this.headlessBrowser = await plugins.puppeteer.launch();
|
this.headlessBrowser = await plugins.puppeteer.launch();
|
||||||
|
} else {
|
||||||
|
this.externalBrowser = true;
|
||||||
|
}
|
||||||
|
|
||||||
// setup server
|
// setup server
|
||||||
const app = plugins.express();
|
const app = plugins.express();
|
||||||
|
Loading…
Reference in New Issue
Block a user