brave-real-browser 2.0.5 → 2.0.6
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.
|
@@ -12,6 +12,25 @@ async function pageController({ browser, page, proxy, turnstile, xvfbsession, pi
|
|
|
12
12
|
|
|
13
13
|
let solveStatus = turnstile
|
|
14
14
|
|
|
15
|
+
// 🛡️ Import stealth scripts properly (Dynamic Import for compatibility)
|
|
16
|
+
let injectStealth = () => { };
|
|
17
|
+
try {
|
|
18
|
+
const stealthModule = require('brave-real-puppeteer-core/scripts/stealth-injector.js');
|
|
19
|
+
// Combine essential stealth scripts
|
|
20
|
+
const ultrafast = stealthModule.injectUltraFastPerformance();
|
|
21
|
+
const navStealth = stealthModule.injectNavigatorStealth();
|
|
22
|
+
injectStealth = async (page) => {
|
|
23
|
+
await page.evaluateOnNewDocument(ultrafast);
|
|
24
|
+
await page.evaluateOnNewDocument(navStealth);
|
|
25
|
+
};
|
|
26
|
+
} catch (e) {
|
|
27
|
+
// Fallback if module not found (shouldn't happen in monorepo)
|
|
28
|
+
console.error('Stealth module not found, using minimal fallback', e);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Apply stealth BEFORE any other page actions
|
|
32
|
+
if (page) await injectStealth(page);
|
|
33
|
+
|
|
15
34
|
page.on('close', () => {
|
|
16
35
|
solveStatus = false
|
|
17
36
|
});
|
|
@@ -12,6 +12,22 @@ export async function pageController({ browser, page, proxy, turnstile, xvfbsess
|
|
|
12
12
|
|
|
13
13
|
let solveStatus = turnstile
|
|
14
14
|
|
|
15
|
+
// 🛡️ Import stealth scripts properly (Dynamic Import for compatibility)
|
|
16
|
+
let injectStealth = () => { };
|
|
17
|
+
try {
|
|
18
|
+
// Use dynamic import for ESM
|
|
19
|
+
const { injectUltraFastPerformance, injectNavigatorStealth } = await import('brave-real-puppeteer-core/scripts/stealth-injector.js');
|
|
20
|
+
injectStealth = async (page) => {
|
|
21
|
+
await page.evaluateOnNewDocument(injectUltraFastPerformance());
|
|
22
|
+
await page.evaluateOnNewDocument(injectNavigatorStealth());
|
|
23
|
+
};
|
|
24
|
+
} catch (e) {
|
|
25
|
+
console.error('Stealth module not found, using minimal fallback', e);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Apply stealth BEFORE any other page actions
|
|
29
|
+
if (page) await injectStealth(page);
|
|
30
|
+
|
|
15
31
|
page.on('close', () => {
|
|
16
32
|
solveStatus = false
|
|
17
33
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-browser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "This package is designed to bypass puppeteer's bot-detecting captchas such as Cloudflare. It acts like a real browser and can be managed with puppeteer.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.mjs",
|