fix(core): update
This commit is contained in:
parent
bd381ff23f
commit
bc6d3f45f8
2599
package-lock.json
generated
2599
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -13,20 +13,20 @@
|
||||
"format": "(gitzone format)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.24",
|
||||
"@gitzone/tstest": "^1.0.43",
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tstest": "^1.0.52",
|
||||
"@pushrocks/smartserve": "^1.1.41",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.0.27",
|
||||
"@types/node": "^14.14.20",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartdelay": "^2.0.10",
|
||||
"@pushrocks/smartfile": "^7.0.12",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartpuppeteer": "^1.0.15",
|
||||
"@pushrocks/smarttime": "^3.0.24"
|
||||
"@pushrocks/smartfile": "^8.0.8",
|
||||
"@pushrocks/smartpromise": "^3.1.3",
|
||||
"@pushrocks/smartpuppeteer": "^1.0.19",
|
||||
"@pushrocks/smarttime": "^3.0.38"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
@ -11,7 +11,7 @@ export interface ISmartSSROptions {
|
||||
*
|
||||
*/
|
||||
export class SmartSSR {
|
||||
public browser: plugins.smartpuppeteer.puppeteer.Browser;
|
||||
public browser: plugins.smartpuppeteer.IncognitoBrowser;
|
||||
public options: ISmartSSROptions;
|
||||
|
||||
constructor(optionsArg?: ISmartSSROptions) {
|
||||
@ -24,12 +24,13 @@ export class SmartSSR {
|
||||
}
|
||||
|
||||
public async start() {
|
||||
this.browser = await plugins.smartpuppeteer.getEnvAwareBrowserInstance();
|
||||
this.browser = new plugins.smartpuppeteer.IncognitoBrowser();
|
||||
await this.browser.start();
|
||||
}
|
||||
public async stop() {
|
||||
if (this.browser) {
|
||||
await plugins.smartdelay.delayFor(3000);
|
||||
await this.browser.close();
|
||||
await this.browser.stop();
|
||||
this.browser = null;
|
||||
} else {
|
||||
console.log('browser was not in started mode');
|
||||
@ -40,7 +41,7 @@ export class SmartSSR {
|
||||
const overallTimeMeasurement = new plugins.smarttime.HrtMeasurement();
|
||||
overallTimeMeasurement.start();
|
||||
const resultDeferred = plugins.smartpromise.defer<string>();
|
||||
const context = await this.browser.createIncognitoBrowserContext();
|
||||
const context = await this.browser.getNewIncognitoContext();
|
||||
const page = await context.newPage();
|
||||
page.on('console', (msg) => {
|
||||
console.log(`${urlArg}: ${msg.text()}`);
|
||||
|
Loading…
Reference in New Issue
Block a user