Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 255bd7046e | |||
| bb82845f27 | |||
| 8ec23ba414 | |||
| 937605f8c1 | |||
| f05c2226c5 | |||
| 1d2eca0991 | |||
| c91f77a0d4 | |||
| d94826a7b7 | |||
| 636f0580c6 |
19855
package-lock.json
generated
19855
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartpuppeteer",
|
"name": "@pushrocks/smartpuppeteer",
|
||||||
"version": "1.0.18",
|
"version": "1.0.23",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "simplified access to puppeteer",
|
"description": "simplified access to puppeteer",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@@ -14,17 +14,17 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tstest": "^1.0.52",
|
"@gitzone/tstest": "^1.0.54",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.14",
|
||||||
"@types/node": "^14.14.20",
|
"@types/node": "^16.6.1",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartenv": "^4.0.16",
|
"@pushrocks/smartenv": "^4.0.16",
|
||||||
"@types/puppeteer": "^5.4.2",
|
"@types/puppeteer": "^5.4.4",
|
||||||
"puppeteer": "^5.5.0"
|
"puppeteer": "^10.2.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
|||||||
@@ -28,6 +28,15 @@ export class IncognitoBrowser {
|
|||||||
*/
|
*/
|
||||||
public async stop() {
|
public async stop() {
|
||||||
this.status = 'stopped';
|
this.status = 'stopped';
|
||||||
|
await this.browser.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rotate
|
||||||
|
*/
|
||||||
|
public async rotateBrowser () {
|
||||||
|
this.browser.close().catch();
|
||||||
|
this.browser = await getEnvAwareBrowserInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getNewIncognitoContext(): Promise<plugins.puppeteer.BrowserContext> {
|
public async getNewIncognitoContext(): Promise<plugins.puppeteer.BrowserContext> {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export const getEnvAwareBrowserInstance = async (
|
|||||||
console.log(chromeArgs);
|
console.log(chromeArgs);
|
||||||
headlessBrowser = await plugins.puppeteer.launch({
|
headlessBrowser = await plugins.puppeteer.launch({
|
||||||
args: chromeArgs,
|
args: chromeArgs,
|
||||||
|
pipe: true
|
||||||
});
|
});
|
||||||
|
|
||||||
return headlessBrowser;
|
return headlessBrowser;
|
||||||
|
|||||||
Reference in New Issue
Block a user