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.

renamed function

Petr Patek6514251693d7
diff --git a/docs/typedefs/stealthOptions.md b/docs/typedefs/stealthOptions.md
index 071ce698c..4e3d311de 100644
--- a/docs/typedefs/stealthOptions.md
+++ b/docs/typedefs/stealthOptions.md
@@ -56,7 +56,7 @@ These tricks are applied only when the `stealth` option is set to `true`.
<tr>
<td colspan="3"><p>Adds the chrome runtime properties.</p>
</td></tr><tr>
-<td><code>[mocksChromeInIframe]</code></td><td><code>boolean</code></td><td><code>true</code></td>
+<td><code>[mockChromeInIframe]</code></td><td><code>boolean</code></td><td><code>true</code></td>
</tr>
<tr>
<td colspan="3"><p>Adds the chrome runtime properties inside the every newly created iframe.</p>
diff --git a/src/stealth/hiding_tricks.js b/src/stealth/hiding_tricks.js
index 2d2b1c9f7..2e55be73a 100644
--- a/src/stealth/hiding_tricks.js
+++ b/src/stealth/hiding_tricks.js
@@ -293,7 +293,7 @@ const mockChrome = () => {
// not sure if this hack does not broke iframe on websites... Should figure out how to test properly
// Should cover that it is custom function same as the permission query
-const mocksChromeInIframe = () => {
+const mockChromeInIframe = () => {
const oldCreate = document.createElement.bind(document);
const newCreate = (...args) => {
if (args[0] === 'iframe') {
@@ -361,6 +361,6 @@ export default {
hideWebDriver,
hackPermissions,
mockChrome,
- mocksChromeInIframe,
+ mockChromeInIframe,
mockDeviceMemory,
};
diff --git a/src/stealth/stealth.js b/src/stealth/stealth.js
index 0890a1fe8..f5fb22b18 100644
--- a/src/stealth/stealth.js
+++ b/src/stealth/stealth.js
@@ -13,7 +13,7 @@ import hidingTricks from './hiding_tricks';
* @property {boolean} [hideWebDriver=true] - Hides the webdriver by changing the navigator proto.
* @property {boolean} [hackPermissions=true] - Fakes interaction with permissions.
* @property {boolean} [mockChrome=true] - Adds the chrome runtime properties.
- * @property {boolean} [mocksChromeInIframe=true] - Adds the chrome runtime properties inside the every newly created iframe.
+ * @property {boolean} [mockChromeInIframe=true] - Adds the chrome runtime properties inside the every newly created iframe.
* @property {boolean} [mockDeviceMemory=true] - Sets device memory to other value than 0.
*/
@@ -26,7 +26,7 @@ const DEFAULT_STEALTH_OPTIONS = {
hideWebDriver: true,
hackPermissions: true,
mockChrome: true,
- mocksChromeInIframe: true,
+ mockChromeInIframe: true,
mockDeviceMemory: true,
};
diff --git a/test/stealth/stealth.js b/test/stealth/stealth.js
index f4ea8b6f6..8f05bdfdf 100644
--- a/test/stealth/stealth.js
+++ b/test/stealth/stealth.js
@@ -24,7 +24,7 @@ describe('Stealth - testing headless chrome hiding tricks', () => {
hideWebDriver: false,
hackPermissions: false,
mockChrome: false,
- mocksChromeInIframe: false,
+ mockChromeInIframe: false,
mockDeviceMemory: false,
},
headless: true,