fix(core): update

This commit is contained in:
2019-06-03 23:34:33 +02:00
parent 30e4b4665c
commit baf26dc492
4 changed files with 31 additions and 29 deletions

View File

@ -10,7 +10,7 @@ import * as interfaces from './interfaces';
export class SmartPdf {
htmlServerInstance: Server;
serverPort: number;
headlessBrowser: plugins.puppeteer.Browser;
headlessBrowser: plugins.smartpuppeteer.puppeteer.Browser;
externalBrowserBool: boolean = false;
private _readyDeferred: plugins.smartpromise.Deferred<void>;
private _candidates: { [key: string]: PdfCandidate } = {};
@ -26,13 +26,7 @@ export class SmartPdf {
if (this.headlessBrowser) {
this.externalBrowserBool = true;
} else {
let chromeArgs: string[] = [];
if(process.env.CI) {
chromeArgs = chromeArgs.concat(['--no-sandbox', '--disable-setuid-sandbox'])
}
this.headlessBrowser = await plugins.puppeteer.launch({
args: chromeArgs
});
this.headlessBrowser = await plugins.smartpuppeteer.getEnvAwareBrowserInstance();
}
// setup server

View File

@ -7,13 +7,13 @@ export { http, path };
// @pushrocks
import * as smartfile from '@pushrocks/smartfile';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartpuppeteer from '@pushrocks/smartpuppeteer';
import * as smartnetwork from '@pushrocks/smartnetwork';
import * as smartunique from '@pushrocks/smartunique';
export { smartfile, smartpromise, smartunique, smartnetwork };
export { smartfile, smartpromise, smartpuppeteer, smartunique, smartnetwork };
// thirdparty
import express from 'express';
import puppeteer from 'puppeteer';
export { express, puppeteer };
export { express };