puppeteer-pro 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/index.d.ts +45 -0
  2. package/index.d.ts.map +1 -0
  3. package/index.js +244 -0
  4. package/index.js.map +1 -0
  5. package/package.json +3 -3
  6. package/plugins/anonymize.user.agent/index.d.ts +13 -0
  7. package/plugins/anonymize.user.agent/index.d.ts.map +1 -0
  8. package/plugins/anonymize.user.agent/index.js +50 -0
  9. package/plugins/anonymize.user.agent/index.js.map +1 -0
  10. package/plugins/avoid.detection/index.d.ts +8 -0
  11. package/plugins/avoid.detection/index.d.ts.map +1 -0
  12. package/plugins/avoid.detection/index.js +22 -0
  13. package/plugins/avoid.detection/index.js.map +1 -0
  14. package/{src/plugins → plugins}/avoid.detection/injections/chrome.runtime.js +0 -0
  15. package/{src/plugins → plugins}/avoid.detection/injections/console.debug.js +0 -0
  16. package/{src/plugins → plugins}/avoid.detection/injections/hairline.js +0 -0
  17. package/{src/plugins → plugins}/avoid.detection/injections/navigator.languages.js +0 -0
  18. package/{src/plugins → plugins}/avoid.detection/injections/navigator.permissions.js +0 -0
  19. package/{src/plugins → plugins}/avoid.detection/injections/navigator.plugins.js +0 -0
  20. package/{src/plugins → plugins}/avoid.detection/injections/navigator.webdriver.js +0 -0
  21. package/{src/plugins → plugins}/avoid.detection/injections/webgl.js +0 -0
  22. package/{src/plugins → plugins}/avoid.detection/injections/window.js +0 -0
  23. package/plugins/block.resources/index.d.ts +10 -0
  24. package/plugins/block.resources/index.d.ts.map +1 -0
  25. package/plugins/block.resources/index.js +20 -0
  26. package/plugins/block.resources/index.js.map +1 -0
  27. package/plugins/disable.dialogs/index.d.ts +8 -0
  28. package/plugins/disable.dialogs/index.d.ts.map +1 -0
  29. package/plugins/disable.dialogs/index.js +18 -0
  30. package/plugins/disable.dialogs/index.js.map +1 -0
  31. package/plugins/manage.cookies/index.d.ts +36 -0
  32. package/plugins/manage.cookies/index.d.ts.map +1 -0
  33. package/plugins/manage.cookies/index.js +140 -0
  34. package/plugins/manage.cookies/index.js.map +1 -0
  35. package/plugins/solve.recaptcha/index.d.ts +11 -0
  36. package/plugins/solve.recaptcha/index.d.ts.map +1 -0
  37. package/plugins/solve.recaptcha/index.js +83 -0
  38. package/plugins/solve.recaptcha/index.js.map +1 -0
  39. package/{src/plugins → plugins}/solve.recaptcha/injections/utils.js +0 -0
  40. package/.env.example +0 -2
  41. package/.eslintignore +0 -6
  42. package/.eslintrc.json +0 -39
  43. package/.github/dependabot.yml +0 -16
  44. package/.github/workflows/master.cron.code-analyze.yml +0 -58
  45. package/.github/workflows/master.cron.publish.yml +0 -34
  46. package/.github/workflows/master.pr.build.yml +0 -31
  47. package/src/index.ts +0 -279
  48. package/src/plugins/anonymize.user.agent/index.ts +0 -66
  49. package/src/plugins/anonymize.user.agent/test.js +0 -35
  50. package/src/plugins/avoid.detection/index.ts +0 -19
  51. package/src/plugins/avoid.detection/test.js +0 -40
  52. package/src/plugins/block.resources/index.ts +0 -23
  53. package/src/plugins/block.resources/test.js +0 -48
  54. package/src/plugins/disable.dialogs/index.ts +0 -22
  55. package/src/plugins/disable.dialogs/test.js +0 -43
  56. package/src/plugins/manage.cookies/index.ts +0 -174
  57. package/src/plugins/manage.cookies/test.js +0 -90
  58. package/src/plugins/solve.recaptcha/index.ts +0 -95
  59. package/src/plugins/solve.recaptcha/test.js +0 -42
  60. package/test/1.default.js +0 -14
  61. package/test/2.methods.js +0 -187
  62. package/test/3.plugins.js +0 -91
  63. package/tsconfig.json +0 -35
  64. package/tslint.json +0 -21
