puppeteer-real-browser
Advanced tools
Comparing version 1.3.5 to 1.3.6
@@ -7,25 +7,29 @@ const checkTurnstile = ({ page }) => { | ||
const elements = await page.$$('[name="cf-turnstile-response"]'); | ||
if (elements.length <= 0) { | ||
const coordinates = await page.evaluate(() => { | ||
let coordinates = []; | ||
document.querySelectorAll('div').forEach(item => { | ||
try { | ||
if (item.getAttribute('style').includes('padding') && item.getAttribute('style').includes('border') && item.getAttribute('style').includes('margin')) coordinates.push({ x: item.getBoundingClientRect().x, y: item.getBoundingClientRect().y, w: item.getBoundingClientRect().width, h: item.getBoundingClientRect().height }) | ||
} catch (err) { } | ||
}); | ||
return coordinates | ||
}) | ||
for (const item of coordinates) { | ||
try { | ||
let x = item.x + 30; | ||
let y = item.y + item.h / 2; | ||
await page.mouse.click(x, y); | ||
} catch (err) { } | ||
} | ||
return resolve(true) | ||
} | ||
if (elements.length <= 0) return resolve(false); | ||
for (const element of elements) { | ||
try { | ||
const parentElement = await element.evaluateHandle(el => el.parentElement); | ||
const box = await parentElement.boundingBox(); | ||
let x = box.x + 30; | ||
let y = box.y + box.height / 2; | ||
await page.realCursor.moveTo({ x, y }); | ||
await page.mouse.click(x, y); | ||
try { | ||
x += 30 | ||
await page.realCursor.moveTo({ x, y }); | ||
await page.mouse.click(x, y); | ||
} catch (err) { } | ||
try { | ||
x += 30 | ||
await page.realCursor.moveTo({ x, y }); | ||
await page.mouse.click(x, y); | ||
} catch (err) { } | ||
} catch (err) { } | ||
@@ -32,0 +36,0 @@ } |
{ | ||
"name": "puppeteer-real-browser", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"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,0 +5,0 @@ "main": "lib/cjs/index.js", |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
35728
510
0