fix(core): update
This commit is contained in:
parent
ed1522062e
commit
87d7460183
7
package-lock.json
generated
7
package-lock.json
generated
@ -11,7 +11,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^2.0.13",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartenv": "^4.0.16",
|
"@pushrocks/smartenv": "^4.0.16",
|
||||||
"puppeteer": "^10.2.0"
|
"puppeteer": "^10.2.0",
|
||||||
|
"tree-kill": "^1.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.26",
|
"@gitzone/tsbuild": "^2.1.26",
|
||||||
@ -13680,7 +13681,6 @@
|
|||||||
"version": "1.2.2",
|
"version": "1.2.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/tree-kill/-/tree-kill-1.2.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/tree-kill/-/tree-kill-1.2.2.tgz",
|
||||||
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
|
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
"tree-kill": "cli.js"
|
"tree-kill": "cli.js"
|
||||||
@ -24975,8 +24975,7 @@
|
|||||||
"tree-kill": {
|
"tree-kill": {
|
||||||
"version": "1.2.2",
|
"version": "1.2.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/tree-kill/-/tree-kill-1.2.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/tree-kill/-/tree-kill-1.2.2.tgz",
|
||||||
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
|
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"trim-right": {
|
"trim-right": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^2.0.13",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartenv": "^4.0.16",
|
"@pushrocks/smartenv": "^4.0.16",
|
||||||
"puppeteer": "^10.2.0"
|
"puppeteer": "^10.2.0",
|
||||||
|
"tree-kill": "^1.2.2"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
@ -5,7 +5,15 @@ tap.test('first test', async (tools) => {
|
|||||||
const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({
|
const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({
|
||||||
forceNoSandbox: true,
|
forceNoSandbox: true,
|
||||||
});
|
});
|
||||||
|
const page = await headlessBrowser.newPage();
|
||||||
await headlessBrowser.close();
|
await headlessBrowser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should get and stop an Incognito browser', async () => {
|
||||||
|
const incognitoInstance = new smartpuppeteer.IncognitoBrowser();
|
||||||
|
await incognitoInstance.start();
|
||||||
|
const page = await incognitoInstance.browser.newPage();
|
||||||
|
await incognitoInstance.stop();
|
||||||
|
})
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -28,6 +28,7 @@ export class IncognitoBrowser {
|
|||||||
*/
|
*/
|
||||||
public async stop() {
|
public async stop() {
|
||||||
this.status = 'stopped';
|
this.status = 'stopped';
|
||||||
|
plugins.treeKill(this.browser.process().pid);
|
||||||
await this.browser.close();
|
await this.browser.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,5 +11,6 @@ export { smartdelay, smartenv };
|
|||||||
|
|
||||||
// third party scope
|
// third party scope
|
||||||
import puppeteer from 'puppeteer';
|
import puppeteer from 'puppeteer';
|
||||||
|
import treeKill from 'tree-kill';
|
||||||
|
|
||||||
export { puppeteer };
|
export { puppeteer, treeKill };
|
||||||
|
Loading…
Reference in New Issue
Block a user