package/index.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ import * as Puppeteer from 'puppeteer';
2
+ export declare function connect(options?: Puppeteer.ConnectOptions): Promise<Puppeteer.Browser>;
3
+ /** The method launches a browser instance with given arguments. The browser will be closed when the parent node.js process is closed. */
4
+ export declare function launch(options?: Puppeteer.LaunchOptions & Puppeteer.BrowserLaunchArgumentOptions & Puppeteer.BrowserConnectOptions): Promise<Puppeteer.Browser>;
5
+ export declare class Plugin {
6
+ protected browser: Puppeteer.Browser | null;
7
+ private initialized;
8
+ private startCounter;
9
+ protected dependencies: Plugin[];
10
+ protected requiresInterception: boolean;
11
+ get isInitialized(): boolean;
12
+ get isStopped(): boolean;
13
+ protected addDependency(plugin: Plugin): Promise<void>;
14
+ init(browser: Puppeteer.Browser): Promise<void>;
15
+ protected afterLaunch(_browser: Puppeteer.Browser): Promise<void>;
16
+ protected onClose(): Promise<void>;
17
+ protected onTargetCreated(target: Puppeteer.Target): Promise<void>;
18
+ protected onPageCreated(_page: Puppeteer.Page): Promise<void>;
19
+ protected onRequest(request: Puppeteer.HTTPRequest): Promise<void>;
20
+ protected processRequest(_request: Puppeteer.HTTPRequest): Promise<void>;
21
+ protected onDialog(dialog: Puppeteer.Dialog): Promise<void>;
22
+ protected processDialog(_dialog: Puppeteer.Dialog): Promise<void>;
23
+ protected beforeRestart(): Promise<void>;
24
+ restart(): Promise<void>;
25
+ protected afterRestart(): Promise<void>;
26
+ protected beforeStop(): Promise<void>;
27
+ stop(): Promise<void>;
28
+ protected afterStop(): Promise<void>;
29
+ protected getFirstPage(): Promise<Puppeteer.Page | null>;
30
+ }
31
+ export declare function addPlugin(plugin: Plugin): void;
32
+ export declare function clearPlugins(): Promise<void>;
33
+ import { AnonymizeUserAgentPlugin } from './plugins/anonymize.user.agent/index';
34
+ export declare function anonymizeUserAgent(): AnonymizeUserAgentPlugin;
35
+ import { AvoidDetectionPlugin } from './plugins/avoid.detection';
36
+ export declare function avoidDetection(): AvoidDetectionPlugin;
37
+ import { BlockResourcesPlugin, Resource } from './plugins/block.resources';
38
+ export declare function blockResources(...resources: Resource[]): BlockResourcesPlugin;
39
+ import { DisableDialogsPlugin } from './plugins/disable.dialogs';
40
+ export declare function disableDialogs(logMessages?: boolean): DisableDialogsPlugin;
41
+ import { ManageCookiesPlugin, ManageCookiesOption } from './plugins/manage.cookies';
42
+ export declare function manageCookies(opts: ManageCookiesOption): ManageCookiesPlugin;
43
+ import { SolveRecaptchaPlugin } from './plugins/solve.recaptcha';
44
+ export declare function solveRecaptchas(accessToken: string): SolveRecaptchaPlugin;
45
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAIvC,wBAAsB,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAc5F;AAED,yIAAyI;AACzI,wBAAsB,MAAM,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,4BAA4B,GAAG,SAAS,CAAC,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAgBrK;AAID,qBAAa,MAAM;IACjB,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAQ;IACnD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAK;IACzB,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,CAAM;IACtC,SAAS,CAAC,oBAAoB,UAAS;IAEvC,IAAI,aAAa,YAA+B;IAChD,IAAI,SAAS,YAAsC;cAEnC,aAAa,CAAC,MAAM,EAAE,MAAM;IAItC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO;cA6BrB,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,OAAO;cACvC,OAAO;cAEP,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM;cAwExC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI;cAEnC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,WAAW;cAOxC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,WAAW;cAE9C,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM;cAQjC,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM;cAEvC,aAAa;IACvB,OAAO;cAUG,YAAY;cAEZ,UAAU;IACpB,IAAI;cAkBM,SAAS;cAET,YAAY;CAS7B;AAGD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,QAA2B;AACnE,wBAAsB,YAAY,kBAMjC;AAED,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,wBAAgB,kBAAkB,IAAI,wBAAwB,CAI7D;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,wBAAgB,cAAc,IAAI,oBAAoB,CAIrD;AAED,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC3E,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,oBAAoB,CAI7E;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,wBAAgB,cAAc,CAAC,WAAW,UAAQ,GAAG,oBAAoB,CAIxE;AAED,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpF,wBAAgB,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB,CAI5E;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB,CAIzE"}
package/index.js ADDED
@@ -0,0 +1,244 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.solveRecaptchas = exports.manageCookies = exports.disableDialogs = exports.blockResources = exports.avoidDetection = exports.anonymizeUserAgent = exports.clearPlugins = exports.addPlugin = exports.Plugin = exports.launch = exports.connect = void 0;
3
+ const events = require("events");
4
+ // Puppeteer Defaults
5
+ const Puppeteer = require("puppeteer");
6
+ const browserEvents = new events.EventEmitter();
7
+ async function connect(options) {
8
+ const browser = await Puppeteer.connect(options || {});
9
+ for (const plugin of plugins) {
10
+ await plugin.init(browser);
11
+ }
12
+ const _close = browser.close;
13
+ browser.close = async () => {
14
+ await _close.apply(browser);
15
+ browserEvents.emit('close');
16
+ };
17
+ return browser;
18
+ }
19
+ exports.connect = connect;
20
+ /** The method launches a browser instance with given arguments. The browser will be closed when the parent node.js process is closed. */
21
+ async function launch(options) {
22
+ if (!options)
23
+ options = {};
24
+ const browser = await Puppeteer.launch({ defaultViewport: undefined, ...options });
25
+ for (const plugin of plugins) {
26
+ await plugin.init(browser);
27
+ }
28
+ const _close = browser.close;
29
+ browser.close = async () => {
30
+ await _close.apply(browser);
31
+ browserEvents.emit('close');
32
+ };
33
+ return browser;
34
+ }
35
+ exports.launch = launch;
36
+ // PuppeteerPro
37
+ let interceptions = 0;
38
+ class Plugin {
39
+ constructor() {
40
+ this.browser = null;
41
+ this.initialized = false;
42
+ this.startCounter = 0;
43
+ this.dependencies = [];
44
+ this.requiresInterception = false;
45
+ }
46
+ get isInitialized() { return this.initialized; }
47
+ get isStopped() { return this.startCounter === 0; }
48
+ async addDependency(plugin) {
49
+ this.dependencies.push(plugin);
50
+ }
51
+ async init(browser) {
52
+ if (this.initialized)
53
+ return;
54
+ this.browser = browser;
55
+ const offOnClose = [];
56
+ browserEvents.once('close', async () => {
57
+ offOnClose.forEach(fn => fn());
58
+ this.browser = null;
59
+ this.initialized = false;
60
+ this.startCounter = 0;
61
+ await this.onClose();
62
+ });
63
+ this.startCounter++;
64
+ const thisOnTargetCreated = this.onTargetCreated.bind(this);
65
+ browser.on('targetcreated', thisOnTargetCreated);
66
+ offOnClose.push(() => browser.off('targetcreated', thisOnTargetCreated));
67
+ this.initialized = true;
68
+ this.dependencies.forEach(x => x.init(browser));
69
+ return this.afterLaunch(browser);
70
+ }
71
+ async afterLaunch(_browser) { }
72
+ async onClose() { }
73
+ async onTargetCreated(target) {
74
+ if (this.isStopped)
75
+ return;
76
+ if (target.type() !== 'page')
77
+ return;
78
+ const page = await target.page();
79
+ if (page.isClosed())
80
+ return;
81
+ const offOnClose = [];
82
+ page.once('close', async () => {
83
+ offOnClose.forEach(fn => fn());
84
+ });
85
+ const requestHandlers = [];
86
+ page.on('request', request => {
87
+ const _respond = request.respond;
88
+ let responded = 0;
89
+ let respondArgs;
90
+ const _abort = request.abort;
91
+ let aborted = 0;
92
+ let abortArgs;
93
+ const _continue = request.continue;
94
+ let continued = 0;
95
+ let continueArgs;
96
+ // tslint:disable-next-line: only-arrow-functions
97
+ const handleRequest = async function () {
98
+ const total = responded + aborted + continued;
99
+ if (!request._interceptionHandled) {
100
+ if (responded === 1)
101
+ await _respond.apply(request, respondArgs);
102
+ else if (responded === 0 && aborted >= 1 && total === requestHandlers.length)
103
+ await _abort.apply(request, abortArgs);
104
+ else if (continued === requestHandlers.length)
105
+ await _continue.apply(request, continueArgs);
106
+ }
107
+ };
108
+ // tslint:disable-next-line: only-arrow-functions
109
+ request.respond = async function () { responded++; respondArgs = respondArgs || arguments; await handleRequest(); };
110
+ // tslint:disable-next-line: only-arrow-functions
111
+ request.abort = async function () { aborted++; abortArgs = abortArgs || arguments; await handleRequest(); };
112
+ // tslint:disable-next-line: only-arrow-functions
113
+ request.continue = async function () { continued++; continueArgs = continueArgs || arguments; await handleRequest(); };
114
+ requestHandlers.forEach(handler => handler(request));
115
+ });
116
+ const _pageOn = page.on;
117
+ page.on = function async(eventName, handler) {
118
+ if (eventName === 'request') {
119
+ requestHandlers.push(handler);
120
+ return page;
121
+ }
122
+ else {
123
+ return _pageOn.call(page, eventName, handler);
124
+ }
125
+ };
126
+ if (this.requiresInterception) {
127
+ await page.setRequestInterception(true);
128
+ const thisOnRequest = this.onRequest.bind(this);
129
+ page.on('request', thisOnRequest);
130
+ offOnClose.push(() => page.off('request', thisOnRequest));
131
+ }
132
+ const thisOnDialog = this.onDialog.bind(this);
133
+ page.on('dialog', thisOnDialog);
134
+ offOnClose.push(() => page.off('dialog', thisOnDialog));
135
+ await this.onPageCreated(page);
136
+ }
137
+ async onPageCreated(_page) { }
138
+ async onRequest(request) {
139
+ const interceptionHandled = request._interceptionHandled;
140
+ if (interceptionHandled)
141
+ return;
142
+ if (this.isStopped)
143
+ return request.continue();
144
+ await this.processRequest(request);
145
+ }
146
+ async processRequest(_request) { }
147
+ async onDialog(dialog) {
148
+ const handled = dialog._handled;
149
+ if (handled)
150
+ return;
151
+ if (this.isStopped)
152
+ return;
153
+ await this.processDialog(dialog);
154
+ }
155
+ async processDialog(_dialog) { }
156
+ async beforeRestart() { }
157
+ async restart() {
158
+ await this.beforeRestart();
159
+ this.startCounter++;
160
+ if (this.requiresInterception)
161
+ interceptions++;
162
+ this.dependencies.forEach(x => x.restart());
163
+ await this.afterRestart();
164
+ }
165
+ async afterRestart() { }
166
+ async beforeStop() { }
167
+ async stop() {
168
+ await this.beforeStop();
169
+ this.startCounter--;
170
+ if (this.requiresInterception)
171
+ interceptions--;
172
+ if (interceptions === 0 && this.browser) {
173
+ const pages = await this.browser.pages();
174
+ pages.filter(x => !x.isClosed()).forEach(async (page) => {
175
+ await page.setRequestInterception(false);
176
+ });
177
+ }
178
+ this.dependencies.forEach(x => x.stop());
179
+ await this.afterStop();
180
+ }
181
+ async afterStop() { }
182
+ async getFirstPage() {
183
+ if (!this.browser)
184
+ return null;
185
+ const pages = await this.browser.pages();
186
+ const openPages = pages.filter(x => !x.isClosed());
187
+ const activePages = pages.filter(x => x.url() !== 'about:blank');
188
+ return activePages[0] || openPages[0];
189
+ }
190
+ }
191
+ exports.Plugin = Plugin;
192
+ let plugins = [];
193
+ function addPlugin(plugin) { plugins.push(plugin); }
194
+ exports.addPlugin = addPlugin;
195
+ async function clearPlugins() {
196
+ plugins.forEach(async (plugin) => {
197
+ await plugin.stop();
198
+ });
199
+ plugins = [];
200
+ }
201
+ exports.clearPlugins = clearPlugins;
202
+ const index_1 = require("./plugins/anonymize.user.agent/index");
203
+ function anonymizeUserAgent() {
204
+ const plugin = new index_1.AnonymizeUserAgentPlugin();
205
+ plugins.push(plugin);
206
+ return plugin;
207
+ }
208
+ exports.anonymizeUserAgent = anonymizeUserAgent;
209
+ const avoid_detection_1 = require("./plugins/avoid.detection");
210
+ function avoidDetection() {
211
+ const plugin = new avoid_detection_1.AvoidDetectionPlugin();
212
+ plugins.push(plugin);
213
+ return plugin;
214
+ }
215
+ exports.avoidDetection = avoidDetection;
216
+ const block_resources_1 = require("./plugins/block.resources");
217
+ function blockResources(...resources) {
218
+ const plugin = new block_resources_1.BlockResourcesPlugin(resources);
219
+ plugins.push(plugin);
220
+ return plugin;
221
+ }
222
+ exports.blockResources = blockResources;
223
+ const disable_dialogs_1 = require("./plugins/disable.dialogs");
224
+ function disableDialogs(logMessages = false) {
225
+ const plugin = new disable_dialogs_1.DisableDialogsPlugin(logMessages);
226
+ plugins.push(plugin);
227
+ return plugin;
228
+ }
229
+ exports.disableDialogs = disableDialogs;
230
+ const manage_cookies_1 = require("./plugins/manage.cookies");
231
+ function manageCookies(opts) {
232
+ const plugin = new manage_cookies_1.ManageCookiesPlugin(opts);
233
+ plugins.push(plugin);
234
+ return plugin;
235
+ }
236
+ exports.manageCookies = manageCookies;
237
+ const solve_recaptcha_1 = require("./plugins/solve.recaptcha");
238
+ function solveRecaptchas(accessToken) {
239
+ const plugin = new solve_recaptcha_1.SolveRecaptchaPlugin(accessToken);
240
+ plugins.push(plugin);
241
+ return plugin;
242
+ }
243
+ exports.solveRecaptchas = solveRecaptchas;
244
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAEjC,qBAAqB;AACrB,uCAAuC;AAEvC,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;AAEzC,KAAK,UAAU,OAAO,CAAC,OAAkC;IAC9D,MAAM,OAAO,GAAG,MAAM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C;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC;AAJD,wCAIC;AAED,+DAA2E;AAC3E,SAAgB,cAAc,CAAC,GAAG,SAAqB;IACrD,MAAM,MAAM,GAAG,IAAI,sCAAoB,CAAC,SAAS,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC;AAJD,wCAIC;AAED,+DAAiE;AACjE,SAAgB,cAAc,CAAC,WAAW,GAAG,KAAK;IAChD,MAAM,MAAM,GAAG,IAAI,sCAAoB,CAAC,WAAW,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC;AAJD,wCAIC;AAED,6DAAoF;AACpF,SAAgB,aAAa,CAAC,IAAyB;IACrD,MAAM,MAAM,GAAG,IAAI,oCAAmB,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC;AAJD,sCAIC;AAED,+DAAiE;AACjE,SAAgB,eAAe,CAAC,WAAmB;IACjD,MAAM,MAAM,GAAG,IAAI,sCAAoB,CAAC,WAAW,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC;AAJD,0CAIC","sourcesContent":["import * as events from 'events';\n\n// Puppeteer Defaults\nimport * as Puppeteer from 'puppeteer';\n\nconst browserEvents = new events.EventEmitter();\n\nexport async function connect(options?: Puppeteer.ConnectOptions): Promise<Puppeteer.Browser> {\n const browser = await Puppeteer.connect(options || {});\n\n for (const plugin of plugins) {\n await plugin.init(browser);\n }\n\n const _close = browser.close;\n browser.close = async () => {\n await _close.apply(browser);\n browserEvents.emit('close');\n };\n\n return browser;\n}\n\n/** The method launches a browser instance with given arguments. The browser will be closed when the parent node.js process is closed. */\nexport async function launch(options?: Puppeteer.LaunchOptions & Puppeteer.BrowserLaunchArgumentOptions & Puppeteer.BrowserConnectOptions): Promise<Puppeteer.Browser> {\n if (!options) options = {};\n\n const browser = await Puppeteer.launch({ defaultViewport: undefined, ...options });\n\n for (const plugin of plugins) {\n await plugin.init(browser);\n }\n\n const _close = browser.close;\n browser.close = async () => {\n await _close.apply(browser);\n browserEvents.emit('close');\n };\n\n return browser;\n}\n\n// PuppeteerPro\nlet interceptions = 0;\nexport class Plugin {\n protected browser: Puppeteer.Browser | null = null;\n private initialized = false;\n private startCounter = 0;\n protected dependencies: Plugin[] = [];\n protected requiresInterception = false;\n\n get isInitialized() { return this.initialized; }\n get isStopped() { return this.startCounter === 0; }\n\n protected async addDependency(plugin: Plugin) {\n this.dependencies.push(plugin);\n }\n\n async init(browser: Puppeteer.Browser) {\n if (this.initialized) return;\n\n this.browser = browser;\n\n const offOnClose: (() => void)[] = [];\n browserEvents.once('close', async () => {\n offOnClose.forEach(fn => fn());\n\n this.browser = null;\n this.initialized = false;\n this.startCounter = 0;\n\n await this.onClose();\n });\n\n this.startCounter++;\n\n const thisOnTargetCreated = this.onTargetCreated.bind(this);\n browser.on('targetcreated', thisOnTargetCreated);\n offOnClose.push(() => browser.off('targetcreated', thisOnTargetCreated));\n\n this.initialized = true;\n\n this.dependencies.forEach(x => x.init(browser));\n\n return this.afterLaunch(browser);\n }\n\n protected async afterLaunch(_browser: Puppeteer.Browser) { }\n protected async onClose() { }\n\n protected async onTargetCreated(target: Puppeteer.Target) {\n if (this.isStopped) return;\n\n if (target.type() !== 'page') return;\n const page = await target.page() as Puppeteer.Page;\n if (page.isClosed()) return;\n\n const offOnClose: (() => void)[] = [];\n page.once('close', async () => {\n offOnClose.forEach(fn => fn());\n });\n\n const requestHandlers: ((request: any) => void)[] = [];\n page.on('request', request => {\n const _respond = request.respond;\n let responded = 0;\n let respondArgs: IArguments;\n\n const _abort = request.abort;\n let aborted = 0;\n let abortArgs: IArguments;\n\n const _continue = request.continue;\n let continued = 0;\n let continueArgs: IArguments;\n\n // tslint:disable-next-line: only-arrow-functions\n const handleRequest = async function () {\n const total = responded + aborted + continued;\n\n if (!(request as any)._interceptionHandled) {\n if (responded === 1) await _respond.apply(request, respondArgs);\n else if (responded === 0 && aborted >= 1 && total === requestHandlers.length) await _abort.apply(request, abortArgs);\n else if (continued === requestHandlers.length) await _continue.apply(request, continueArgs);\n }\n };\n\n // tslint:disable-next-line: only-arrow-functions\n request.respond = async function () { responded++; respondArgs = respondArgs || arguments; await handleRequest(); };\n // tslint:disable-next-line: only-arrow-functions\n request.abort = async function () { aborted++; abortArgs = abortArgs || arguments; await handleRequest(); };\n // tslint:disable-next-line: only-arrow-functions\n request.continue = async function () { continued++; continueArgs = continueArgs || arguments; await handleRequest(); };\n\n requestHandlers.forEach(handler => handler(request));\n });\n\n const _pageOn = page.on;\n page.on = function async(eventName, handler) {\n if (eventName === 'request') {\n requestHandlers.push(handler);\n\n return page;\n } else {\n return _pageOn.call(page, eventName, handler);\n }\n };\n\n if (this.requiresInterception) {\n await page.setRequestInterception(true);\n\n const thisOnRequest = this.onRequest.bind(this);\n page.on('request', thisOnRequest);\n offOnClose.push(() => page.off('request', thisOnRequest));\n }\n\n const thisOnDialog = this.onDialog.bind(this);\n page.on('dialog', thisOnDialog);\n offOnClose.push(() => page.off('dialog', thisOnDialog));\n\n await this.onPageCreated(page);\n }\n protected async onPageCreated(_page: Puppeteer.Page) { }\n\n protected async onRequest(request: Puppeteer.HTTPRequest) {\n const interceptionHandled = (request as any)._interceptionHandled;\n if (interceptionHandled) return;\n if (this.isStopped) return request.continue();\n\n await this.processRequest(request);\n }\n protected async processRequest(_request: Puppeteer.HTTPRequest) { }\n\n protected async onDialog(dialog: Puppeteer.Dialog) {\n const handled = (dialog as any)._handled;\n\n if (handled) return;\n if (this.isStopped) return;\n\n await this.processDialog(dialog);\n }\n protected async processDialog(_dialog: Puppeteer.Dialog) { }\n\n protected async beforeRestart() { }\n async restart() {\n await this.beforeRestart();\n\n this.startCounter++;\n if (this.requiresInterception) interceptions++;\n\n this.dependencies.forEach(x => x.restart());\n\n await this.afterRestart();\n }\n protected async afterRestart() { }\n\n protected async beforeStop() { }\n async stop() {\n await this.beforeStop();\n\n this.startCounter--;\n if (this.requiresInterception) interceptions--;\n\n if (interceptions === 0 && this.browser) {\n const pages = await this.browser.pages();\n\n pages.filter(x => !x.isClosed()).forEach(async (page: Puppeteer.Page) => {\n await page.setRequestInterception(false);\n });\n }\n\n this.dependencies.forEach(x => x.stop());\n\n await this.afterStop();\n }\n protected async afterStop() { }\n\n protected async getFirstPage() {\n if (!this.browser) return null;\n\n const pages = await this.browser.pages();\n const openPages = pages.filter(x => !x.isClosed());\n const activePages = pages.filter(x => x.url() !== 'about:blank');\n\n return activePages[0] || openPages[0];\n }\n}\n\nlet plugins: Plugin[] = [];\nexport function addPlugin(plugin: Plugin) { plugins.push(plugin); }\nexport async function clearPlugins() {\n plugins.forEach(async plugin => {\n await plugin.stop();\n });\n\n plugins = [];\n}\n\nimport { AnonymizeUserAgentPlugin } from './plugins/anonymize.user.agent/index';\nexport function anonymizeUserAgent(): AnonymizeUserAgentPlugin {\n const plugin = new AnonymizeUserAgentPlugin();\n plugins.push(plugin);\n return plugin;\n}\n\nimport { AvoidDetectionPlugin } from './plugins/avoid.detection';\nexport function avoidDetection(): AvoidDetectionPlugin {\n const plugin = new AvoidDetectionPlugin();\n plugins.push(plugin);\n return plugin;\n}\n\nimport { BlockResourcesPlugin, Resource } from './plugins/block.resources';\nexport function blockResources(...resources: Resource[]): BlockResourcesPlugin {\n const plugin = new BlockResourcesPlugin(resources);\n plugins.push(plugin);\n return plugin;\n}\n\nimport { DisableDialogsPlugin } from './plugins/disable.dialogs';\nexport function disableDialogs(logMessages = false): DisableDialogsPlugin {\n const plugin = new DisableDialogsPlugin(logMessages);\n plugins.push(plugin);\n return plugin;\n}\n\nimport { ManageCookiesPlugin, ManageCookiesOption } from './plugins/manage.cookies';\nexport function manageCookies(opts: ManageCookiesOption): ManageCookiesPlugin {\n const plugin = new ManageCookiesPlugin(opts);\n plugins.push(plugin);\n return plugin;\n}\n\nimport { SolveRecaptchaPlugin } from './plugins/solve.recaptcha';\nexport function solveRecaptchas(accessToken: string): SolveRecaptchaPlugin {\n const plugin = new SolveRecaptchaPlugin(accessToken);\n plugins.push(plugin);\n return plugin;\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puppeteer-pro",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "A simple puppeteer wrapper to enable useful plugins with ease",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "axios": "^0.27.2",
39
39
  "ghost-cursor": "^1.1.11",
