Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

Merge develop, resolve conflicts

Ondra Urban03cfe4c68983
diff --cc docs/typedefs/LaunchPuppeteerOptions.md
index 829ec469d,7fea7492e..ebec20eec
--- a/docs/typedefs/LaunchPuppeteerOptions.md
+++ b/docs/typedefs/LaunchPuppeteerOptions.md
@@@ -73,22 -73,13 +73,25 @@@ function and in addition, all the optio
The identifier can only contain the following characters: <code>0-9</code>, <code>a-z</code>, <code>A-Z</code>, <code>&quot;.&quot;</code>, <code>&quot;_&quot;</code> and <code>&quot;~&quot;</code>.
Only applied if the <code>useApifyProxy</code> option is <code>true</code>.</p>
</td></tr><tr>
- <td><code>[puppeteerModule]</code></td><td><code>String</code></td><td></td>
+ <td><code>[puppeteerModule]</code></td><td><code>string</code> | <code>Object</code></td><td></td>
</tr>
<tr>
- <td colspan="3"><p>Require path to a module to be used instead of default <code>puppeteer</code>. This enables usage
- of various Puppeteer wrappers such as <code>puppeteer-extra</code>.</p>
+ <td colspan="3"><p>Either a require path (<code>string</code>) to a package to be used instead of default <code>puppeteer</code>,
+ or an already required module (<code>Object</code>). This enables usage of various Puppeteer
+ wrappers such as <code>puppeteer-extra</code>.</p>
+ <p> Take caution, because it can cause all kinds of unexpected errors and weird behavior.
+ Apify SDK is not tested with any other library besides <code>puppeteer</code> itself.</p>
+</td></tr><tr>
+<td><code>[stealth]</code></td><td><code>boolean</code></td><td></td>
+</tr>
+<tr>
+<td colspan="3"><p>This setting hides most of the know properties that identifies the headless Chrome and makes it nearly undetectable.
+ It is recommended to use it together with the <code>useChrome</code> set to <code>true</code>.</p>
+</td></tr><tr>
+<td><code>[stealthOptions]</code></td><td><code><a href="../typedefs/stealthoptions">StealthOptions</a></code></td><td></td>
+</tr>
+<tr>
+<td colspan="3"><p>Using this configuration, you can disable some of the hiding tricks.
+ For these settings to take effect <code>stealth</code> must be set to true</p>
</td></tr></tbody>
</table>
diff --cc src/puppeteer.js
index e51f213ec,1fbc35fbb..96b55a31c
--- a/src/puppeteer.js
+++ b/src/puppeteer.js
@@@ -62,15 -61,13 +62,19 @@@ const LAUNCH_PUPPETEER_DEFAULT_VIEWPOR
* will use the same target proxy server (i.e. the same IP address).
* The identifier can only contain the following characters: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
* Only applied if the `useApifyProxy` option is `true`.
- * @property {String} [puppeteerModule]
- * Require path to a module to be used instead of default `puppeteer`. This enables usage
- * of various Puppeteer wrappers such as `puppeteer-extra`.
+ * @property {string|Object} [puppeteerModule]
+ * Either a require path (`string`) to a package to be used instead of default `puppeteer`,
+ * or an already required module (`Object`). This enables usage of various Puppeteer
+ * wrappers such as `puppeteer-extra`.
+ *
+ * Take caution, because it can cause all kinds of unexpected errors and weird behavior.
+ * Apify SDK is not tested with any other library besides `puppeteer` itself.
+ * @property {boolean} [stealth]
+ * This setting hides most of the know properties that identifies the headless Chrome and makes it nearly undetectable.
+ * It is recommended to use it together with the `useChrome` set to `true`.
+ * @property {StealthOptions} [stealthOptions]
+ * Using this configuration, you can disable some of the hiding tricks.
+ * For these settings to take effect `stealth` must be set to true
*/
/**
@@@ -195,9 -191,7 +198,9 @@@ export const launchPuppeteer = async (o
checkParamOrThrow(options.args, 'options.args', 'Maybe [String]');
checkParamOrThrow(options.proxyUrl, 'options.proxyUrl', 'Maybe String');
checkParamOrThrow(options.useApifyProxy, 'options.useApifyProxy', 'Maybe Boolean');
- checkParamOrThrow(options.puppeteerModule, 'options.puppeteerModule', 'Maybe String');
+ checkParamOrThrow(options.puppeteerModule, 'options.puppeteerModule', 'Maybe String|Object');
+ checkParamOrThrow(options.stealth, 'options.stealth', 'Maybe Boolean');
+ checkParamOrThrow(options.stealthOptions, 'options.stealthOptions', 'Maybe Object');
if (options.useApifyProxy && options.proxyUrl) throw new Error('Cannot combine "options.useApifyProxy" with "options.proxyUrl"!');
if (options.liveView || options.liveViewOptions) {
log.deprecated('Live view is no longer available in Apify.launchPuppeteer() and launchPuppeteerOptions. '