Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Match TSPD snapshots and reCAPTCHA v3 fallback scores

Emre Sokullu14fd7bbe1607
diff --git a/docs/captcha-provider-coverage.md b/docs/captcha-provider-coverage.md
index f1c86185d..653db25e1 100644
--- a/docs/captcha-provider-coverage.md
+++ b/docs/captcha-provider-coverage.md
@@ -137,7 +137,7 @@ Use observed page parameters to prepare fallback tasks. Method IDs are WebBrain
Saved weights determine execution order, regardless of array order. Supply a task for each enabled provider that can solve that family and for which the required inputs are available. The tool does not invent another provider's parameters. Page URLs must belong to the active tab or an observed frame. Native methods do not automatically scrape every site's internal configuration.
-Provider-specific identifiers (for example `appId`/`app_id` and `miseryKey`/`misery_key`) must agree across fallback entries before any paid request. Recognition fallbacks must use the same image/audio and selection instruction. reCAPTCHA v2 fallbacks must also agree on `data-s` and visible/invisible mode when supplied.
+Provider-specific identifiers (for example `appId`/`app_id` and `miseryKey`/`misery_key`) must agree across fallback entries before any paid request. Recognition fallbacks must use the same image/audio and selection instruction; TSPD fallbacks must use the same captured page. reCAPTCHA v2 fallbacks must agree on `data-s` and visible/invisible mode, and reCAPTCHA v3 fallbacks on action and minimum score, when supplied.
`solution` remains structured: tokens, cookie values, GeeTest objects, coordinates, arrays of booleans, text, and provider-specific response fields are not coerced into a single token string. A synchronous ready response is consumed without a redundant polling request.
diff --git a/src/chrome/src/agent/captcha-native-providers.js b/src/chrome/src/agent/captcha-native-providers.js
index f4f6c7d52..e67bcc39a 100644
--- a/src/chrome/src/agent/captcha-native-providers.js
+++ b/src/chrome/src/agent/captcha-native-providers.js
@@ -115,7 +115,7 @@ const FAMILY_IDENTIFIERS = {
hunt: [['apiGetLib', 'metadata.apiGetLib'], ['data', 'metadata.data']],
imperva: [['incapsulaScriptUrl', 'metadata.incapsulaScriptUrl'],
['incapsulaCookies', 'metadata.incapsulaCookies'], ['reese84UrlEndpoint', 'metadata.reese84UrlEndpoint']],
- tspd: [['tspdCookie', 'metadata.tspdCookie']],
+ tspd: [['tspdCookie', 'metadata.tspdCookie'], ['htmlPageBase64', 'metadata.htmlPageBase64']],
binance: [['validateId']],
yidun: [['challenge'], ['hcg'], ['hct']],
hcaptcha: [['rqdata', 'data.rqdata']],
@@ -126,8 +126,8 @@ const FAMILY_IDENTIFIERS = {
friendly: [['version'], ['moduleScript', 'module_script'], ['nomoduleScript', 'nomodule_script']],
recaptcha_v2: [['recaptchaDataSValue', 'enterprisePayload.s', 'data-s', 'data.s']],
recaptcha_v2_enterprise: [['recaptchaDataSValue', 'enterprisePayload.s', 'data-s', 'data.s']],
- recaptcha_v3: [['pageAction', 'action', 'data.action']],
- recaptcha_v3_enterprise: [['pageAction', 'action', 'data.action']],
+ recaptcha_v3: [['pageAction', 'action', 'data.action'], ['minScore', 'min_score']],
+ recaptcha_v3_enterprise: [['pageAction', 'action', 'data.action'], ['minScore', 'min_score']],
turnstile: [
['action', 'pageAction', 'metadata.action', 'data.action'],
['data', 'cData', 'metadata.cdata', 'data.cdata', 'data.cData'],
diff --git a/src/firefox/src/agent/captcha-native-providers.js b/src/firefox/src/agent/captcha-native-providers.js
index f4f6c7d52..e67bcc39a 100644
--- a/src/firefox/src/agent/captcha-native-providers.js
+++ b/src/firefox/src/agent/captcha-native-providers.js
@@ -115,7 +115,7 @@ const FAMILY_IDENTIFIERS = {
hunt: [['apiGetLib', 'metadata.apiGetLib'], ['data', 'metadata.data']],
imperva: [['incapsulaScriptUrl', 'metadata.incapsulaScriptUrl'],
['incapsulaCookies', 'metadata.incapsulaCookies'], ['reese84UrlEndpoint', 'metadata.reese84UrlEndpoint']],
- tspd: [['tspdCookie', 'metadata.tspdCookie']],
+ tspd: [['tspdCookie', 'metadata.tspdCookie'], ['htmlPageBase64', 'metadata.htmlPageBase64']],
binance: [['validateId']],
yidun: [['challenge'], ['hcg'], ['hct']],
hcaptcha: [['rqdata', 'data.rqdata']],
@@ -126,8 +126,8 @@ const FAMILY_IDENTIFIERS = {
friendly: [['version'], ['moduleScript', 'module_script'], ['nomoduleScript', 'nomodule_script']],
recaptcha_v2: [['recaptchaDataSValue', 'enterprisePayload.s', 'data-s', 'data.s']],
recaptcha_v2_enterprise: [['recaptchaDataSValue', 'enterprisePayload.s', 'data-s', 'data.s']],
- recaptcha_v3: [['pageAction', 'action', 'data.action']],
- recaptcha_v3_enterprise: [['pageAction', 'action', 'data.action']],
+ recaptcha_v3: [['pageAction', 'action', 'data.action'], ['minScore', 'min_score']],
+ recaptcha_v3_enterprise: [['pageAction', 'action', 'data.action'], ['minScore', 'min_score']],
turnstile: [
['action', 'pageAction', 'metadata.action', 'data.action'],
['data', 'cData', 'metadata.cdata', 'data.cdata', 'data.cData'],
diff --git a/test/captcha-native-providers.mjs b/test/captcha-native-providers.mjs
index 7468ed36f..fa1255db4 100644
--- a/test/captcha-native-providers.mjs
+++ b/test/captcha-native-providers.mjs
@@ -248,7 +248,10 @@ for (const browser of ['chrome', 'firefox']) {
['reCAPTCHA v2 data-s', ['2captcha', 'RecaptchaV2TaskProxyless', { websiteURL: url, websiteKey: 'site', recaptchaDataSValue: 'observed' }], ['solvecaptcha', 'recaptcha_v2', { pageurl: url, googlekey: 'site', 'data-s': 'observed' }], 'data-s'],
['reCAPTCHA v2 enterprise data-s', ['2captcha', 'RecaptchaV2EnterpriseTaskProxyless', { websiteURL: url, websiteKey: 'site', enterprisePayload: { s: 'observed' } }], ['solvecaptcha', 'recaptcha_v2_enterprise', { pageurl: url, googlekey: 'site', 'data-s': 'observed' }], 'data-s'],
['reCAPTCHA v2 nested data-s', ['2captcha', 'RecaptchaV2TaskProxyless', { websiteURL: url, websiteKey: 'site', recaptchaDataSValue: 'observed' }], ['nopecha', 'token/recaptcha2', { url, sitekey: 'site', data: { s: 'observed' } }], 'data.s'],
- ['reCAPTCHA v3 action', ['2captcha', 'RecaptchaV3TaskProxyless', { websiteURL: url, websiteKey: 'site', minScore: 0.3, pageAction: 'login' }], ['solvecaptcha', 'recaptcha_v3', { pageurl: url, googlekey: 'site', action: 'login' }], 'action'],
+ ['reCAPTCHA v3 action', ['2captcha', 'RecaptchaV3TaskProxyless', { websiteURL: url, websiteKey: 'site', minScore: 0.3, pageAction: 'login' }], ['solvecaptcha', 'recaptcha_v3', { pageurl: url, googlekey: 'site', action: 'login', min_score: 0.3 }], 'action'],
+ ['reCAPTCHA v3 score', ['2captcha', 'RecaptchaV3TaskProxyless', { websiteURL: url, websiteKey: 'site', minScore: 0.9, pageAction: 'login' }], ['solvecaptcha', 'recaptcha_v3', { pageurl: url, googlekey: 'site', action: 'login', min_score: 0.9 }], 'min_score'],
+ ['reCAPTCHA v3 enterprise score', ['2captcha', 'RecaptchaV3TaskProxyless:enterprise', { websiteURL: url, websiteKey: 'site', minScore: 0.9, pageAction: 'login' }], ['solvecaptcha', 'recaptcha_v3:enterprise', { pageurl: url, googlekey: 'site', action: 'login', min_score: 0.9 }], 'min_score'],
+ ['TSPD page snapshot', ['2captcha', 'TspdTask', { websiteURL: url, tspdCookie: 'cookie', htmlPageBase64: 'PAGE-A', proxyType: 'http', proxyAddress: 'proxy.test', proxyPort: 8080, userAgent: 'browser-UA' }], ['capmonster', 'CustomTask:tspd', { websiteURL: url, metadata: { tspdCookie: 'cookie', htmlPageBase64: 'PAGE-A' }, proxyType: 'http', proxyAddress: 'proxy.test', proxyPort: 8080, userAgent: 'browser-UA' }], 'metadata.htmlPageBase64'],
['reCAPTCHA v3 enterprise action', ['capsolver', 'ReCaptchaV3EnterpriseTaskProxyLess', { websiteURL: url, websiteKey: 'site', pageAction: 'login' }], ['nopecha', 'token/recaptcha3:enterprise', { url, sitekey: 'site', data: { action: 'login' } }], 'data.action'],
['Turnstile action', ['capsolver', 'AntiTurnstileTaskProxyLess', { websiteURL: url, websiteKey: 'site', metadata: { action: 'login', cdata: 'widget' } }], ['anti-captcha', 'TurnstileTaskProxyless', { websiteURL: url, websiteKey: 'site', action: 'login', cData: 'widget' }], 'action'],
['Turnstile cData', ['2captcha', 'TurnstileTaskProxyless', { websiteURL: url, websiteKey: 'site', action: 'login', data: 'widget' }], ['anti-captcha', 'TurnstileTaskProxyless', { websiteURL: url, websiteKey: 'site', action: 'login', cData: 'widget' }], 'cData'],
@@ -263,7 +266,7 @@ for (const browser of ['chrome', 'firefox']) {
const path = changed.split('.');
let target = entries[1].parameters;
for (const part of path.slice(0, -1)) target = target[part];
- target[path.at(-1)] = changed === 'proxy' ? 'other.test:8080' : 'different';
+ target[path.at(-1)] = changed === 'proxy' ? 'other.test:8080' : changed === 'min_score' ? 0.3 : 'different';
assert.throws(() => native.prepareNativeCaptchaTasks(enabled, entries), /same observed challenge|same proxy identity/);
assert.equal(calls.length, 0);
});
@@ -286,7 +289,11 @@ for (const browser of ['chrome', 'firefox']) {
]],
['reCAPTCHA v3 omitted action', [
{ provider: '2captcha', method: 'RecaptchaV3TaskProxyless', parameters: { websiteURL: url, websiteKey: 'site', minScore: 0.3, pageAction: 'delete' } },
- { provider: 'solvecaptcha', method: 'recaptcha_v3', parameters: { pageurl: url, googlekey: 'site' } },
+ { provider: 'solvecaptcha', method: 'recaptcha_v3', parameters: { pageurl: url, googlekey: 'site', min_score: 0.3 } },
+ ]],
+ ['reCAPTCHA v3 omitted score', [
+ { provider: '2captcha', method: 'RecaptchaV3TaskProxyless', parameters: { websiteURL: url, websiteKey: 'site', minScore: 0.9, pageAction: 'login' } },
+ { provider: 'solvecaptcha', method: 'recaptcha_v3', parameters: { pageurl: url, googlekey: 'site', action: 'login' } },
]],
['Turnstile omitted cData', [
{ provider: '2captcha', method: 'TurnstileTaskProxyless', parameters: { websiteURL: url, websiteKey: 'site', data: 'observed-cdata' } },