40
- "user-agents": "^1.0.1042"
40
+ "user-agents": "^1.0.1041"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^17.0.41",
@@ -52,4 +52,4 @@
52
52
  "tslint": "^6.1.3",
53
53
  "typescript": "^4.7.3"
54
54
  }
55
- }
55
+ }
@@ -0,0 +1,13 @@
1
+ import * as Puppeteer from 'puppeteer';
2
+ import { Plugin } from '../../index';
3
+ export declare class AnonymizeUserAgentPlugin extends Plugin {
4
+ private pages;
5
+ private userAgent?;
6
+ constructor();
7
+ protected afterLaunch(browser: Puppeteer.Browser): Promise<void>;
8
+ protected onClose(): Promise<void>;
9
+ protected onPageCreated(page: Puppeteer.Page): Promise<void>;
10
+ protected beforeRestart(): Promise<void>;
11
+ protected afterStop(): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/anonymize.user.agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC,qBAAa,wBAAyB,SAAQ,MAAM;IAClD,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,SAAS,CAAC,CAAS;;cAaX,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO;cAStC,OAAO;cAIP,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI;cASlC,aAAa;cAQb,SAAS;CAO1B"}
@@ -0,0 +1,50 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.AnonymizeUserAgentPlugin = void 0;
3
+ const UserAgent = require("user-agents");
4
+ const index_1 = require("../../index");
5
+ const sleep = (time) => { return new Promise(resolve => { setTimeout(resolve, time); }); };
6
+ class AnonymizeUserAgentPlugin extends index_1.Plugin {
7
+ constructor() {
8
+ super();
9
+ this.pages = [];
10
+ try {
11
+ this.userAgent = new UserAgent({ vendor: 'Google Inc.', platform: 'Win32' }).toString();
12
+ }
13
+ catch (ex) {
14
+ console.warn('Could not create a random user agent');
15
+ }
16
+ }
17
+ async afterLaunch(browser) {
18
+ const _newPage = browser.newPage;
19
+ browser.newPage = async () => {
20
+ const page = await _newPage.apply(browser);
21
+ await sleep(100); // Sleep to allow user agent to set
22
+ return page;
23
+ };
24
+ }
25
+ async onClose() {
26
+ this.pages = [];
27
+ }
28
+ async onPageCreated(page) {
29
+ const userAgent = await page.browser().userAgent();
30
+ const newUserAgent = this.userAgent || userAgent.replace('HeadlessChrome/', 'Chrome/').replace(/\(([^)]+)\)/, '(Windows NT 10.0; Win64; x64)');
31
+ this.pages.push({ target: page, userAgent, newUserAgent });
32
+ await page.setUserAgent(newUserAgent);
33
+ }
34
+ async beforeRestart() {
35
+ for (const page of this.pages) {
36
+ if (page.target.isClosed())
37
+ continue;
38
+ await page.target.setUserAgent(page.newUserAgent);
39
+ }
40
+ }
41
+ async afterStop() {
42
+ for (const page of this.pages) {
43
+ if (page.target.isClosed())
44
+ continue;
45
+ await page.target.setUserAgent(page.userAgent);
46
+ }
47
+ }
48
+ }
49
+ exports.AnonymizeUserAgentPlugin = AnonymizeUserAgentPlugin;
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/anonymize.user.agent/index.ts"],"names":[],"mappings":";;AACA,yCAA0C;AAE1C,uCAAqC;AAErC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,GAAG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAQnG,MAAa,wBAAyB,SAAQ,cAAM;IAIlD;QACE,KAAK,EAAE,CAAC;QAJF,UAAK,GAAoB,EAAE,CAAC;QAMlC,IAAI;YACF,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;SACzF;QACD,OAAO,EAAE,EAAE;YACT,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;SACtD;IACH,CAAC;IAES,KAAK,CAAC,WAAW,CAAC,OAA0B;QACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,OAAO,CAAC,OAAO,GAAG,KAAK,IAA6B,EAAE;YACpD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3C,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,mCAAmC;YACrD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,OAAO;QACrB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAES,KAAK,CAAC,aAAa,CAAC,IAAoB;QAChD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;QACnD,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,+BAA+B,CAAC,CAAC;QAE/I,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;QAE3D,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IAES,KAAK,CAAC,aAAa;QAC3B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAAE,SAAS;YAErC,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACnD;IACH,CAAC;IAES,KAAK,CAAC,SAAS;QACvB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAAE,SAAS;YAErC,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAChD;IACH,CAAC;CACF;AApDD,4DAoDC","sourcesContent":["import * as Puppeteer from 'puppeteer';\nimport UserAgent = require('user-agents');\n\nimport { Plugin } from '../../index';\n\nconst sleep = (time: number) => { return new Promise(resolve => { setTimeout(resolve, time); }); };\n\ninterface PageUserAgent {\n target: Puppeteer.Page;\n userAgent: string;\n newUserAgent: string;\n}\n\nexport class AnonymizeUserAgentPlugin extends Plugin {\n private pages: PageUserAgent[] = [];\n private userAgent?: string;\n\n constructor() {\n super();\n\n try {\n this.userAgent = new UserAgent({ vendor: 'Google Inc.', platform: 'Win32' }).toString();\n }\n catch (ex) {\n console.warn('Could not create a random user agent');\n }\n }\n\n protected async afterLaunch(browser: Puppeteer.Browser) {\n const _newPage = browser.newPage;\n browser.newPage = async (): Promise<Puppeteer.Page> => {\n const page = await _newPage.apply(browser);\n await sleep(100); // Sleep to allow user agent to set\n return page;\n };\n }\n\n protected async onClose() {\n this.pages = [];\n }\n\n protected async onPageCreated(page: Puppeteer.Page) {\n const userAgent = await page.browser().userAgent();\n const newUserAgent = this.userAgent || userAgent.replace('HeadlessChrome/', 'Chrome/').replace(/\\(([^)]+)\\)/, '(Windows NT 10.0; Win64; x64)');\n\n this.pages.push({ target: page, userAgent, newUserAgent });\n\n await page.setUserAgent(newUserAgent);\n }\n\n protected async beforeRestart() {\n for (const page of this.pages) {\n if (page.target.isClosed()) continue;\n\n await page.target.setUserAgent(page.newUserAgent);\n }\n }\n\n protected async afterStop() {\n for (const page of this.pages) {\n if (page.target.isClosed()) continue;\n\n await page.target.setUserAgent(page.userAgent);\n }\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import * as Puppeteer from 'puppeteer';
2
+ import { Plugin } from '../../index';
3
+ import { AnonymizeUserAgentPlugin } from './../anonymize.user.agent/index';
4
+ export declare class AvoidDetectionPlugin extends Plugin {
5
+ dependencies: AnonymizeUserAgentPlugin[];
6
+ protected onPageCreated(page: Puppeteer.Page): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/avoid.detection/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAK3E,qBAAa,oBAAqB,SAAQ,MAAM;IAC9C,YAAY,6BAAoC;cAEhC,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI;CAKnD"}
@@ -0,0 +1,22 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.AvoidDetectionPlugin = void 0;
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const index_1 = require("../../index");
6
+ const index_2 = require("./../anonymize.user.agent/index");
7
+ const injectionsFolder = path.resolve(`${__dirname}/injections`);
8
+ const injections = fs.readdirSync(injectionsFolder).map(fileName => require(`${injectionsFolder}/${fileName}`));
9
+ class AvoidDetectionPlugin extends index_1.Plugin {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.dependencies = [new index_2.AnonymizeUserAgentPlugin()];
13
+ }
14
+ async onPageCreated(page) {
15
+ for (const injection of injections) {
16
+ if (!this.isStopped && !page.isClosed())
17
+ await page.evaluateOnNewDocument(injection);
18
+ }
19
+ }
20
+ }
21
+ exports.AvoidDetectionPlugin = AvoidDetectionPlugin;
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/avoid.detection/index.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAG7B,uCAAqC;AACrC,2DAA2E;AAE3E,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,SAAS,aAAa,CAAC,CAAC;AACjE,MAAM,UAAU,GAAG,EAAE,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,gBAAgB,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC;AAEhH,MAAa,oBAAqB,SAAQ,cAAM;IAAhD;;QACE,iBAAY,GAAG,CAAC,IAAI,gCAAwB,EAAE,CAAC,CAAC;IAOlD,CAAC;IALW,KAAK,CAAC,aAAa,CAAC,IAAoB;QAChD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAAE,MAAM,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;SACtF;IACH,CAAC;CACF;AARD,oDAQC","sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport * as Puppeteer from 'puppeteer';\n\nimport { Plugin } from '../../index';\nimport { AnonymizeUserAgentPlugin } from './../anonymize.user.agent/index';\n\nconst injectionsFolder = path.resolve(`${__dirname}/injections`);\nconst injections = fs.readdirSync(injectionsFolder).map(fileName => require(`${injectionsFolder}/${fileName}`));\n\nexport class AvoidDetectionPlugin extends Plugin {\n dependencies = [new AnonymizeUserAgentPlugin()];\n\n protected async onPageCreated(page: Puppeteer.Page) {\n for (const injection of injections) {\n if (!this.isStopped && !page.isClosed()) await page.evaluateOnNewDocument(injection);\n }\n }\n}"]}
@@ -0,0 +1,10 @@
1
+ import * as Puppeteer from 'puppeteer';
2
+ import { Plugin } from '../../index';
3
+ export declare type Resource = 'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'eventsource' | 'websocket' | 'manifest' | 'other';
4
+ export declare class BlockResourcesPlugin extends Plugin {
5
+ requiresInterception: boolean;
6
+ blockResources: Resource[];
7
+ constructor(resources?: Resource[]);
8
+ protected processRequest(request: Puppeteer.HTTPRequest): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/block.resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,oBAAY,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAC9K,qBAAa,oBAAqB,SAAQ,MAAM;IAC9C,oBAAoB,UAAQ;IAC5B,cAAc,EAAE,QAAQ,EAAE,CAAC;gBAEf,SAAS,GAAE,QAAQ,EAAO;cAMtB,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,WAAW;CAO9D"}
@@ -0,0 +1,20 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.BlockResourcesPlugin = void 0;
3
+ const index_1 = require("../../index");
4
+ class BlockResourcesPlugin extends index_1.Plugin {
5
+ constructor(resources = []) {
6
+ super();
7
+ this.requiresInterception = true;
8
+ this.blockResources = resources;
9
+ }
10
+ async processRequest(request) {
11
+ if (this.blockResources.includes(request.resourceType())) {
12
+ await request.abort();
13
+ }
14
+ else {
15
+ await request.continue();
16
+ }
17
+ }
18
+ }
19
+ exports.BlockResourcesPlugin = BlockResourcesPlugin;
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/block.resources/index.ts"],"names":[],"mappings":";;AAEA,uCAAqC;AAGrC,MAAa,oBAAqB,SAAQ,cAAM;IAI9C,YAAY,YAAwB,EAAE;QACpC,KAAK,EAAE,CAAC;QAJV,yBAAoB,GAAG,IAAI,CAAC;QAM1B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;IAClC,CAAC;IAES,KAAK,CAAC,cAAc,CAAC,OAA8B;QAC3D,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAc,CAAC,EAAE;YACpE,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;SACvB;aAAM;YACL,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;SAC1B;IACH,CAAC;CACF;AAjBD,oDAiBC","sourcesContent":["import * as Puppeteer from 'puppeteer';\n\nimport { Plugin } from '../../index';\n\nexport type Resource = 'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'eventsource' | 'websocket' | 'manifest' | 'other';\nexport class BlockResourcesPlugin extends Plugin {\n requiresInterception = true;\n blockResources: Resource[];\n\n constructor(resources: Resource[] = []) {\n super();\n\n this.blockResources = resources;\n }\n\n protected async processRequest(request: Puppeteer.HTTPRequest) {\n if (this.blockResources.includes(request.resourceType() as Resource)) {\n await request.abort();\n } else {\n await request.continue();\n }\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import * as Puppeteer from 'puppeteer';
2
+ import { Plugin } from '../../index';
3
+ export declare class DisableDialogsPlugin extends Plugin {
4
+ logMessages: boolean;
5
+ constructor(logMessages?: boolean);
6
+ protected processDialog(dialog: Puppeteer.Dialog): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/disable.dialogs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,oBAAqB,SAAQ,MAAM;IAC9C,WAAW,EAAE,OAAO,CAAC;gBAET,WAAW,UAAQ;cAMf,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM;CAQvD"}
@@ -0,0 +1,18 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.DisableDialogsPlugin = void 0;
3
+ const index_1 = require("../../index");
4
+ class DisableDialogsPlugin extends index_1.Plugin {
5
+ constructor(logMessages = false) {
6
+ super();
7
+ this.logMessages = logMessages;
8
+ }
9
+ async processDialog(dialog) {
10
+ if (this.logMessages) {
11
+ // tslint:disable-next-line: no-console
12
+ console.log(`Dialog message: ${dialog.message()}`);
13
+ }
14
+ await dialog.dismiss();
15
+ }
16
+ }
17
+ exports.DisableDialogsPlugin = DisableDialogsPlugin;
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/disable.dialogs/index.ts"],"names":[],"mappings":";;AAEA,uCAAqC;AAErC,MAAa,oBAAqB,SAAQ,cAAM;IAG9C,YAAY,WAAW,GAAG,KAAK;QAC7B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAES,KAAK,CAAC,aAAa,CAAC,MAAwB;QACpD,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,uCAAuC;YACvC,OAAO,CAAC,GAAG,CAAC,mBAAmB,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SACpD;QAED,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACF;AAjBD,oDAiBC","sourcesContent":["import * as Puppeteer from 'puppeteer';\n\nimport { Plugin } from '../../index';\n\nexport class DisableDialogsPlugin extends Plugin {\n logMessages: boolean;\n\n constructor(logMessages = false) {\n super();\n\n this.logMessages = logMessages;\n }\n\n protected async processDialog(dialog: Puppeteer.Dialog) {\n if (this.logMessages) {\n // tslint:disable-next-line: no-console\n console.log(`Dialog message: ${dialog.message()}`);\n }\n\n await dialog.dismiss();\n }\n}"]}
@@ -0,0 +1,36 @@
1
+ import * as Puppeteer from 'puppeteer';
2
+ import { Plugin } from '../../index';
3
+ export interface ManageCookiesOption {
4
+ saveLocation: string;
5
+ mode: 'manual' | 'monitor';
6
+ stringify?: (cookies: {
7
+ [profile: string]: Puppeteer.Protocol.Network.Cookie[];
8
+ }) => string;
9
+ parse?: (cookies: string) => {
10
+ [profile: string]: Puppeteer.Protocol.Network.Cookie[];
11
+ };
12
+ disableWarning?: boolean;
13
+ profile?: 'string';
14
+ }
15
+ export declare class ManageCookiesPlugin extends Plugin {
16
+ private saveLocation;
17
+ private mode;
18
+ private stringify;
19
+ private parse;
20
+ private disableWarning;
21
+ private profile;
22
+ private allCookies;
23
+ constructor(opts: ManageCookiesOption);
24
+ protected afterLaunch(): Promise<void>;
25
+ protected afterRestart(): Promise<void>;
26
+ switchToProfile(profile: string): Promise<void>;
27
+ save(): Promise<void>;
28
+ load(): Promise<void>;
29
+ clear(): Promise<void>;
30
+ private watchCookies;
31
+ private saveProfileCookies;
32
+ private loadProfileCookies;
33
+ private clearProfileCookies;
34
+ private getCookies;
35
+ }
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/manage.cookies/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAA;KAAE,KAAK,MAAM,CAAC;IAC5F,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAA;KAAE,CAAC;IACxF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB;AAED,qBAAa,mBAAoB,SAAQ,MAAM;IAC7C,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,SAAS,CAAoG;IACrH,OAAO,CAAC,KAAK,CAA4C;IACzD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,OAAO,CAAa;IAE5B,OAAO,CAAC,UAAU,CAAkE;gBAExE,IAAI,EAAE,mBAAmB;cAiBrB,WAAW;cASX,YAAY;IAKtB,eAAe,CAAC,OAAO,EAAE,MAAM;IAQ/B,IAAI;IAOJ,IAAI;IAOJ,KAAK;YAMG,YAAY;YAyBZ,kBAAkB;YAOlB,kBAAkB;YAkBlB,mBAAmB;YAqBnB,UAAU;CAczB"}