You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using puppeteer-extra-plugin-recaptcha with 2captcha for a several monthes, and some time ago it stopped working, I did not make any changes in project. Now I enabled logs and saw next:
I assume you are using the rebrowser puppeteer runtime leak patches in alwaysIsolated mode.
Somewhere it reads that page.waitForFunction will not work in this case.
But node_modules/puppeteer-extra-plugin-recaptcha/dist/index.js is using page.waitForFunction as a convenience to wait for captchas to be fully loaded.
You can fix your problem by commenting out the waitForFunction block and make sure (by manually waiting a bit) that captchas are fully loaded.
async findRecaptchas(page) {
this.debug('findRecaptchas');
// As this might be called very early while recaptcha is still loading
// we add some extra waiting logic for developer convenience.
const hasRecaptchaScriptTag = await page.$(`script[src*="/recaptcha/api.js"], script[src*="/recaptcha/enterprise.js"]`);
this.debug('hasRecaptchaScriptTag', !!hasRecaptchaScriptTag);
/*
if (hasRecaptchaScriptTag) {
this.debug('waitForRecaptchaClient - start', new Date());
await page
.waitForFunction(`
(function() {
return Object.keys((window.___grecaptcha_cfg || {}).clients || {}).length
})()
`, { polling: 200, timeout: 10 * 1000 })
.catch(this.debug);
this.debug('waitForRecaptchaClient - end', new Date()); // used as timer
}
*/
const hasHcaptchaScriptTag = await page.$(`script[src*="hcaptcha.com/1/api.js"]`);
this.debug('hasHcaptchaScriptTag', !!hasHcaptchaScriptTag);
/*
if (hasHcaptchaScriptTag) {
this.debug('wait:hasHcaptchaScriptTag - start', new Date());
await page.waitForFunction(`
(function() {
return window.hcaptcha
})()
`, { polling: 200, timeout: 10 * 1000 });
this.debug('wait:hasHcaptchaScriptTag - end', new Date()); // used as timer
}
*/
const onDebugBindingCalled = (message, data) => {
this.contentScriptDebug(message, data);
};
I was using
puppeteer-extra-plugin-recaptcha
with 2captcha for a several monthes, and some time ago it stopped working, I did not make any changes in project. Now I enabled logs and saw next:On a screenshot I see cloudflare captcha
The text was updated successfully, but these errors were encountered: