brave-real-browser 1.5.94 → 1.5.95

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-browser",
3
- "version": "1.5.94",
3
+ "version": "1.5.95",
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",
package/test/cjs/test.js CHANGED
@@ -87,9 +87,23 @@ test('Cloudflare Turnstile', async () => {
87
87
  test('Fingerprint JS Bot Detector', async () => {
88
88
  const { page, browser } = await connect(realBrowserOption)
89
89
  await page.goto("https://fingerprint.com/products/bot-detection/");
90
- await new Promise(r => setTimeout(r, 5000));
90
+
91
+ // Wait for the bot detection section to load
92
+ await page.waitForSelector('.HeroSection-module--botSubTitle--2711e', { timeout: 15000 });
93
+
94
+ // Give extra time for bot detection to complete
95
+ await new Promise(r => setTimeout(r, 7000));
96
+
91
97
  const detect = await page.evaluate(() => {
92
- return document.querySelector('.HeroSection-module--botSubTitle--2711e').textContent.includes("not") ? true : false
98
+ const element = document.querySelector('.HeroSection-module--botSubTitle--2711e');
99
+ if (!element) {
100
+ console.log('Bot detection element not found');
101
+ return false;
102
+ }
103
+ const textContent = element.textContent.toLowerCase();
104
+ console.log('Bot detection text:', textContent);
105
+ // Check if text contains "not" which indicates we are not detected as a bot
106
+ return textContent.includes("not") ? true : false;
93
107
  })
94
108
  await browser.close()
95
109
  assert.strictEqual(detect, true, "Fingerprint JS Bot Detector test failed!")
package/test/esm/test.js CHANGED
@@ -90,9 +90,23 @@ test('Cloudflare Turnstile', async () => {
90
90
  test('Fingerprint JS Bot Detector', async () => {
91
91
  const { page, browser } = await connect(realBrowserOption)
92
92
  await page.goto("https://fingerprint.com/products/bot-detection/");
93
- await new Promise(r => setTimeout(r, 5000));
93
+
94
+ // Wait for the bot detection section to load
95
+ await page.waitForSelector('.HeroSection-module--botSubTitle--2711e', { timeout: 15000 });
96
+
97
+ // Give extra time for bot detection to complete
98
+ await new Promise(r => setTimeout(r, 7000));
99
+
94
100
  const detect = await page.evaluate(() => {
95
- return document.querySelector('.HeroSection-module--botSubTitle--2711e').textContent.includes("not") ? true : false
101
+ const element = document.querySelector('.HeroSection-module--botSubTitle--2711e');
102
+ if (!element) {
103
+ console.log('Bot detection element not found');
104
+ return false;
105
+ }
106
+ const textContent = element.textContent.toLowerCase();
107
+ console.log('Bot detection text:', textContent);
108
+ // Check if text contains "not" which indicates we are not detected as a bot
109
+ return textContent.includes("not") ? true : false;
96
110
  })
97
111
  await browser.close()
98
112
  assert.strictEqual(detect, true, "Fingerprint JS Bot Detector test failed!")