Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) đź§ 

Add Solvecha as captcha provider

Marin Mimir Workerdaf2ea952782
diff --git a/docs/captcha-method-reference.md b/docs/captcha-method-reference.md
index 60653a628..43399cf0a 100644
--- a/docs/captcha-method-reference.md
+++ b/docs/captcha-method-reference.md
@@ -1,6 +1,6 @@
# CAPTCHA native method reference
-Companion to [CAPTCHA provider coverage](captcha-provider-coverage.md). Contracts rechecked 2026-10-01. Generated from the executable catalog; 198 method variants across seven providers. Method IDs select an adapter contract, not an arbitrary upstream task type. Fixed values are added automatically. Fields use dot paths for nested objects; pass nested JSON, not literal dotted keys.
+Companion to [CAPTCHA provider coverage](captcha-provider-coverage.md). Contracts rechecked 2026-10-01. Generated from the executable catalog; 203 method variants across eight providers. Method IDs select an adapter contract, not an arbitrary upstream task type. Fixed values are added automatically. Fields use dot paths for nested objects; pass nested JSON, not literal dotted keys.
Required fields below are unconditional. GeeTest v3 additionally needs `gt` and a fresh `challenge`; v4 needs its provider-specific CAPTCHA ID. AWS WAF variants, proxy authentication, alternate image inputs, and VisionEngine module-specific fields have conditional requirements described in the guide and official documentation. Every submitted value must come from the selected challenge.
@@ -1610,3 +1610,45 @@ Family: `hcaptcha`. [Official contract](https://nonecap.com/api-reference/).
- Required: `sitekey` (string), `url` (string).
- Optional: `rqdata` (string), `proxy` (object or string).
- Fixed wire values: `{"type":"hcaptcha_enterprise"}`. Route: `/v1/solves`.
+
+## solvecha (5 variants)
+
+### recognition/funcaptcha
+
+Family: `funcaptcha_recognition`. [Official contract](https://solvecha.com/docs).
+
+- Required: `task` (string), `image_data` (array).
+- Optional: None.
+- Fixed wire values: `{}`. Route: `/v1/recognition/funcaptcha`.
+
+### recognition/funcaptcha_match
+
+Family: `funcaptcha_match`. [Official contract](https://solvecha.com/docs).
+
+- Required: `task` (string), `image_data` (array).
+- Optional: None.
+- Fixed wire values: `{}`. Route: `/v1/recognition/funcaptcha_match`.
+
+### recognition/geetest
+
+Family: `geetest_recognition`. [Official contract](https://solvecha.com/docs).
+
+- Required: `task` (string), `image_data` (array).
+- Optional: None.
+- Fixed wire values: `{}`. Route: `/v1/recognition/geetest`.
+
+### recognition/recaptcha
+
+Family: `recaptcha_recognition`. [Official contract](https://solvecha.com/docs).
+
+- Required: `task` (string), `grid` (string|null), `image_data` (array).
+- Optional: None.
+- Fixed wire values: `{}`. Route: `/v1/recognition/recaptcha`.
+
+### recognition/textcaptcha
+
+Family: `image_to_text`. [Official contract](https://solvecha.com/docs).
+
+- Required: `image_data` (array).
+- Optional: None.
+- Fixed wire values: `{}`. Route: `/v1/recognition/textcaptcha`.
diff --git a/docs/captcha-provider-coverage.md b/docs/captcha-provider-coverage.md
index d488cc5c2..c4e82df36 100644
--- a/docs/captcha-provider-coverage.md
+++ b/docs/captcha-provider-coverage.md
@@ -2,7 +2,7 @@
Initial catalog audit: **2026-09-29**. Integration contracts rechecked against first-party documentation on **2026-10-01**. Chrome and Firefox share the provider catalog, request validation, transports, and result handling; their browser execution adapters remain platform-specific.
-This integration exposes **seven providers and 198 catalog method variants**. A method variant can be a proxy/proxyless route, an Enterprise option, a recognition model, or a separate response mode. It is not a claim that there are 198 CAPTCHA products.
+This integration exposes **eight providers and 203 catalog method variants**. A method variant can be a proxy/proxyless route, an Enterprise option, a recognition model, or a separate response mode. It is not a claim that there are 198 CAPTCHA products.
“Integrated” means WebBrain can validate the method's input, submit its documented request, poll when needed, and preserve its answer. It does **not** mean every website exposes the required parameters, that a token is accepted, or that authenticated live success rates have been measured. This implementation was checked with provider-contract fixtures and browser tests; no paid live solves were performed.
@@ -38,6 +38,7 @@ Open the provider's collapsed **Advanced** section to change its weight. Any num
| Anti-Captcha | 96 | `antiCaptchaApiKey` | `antiCaptchaEnabled` | Provider account balance |
| NopeCHA | 95 | `nopechaApiKey` | `nopechaEnabled` | Credits |
| NoneCap | 94 | `nonecapApiKey` | `nonecapEnabled` | Credits |
+| Solvecha | 93 | `solvechaApiKey` | `solvechaEnabled` | Provider account balance |
CAPTCHA discovery, solving, and application tools are available only in **Act/Dev with Mid or Full tiers**. Ask never exposes these tools or receives solving instructions. Compact asks for manual completion and permits `done({outcome:"partial"})` for blocked work; Dev itself requires Mid or Full.
@@ -56,6 +57,7 @@ All families below have a callable native route. The [complete method reference]
| **[Anti-Captcha](https://anti-captcha.com/apidoc)** | reCAPTCHA v2/v3 and Enterprise; Turnstile; GeeTest v3/v4; FunCaptcha; AWS WAF; Altcha; Friendly Captcha; Prosopo; image text; image coordinates; AntiGate template tasks. |
| **[NopeCHA](https://nopecha.com/api-reference/)** | hCaptcha, reCAPTCHA v2/v3 (including Enterprise metadata), and Turnstile tokens; AWS audio, FunCaptcha tiles/matching, GeeTest, hCaptcha binary/area/drag-drop, Lemin, reCAPTCHA, and image-text recognition. |
| **[NoneCap](https://nonecap.com/api-reference/)** | hCaptcha and hCaptcha Enterprise tokens; `rqdata`, proxy input, returned response key and solver User-Agent. |
+| **[Solvecha](https://solvecha.com/docs)** | Image-based recognition only: image-text CAPTCHAs, plus reCAPTCHA, FunCaptcha, FunCaptcha matching and GeeTest image recognition. No token tasks (reCAPTCHA, hCaptcha, Turnstile, GeeTest, FunCaptcha tokens). Uses the NopeCHA-compatible `/v1/recognition/*` routes with Bearer authentication; image-text also works through the automatic route. |
CapMonster's ten ComplexImage models are `bills_audio`, `shein`, `bls`, `baidu`, `betpunch_3x3_rotate`, `oocl_rotate_double_new`, `oocl_rotate_new`, `dli_ensemble`, `mathsum`, and `portugal_text_find_icon`. Their `metadata.Task` values and recognition class are assigned by the adapter. The DLI, MathSum, and BLS methods send `dli`, `MathSum`, and `bls_3x3` respectively; audio sends `PayloadType: "Audio"`. CapSolver VisionEngine accepts the provider's documented module field, including slider, rotation, BotDeflector, Shein, and GIF OCR modes. Modules requiring a second image must receive it.
@@ -255,9 +257,9 @@ The CAPTCHA gate permits `done` with `outcome: "failed"` or `"partial"` in every
Both browser trees contain:
- `src/agent/captcha-provider-config.js`: key formats, consent, default weights, automatic and native coverage.
-- `src/agent/captcha-catalog.js`: the 198 method contracts and primary documentation links.
+- `src/agent/captcha-catalog.js`: the 203 method contracts and primary documentation links.
- `src/agent/captcha-native-providers.js`: discovery, preflight, fixed-value mapping, native fallback, and structured results.
-- `src/agent/captcha-hcaptcha-providers.js`: NopeCHA/NoneCap v1 transports and automatic hCaptcha mapping.
+- `src/agent/captcha-hcaptcha-providers.js`: NopeCHA/NoneCap v1 transports (the NopeCHA-compatible recognition lifecycle is shared with Solvecha) and automatic hCaptcha mapping.
- `src/agent/captcha-solver.js`, `captcha-additional-providers.js`, `two-captcha.js`, `captcha-json-api.js`: automatic routes and shared request/poll lifecycles.
- `src/agent/captcha-solution-application.js`: bound answer application, browser-specific execution, and cookie-store scoping.
- `src/ui/captcha-settings.js` and `src/ui/locales/captcha-copy.mjs`: consent/weight controls, coverage text, balance display, and localized UI copy.
diff --git a/src/chrome/src/agent/captcha-additional-providers.js b/src/chrome/src/agent/captcha-additional-providers.js
index 099560a83..4026a44fb 100644
--- a/src/chrome/src/agent/captcha-additional-providers.js
+++ b/src/chrome/src/agent/captcha-additional-providers.js
@@ -15,6 +15,8 @@ export function buildAdditionalCaptchaTask(id, task) {
if (mapped.type?.startsWith('RecaptchaV2')) delete mapped.userAgent;
return mapped;
}
+ // Solvecha accepts the same ImageToTextTask body as the other JSON providers.
+ if (id === 'solvecha') return mapped;
if (id !== 'capmonster') throw new Error(`Unknown CAPTCHA provider: ${id}`);
if (task.type === 'AntiTurnstileTaskProxyLess') {
const { action, pagedata, ...rest } = mapped;
@@ -93,6 +95,7 @@ async function solveWithSolveCaptcha(apiKey, task) {
const JSON_PROVIDERS = {
capmonster: { base: 'https://api.capmonster.cloud', name: 'CapMonster Cloud' },
'anti-captcha': { base: 'https://api.anti-captcha.com', name: 'Anti-Captcha' },
+ solvecha: { base: 'https://api.solvecha.com', name: 'Solvecha' },
};
export async function getAdditionalCaptchaBalance(id, apiKey) {
if (['nopecha', 'nonecap'].includes(id)) return getHcaptchaProviderBalance(id, apiKey);
diff --git a/src/chrome/src/agent/captcha-catalog.js b/src/chrome/src/agent/captcha-catalog.js
index 10a9d4f0e..a1d52c361 100644
--- a/src/chrome/src/agent/captcha-catalog.js
+++ b/src/chrome/src/agent/captcha-catalog.js
@@ -199,5 +199,10 @@ export const CAPTCHA_CATALOG = [
{"provider":"anti-captcha","method":"RecaptchaV3TaskProxyless:enterprise","family":"recaptcha_v3_enterprise","fields":{"websiteURL":{"type":"string","required":true},"websiteKey":{"type":"string","required":true},"minScore":{"type":"number","required":true},"pageAction":{"type":"string","required":false},"apiDomain":{"type":"string","required":false}},"fixed":{"type":"RecaptchaV3TaskProxyless","isEnterprise":true},"docs":"https://anti-captcha.com/apidoc/task-types/RecaptchaV3TaskProxyless"},
{"provider":"solvecaptcha","method":"recaptcha_v3:enterprise","family":"recaptcha_v3_enterprise","fields":{"googlekey":{"type":"string","required":true},"pageurl":{"type":"string","required":true},"domain":{"type":"string","required":false},"action":{"type":"string","required":false},"min_score":{"type":"number","required":false},"proxy":{"type":"string","required":false},"proxytype":{"type":"string","required":false},"cookies":{"type":"string","required":false},"userAgent":{"type":"string","required":false}},"fixed":{"method":"userrecaptcha","version":"v3","enterprise":1},"docs":"https://solvecaptcha.com/captcha-solver-api"},
{"provider":"nopecha","method":"token/recaptcha2:enterprise","family":"recaptcha_v2_enterprise","fields":{"sitekey":{"type":"string","required":true},"url":{"type":"string","required":true},"proxy":{"type":"object","required":false},"cookie":{"type":"array","required":false},"useragent":{"type":"string","required":false},"data":{"type":"object","required":false}},"fixed":{"data.enterprise":true},"docs":"https://nopecha.com/api-reference/","path":"/v1/token/recaptcha2"},
- {"provider":"nopecha","method":"token/recaptcha3:enterprise","family":"recaptcha_v3_enterprise","fields":{"sitekey":{"type":"string","required":true},"url":{"type":"string","required":true},"proxy":{"type":"object","required":false},"cookie":{"type":"array","required":false},"useragent":{"type":"string","required":false},"data":{"type":"object","required":false}},"fixed":{"data.enterprise":true},"docs":"https://nopecha.com/api-reference/","path":"/v1/token/recaptcha3"}
+ {"provider":"nopecha","method":"token/recaptcha3:enterprise","family":"recaptcha_v3_enterprise","fields":{"sitekey":{"type":"string","required":true},"url":{"type":"string","required":true},"proxy":{"type":"object","required":false},"cookie":{"type":"array","required":false},"useragent":{"type":"string","required":false},"data":{"type":"object","required":false}},"fixed":{"data.enterprise":true},"docs":"https://nopecha.com/api-reference/","path":"/v1/token/recaptcha3"},
+ {"provider":"solvecha","method":"recognition/funcaptcha","family":"funcaptcha_recognition","fields":{"task":{"type":"string","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/funcaptcha"},
+ {"provider":"solvecha","method":"recognition/funcaptcha_match","family":"funcaptcha_match","fields":{"task":{"type":"string","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/funcaptcha_match"},
+ {"provider":"solvecha","method":"recognition/geetest","family":"geetest_recognition","fields":{"task":{"type":"string","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/geetest"},
+ {"provider":"solvecha","method":"recognition/recaptcha","family":"recaptcha_recognition","fields":{"task":{"type":"string","required":true},"grid":{"type":"string|null","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/recaptcha"},
+ {"provider":"solvecha","method":"recognition/textcaptcha","family":"image_to_text","fields":{"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/textcaptcha"},
];
diff --git a/src/chrome/src/agent/captcha-hcaptcha-providers.js b/src/chrome/src/agent/captcha-hcaptcha-providers.js
index a8cc479c9..ee12d7b45 100644
--- a/src/chrome/src/agent/captcha-hcaptcha-providers.js
+++ b/src/chrome/src/agent/captcha-hcaptcha-providers.js
@@ -1,7 +1,7 @@
// Current contracts: https://nopecha.com/api-reference/ and
// https://nonecap.com/api-reference/. Token and recognition transports share the documented v1 lifecycle.
-const API_BASES = { nopecha: 'https://api.nopecha.com', nonecap: 'https://api.nonecap.com' };
-const NAMES = { nopecha: 'NopeCHA', nonecap: 'NoneCap' };
+const API_BASES = { nopecha: 'https://api.nopecha.com', nonecap: 'https://api.nonecap.com', solvecha: 'https://api.solvecha.com' };
+const NAMES = { nopecha: 'NopeCHA', nonecap: 'NoneCap', solvecha: 'Solvecha' };
const POLL_MS = 2000;
const TIMEOUT_MS = 180_000;
@@ -21,7 +21,7 @@ async function request(id, apiKey, path, { body, timeoutMs = 30_000, allowPendin
// terminal even if their body happens to contain a pending code.
const code = result.code ?? result.error?.code ?? result.error;
const incomplete = code === 14 || code === '14';
- if (allowPending && !body && id === 'nopecha' && incomplete
+ if (allowPending && !body && id !== 'nonecap' && incomplete
&& (response.ok || response.status === 409)) return null;
if (!response.ok || result.error || result.code) {
const message = String(result.error?.message || result.message || result.error?.code || 'Request failed')
@@ -70,21 +70,23 @@ export async function getHcaptchaProviderBalance(id, apiKey) {
return { balance, unit: 'credits' };
}
-export async function solveNopechaTask(apiKey, path, body) {
- if (!/^\/v1\/(token|recognition)\/[a-z0-9_]+$/.test(path)) throw new Error('Invalid NopeCHA solving route.');
- const created = await request('nopecha', apiKey, path, { body });
+export async function solveNopechaTask(apiKey, path, body, id = 'nopecha') {
+ const name = NAMES[id];
+ // Solvecha implements only the NopeCHA-compatible recognition routes.
+ if (!/^\/v1\/(token|recognition)\/[a-z0-9_]+$/.test(path) || (id === 'solvecha' && !path.startsWith('/v1/recognition/'))) throw new Error(`Invalid ${name} solving route.`);
+ const created = await request(id, apiKey, path, { body });
const taskId = created.data;
- if (typeof taskId !== 'string' || !taskId.trim()) throw new Error('NopeCHA: missing task ID.');
+ if (typeof taskId !== 'string' || !taskId.trim()) throw new Error(`${name}: missing task ID.`);
const deadline = Date.now() + TIMEOUT_MS;
while (Date.now() + POLL_MS < deadline) {
await new Promise(resolve => setTimeout(resolve, POLL_MS));
- const result = await request('nopecha', apiKey, `${path}?id=${encodeURIComponent(taskId)}`, { allowPending: true, timeoutMs: Math.min(30_000, deadline - Date.now()) });
+ const result = await request(id, apiKey, `${path}?id=${encodeURIComponent(taskId)}`, { allowPending: true, timeoutMs: Math.min(30_000, deadline - Date.now()) });
if (!result) continue;
- if (path.includes('/token/') && (typeof result.data !== 'string' || !result.data.trim())) throw new Error('NopeCHA: missing solution token.');
- if (result.data == null) throw new Error('NopeCHA: missing recognition result.');
+ if (path.includes('/token/') && (typeof result.data !== 'string' || !result.data.trim())) throw new Error(`${name}: missing solution token.`);
+ if (result.data == null) throw new Error(`${name}: missing recognition result.`);
return { taskId, solution: result.data };
}
- throw new Error('NopeCHA: timed out waiting for solution.');
+ throw new Error(`${name}: timed out waiting for solution.`);
}
export async function solveNonecapTask(apiKey, body) {
diff --git a/src/chrome/src/agent/captcha-native-providers.js b/src/chrome/src/agent/captcha-native-providers.js
index f0c1c80df..016ce3c78 100644
--- a/src/chrome/src/agent/captcha-native-providers.js
+++ b/src/chrome/src/agent/captcha-native-providers.js
@@ -159,10 +159,10 @@ export function buildNativeCaptchaTask(entry) {
if (entry.provider === 'nopecha' && object(task.proxy)) {
if (!['http','https','socks4','socks5'].includes(task.proxy.scheme) || !task.proxy.host || !task.proxy.port) throw new Error('NopeCHA proxy requires scheme, host, and port.');
}
- if (entry.provider === 'nopecha' && ['recognition/awscaptcha','recognition/funcaptcha','recognition/textcaptcha'].includes(entry.method)) {
+ if (['nopecha', 'solvecha'].includes(entry.provider) && ['recognition/awscaptcha','recognition/funcaptcha','recognition/textcaptcha'].includes(entry.method)) {
if ((task.audio_data || task.image_data)?.length !== 1) throw new Error(`${entry.method} requires exactly one input.`);
}
- if (entry.provider === 'nopecha' && entry.method === 'recognition/recaptcha' && ![null,'1x1','3x3','4x4'].includes(task.grid)) throw new Error('Invalid reCAPTCHA recognition grid.');
+ if (['nopecha', 'solvecha'].includes(entry.provider) && entry.method === 'recognition/recaptcha' && ![null,'1x1','3x3','4x4'].includes(task.grid)) throw new Error('Invalid reCAPTCHA recognition grid.');
return { contract, task, family: effectiveCaptchaFamily(contract, task) };
}
@@ -538,7 +538,7 @@ export async function solveNativeCaptchaTasks(prepared, { onAttempt } = {}) {
const result = JSON_BASES[provider.id]
? await solveJsonCaptcha(JSON_BASES[provider.id], provider.id, provider.apiKey, task,
provider.id === 'capsolver' ? { pendingStatuses: ['idle', 'processing'] } : {})
- : provider.id === 'nopecha' ? await solveNopechaTask(provider.apiKey, contract.path, task)
+ : ['nopecha', 'solvecha'].includes(provider.id) ? await solveNopechaTask(provider.apiKey, contract.path, task, provider.id)
: provider.id === 'nonecap' ? await solveNonecapTask(provider.apiKey, task)
: await solveForm(provider.apiKey, contract, task);
if (!usable(result.solution)) throw new Error('No usable answer returned.');
diff --git a/src/chrome/src/agent/captcha-provider-config.js b/src/chrome/src/agent/captcha-provider-config.js
index 09513da23..f32e9cb81 100644
--- a/src/chrome/src/agent/captcha-provider-config.js
+++ b/src/chrome/src/agent/captcha-provider-config.js
@@ -12,6 +12,7 @@ export const CAPTCHA_PROVIDERS = [
{ id: 'anti-captcha', name: 'Anti-Captcha', key: 'antiCaptchaApiKey', enabled: 'antiCaptchaEnabled', weight: 'antiCaptchaWeight', defaultWeight: 96, domId: 'anti-captcha', types: STANDARD_TYPES, docs: 'https://anti-captcha.com/apidoc' },
{ id: 'nopecha', name: 'NopeCHA', key: 'nopechaApiKey', enabled: 'nopechaEnabled', weight: 'nopechaWeight', defaultWeight: 95, domId: 'nopecha', types: ["hcaptcha"], docs: 'https://nopecha.com/api-reference/' },
{ id: 'nonecap', name: 'NoneCap', key: 'nonecapApiKey', enabled: 'nonecapEnabled', weight: 'nonecapWeight', defaultWeight: 94, domId: 'nonecap', types: ["hcaptcha"], docs: 'https://nonecap.com/api-reference/' },
+ { id: 'solvecha', name: 'Solvecha', key: 'solvechaApiKey', enabled: 'solvechaEnabled', weight: 'solvechaWeight', defaultWeight: 93, domId: 'solvecha', types: ['image_to_text'], docs: 'https://solvecha.com/docs' },
].map(provider => ({ ...provider, nativeTypes: [...new Set(CAPTCHA_CATALOG.filter(c => c.provider === provider.id).map(c => c.family))] }));
export const CAPTCHA_SETTINGS_KEYS = [
...CAPTCHA_PROVIDERS.flatMap(provider => [provider.key, provider.enabled, provider.weight]),
@@ -26,8 +27,8 @@ export function isValidTwoCaptchaApiKey(value) {
export function isValidCaptchaApiKey(id, value) {
const key = normalizeTwoCaptchaApiKey(value);
if (id === 'nonecap') return /^nc_live_[A-Za-z0-9_-]{32}$/.test(key);
- // NopeCHA documents an opaque subscription key, not a 32-hex constraint.
- if (id === 'nopecha') return /^[A-Za-z0-9_-]{1,256}$/.test(key);
+ // NopeCHA and Solvecha document opaque keys, not a 32-hex constraint.
+ if (id === 'nopecha' || id === 'solvecha') return /^[A-Za-z0-9_-]{1,256}$/.test(key);
return id === 'capsolver' ? isValidCapsolverApiKey(value)
: CAPTCHA_PROVIDERS.some(provider => provider.id === id) && isValidTwoCaptchaApiKey(value);
}
diff --git a/src/chrome/src/agent/tools.js b/src/chrome/src/agent/tools.js
index 2ae935cc1..2246e862a 100644
--- a/src/chrome/src/agent/tools.js
+++ b/src/chrome/src/agent/tools.js
@@ -1449,7 +1449,7 @@ export const AGENT_TOOLS = [
parameters: {
type: 'object',
properties: {
- providerTasks: {"type": "array", "minItems": 1, "maxItems": 7, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
+ providerTasks: {"type": "array", "minItems": 1, "maxItems": 8, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
type: {
type: 'string',
enum: ['recaptcha_v2', 'recaptcha_v3', 'recaptcha_v2_enterprise', 'recaptcha_v3_enterprise', 'hcaptcha', 'turnstile', 'image_to_text', 'aws_waf'],
diff --git a/src/chrome/src/config-transfer.js b/src/chrome/src/config-transfer.js
index dcee8b478..748fdc93f 100644
--- a/src/chrome/src/config-transfer.js
+++ b/src/chrome/src/config-transfer.js
@@ -104,6 +104,9 @@ export const DEFAULT_CONFIG_SETTINGS = Object.freeze({
nonecapApiKey: '',
nonecapEnabled: false,
nonecapWeight: 94,
+ solvechaApiKey: '',
+ solvechaEnabled: false,
+ solvechaWeight: 93,
// Unset: decision-config.js maps a profile from before modes (On when
// systemOneEnabled is true, else Auto), so old exports keep their meaning.
decisionMode: '',
@@ -163,6 +166,7 @@ const BOOLEAN_KEYS = new Set([
'antiCaptchaEnabled',
'nopechaEnabled',
'nonecapEnabled',
+ 'solvechaEnabled',
'decisionVisionSupported', 'systemOneDoneEnabled',
'systemOneEnabled',
'systemOneWatchEnabled',
@@ -178,6 +182,7 @@ const NUMBER_KEYS = new Set([
'antiCaptchaWeight',
'nopechaWeight',
'nonecapWeight',
+ 'solvechaWeight',
'maxAgentSteps',
'requestTimeoutMs',
'clarifyTimeoutSec',
@@ -210,6 +215,7 @@ const STRING_KEYS = new Set([
'antiCaptchaApiKey',
'nopechaApiKey',
'nonecapApiKey',
+ 'solvechaApiKey',
'decisionMode', 'decisionProvider', 'decisionModel', 'decisionBaseUrl', 'decisionApiKey', 'decisionLocalApiKey', 'decisionVisionMode',
'typesafeApiKey',
]);
diff --git a/src/chrome/src/ui/captcha-settings.js b/src/chrome/src/ui/captcha-settings.js
index 937d41c00..416ba7e61 100644
--- a/src/chrome/src/ui/captcha-settings.js
+++ b/src/chrome/src/ui/captcha-settings.js
@@ -45,7 +45,7 @@ export async function initCaptchaSettings(storage, sendToBackground, t) {
const validKey = () => {
const key = keyInput.value.trim();
if (isValidCaptchaApiKey(provider.id, key)) return key;
- show('fail', provider.id === 'capsolver' ? t('st.captcha.need_key') : t(['nopecha', 'nonecap'].includes(provider.id) ? 'st.captcha.hcaptcha_need_key' : 'st.captcha.provider_need_key', { provider: provider.name }));
+ show('fail', provider.id === 'capsolver' ? t('st.captcha.need_key') : t(['nopecha', 'nonecap', 'solvecha'].includes(provider.id) ? 'st.captcha.hcaptcha_need_key' : 'st.captcha.provider_need_key', { provider: provider.name }));
return null;
};
// Typing opts in by default, but an explicit unchecked box wins for this edit.
diff --git a/src/chrome/src/ui/settings.html b/src/chrome/src/ui/settings.html
index 1a982b035..2b302d6aa 100644
--- a/src/chrome/src/ui/settings.html
+++ b/src/chrome/src/ui/settings.html
@@ -660,7 +660,7 @@
<p class="captcha-description"><a id="nonecap-docs" target="_blank" rel="noopener noreferrer" data-i18n="st.captcha.docs"></a></p>
<div class="field">
<label for="nonecap-api-key" data-i18n="st.captcha.provider_key" data-i18n-params='{"provider":"NoneCap"}'></label>
- <input type="password" id="nonecap-api-key" pattern="nc_live_[A-Za-z0-9_\-]{32}" minlength="40" maxlength="40" placeholder="nc_live_…" autocomplete="off" spellcheck="false">
+ <input type="password" id="nonecap-api-key" pattern="[A-Za-z0-9_\-]{1,256}" maxlength="256" autocomplete="off" spellcheck="false">
</div>
<div class="btn-row">
<button class="btn-primary" id="btn-save-nonecap" data-i18n="st.captcha.save"></button>
@@ -676,6 +676,31 @@
</div>
</details>
</section>
+ <section class="captcha-provider" aria-labelledby="solvecha-heading">
+ <div class="captcha-provider-header">
+ <h4 id="solvecha-heading"><a href="https://solvecha.com/" target="_blank" rel="noopener noreferrer">Solvecha</a></h4>
+ <label class="captcha-enabled"><input type="checkbox" id="solvecha-enabled"><span data-i18n="st.captcha.enabled"></span></label>
+ </div>
+ <p class="captcha-description"><span data-i18n="st.captcha.coverage"></span> <span id="solvecha-coverage"></span></p>
+ <p class="captcha-description"><a id="solvecha-docs" target="_blank" rel="noopener noreferrer" data-i18n="st.captcha.docs"></a></p>
+ <div class="field">
+ <label for="solvecha-api-key" data-i18n="st.captcha.provider_key" data-i18n-params='{"provider":"Solvecha"}'></label>
+ <input type="password" id="solvecha-api-key" pattern="[A-Za-z0-9_\-]{1,256}" maxlength="256" autocomplete="off" spellcheck="false">
+ </div>
+ <div class="btn-row">
+ <button class="btn-primary" id="btn-save-solvecha" data-i18n="st.captcha.save"></button>
+ <button class="btn-secondary" id="btn-test-solvecha" data-i18n="st.captcha.check_balance"></button>
+ <button class="btn-secondary" id="btn-clear-solvecha" data-i18n="st.captcha.clear"></button>
+ </div>
+ <div class="test-result" id="test-solvecha" role="status" aria-live="polite"></div>
+ <details class="captcha-advanced">
+ <summary data-i18n="st.display.advanced"></summary>
+ <div class="field">
+ <label for="solvecha-weight" data-i18n="st.captcha.weight"></label>
+ <input type="number" id="solvecha-weight" value="93" step="any">
+ </div>
+ </details>
+ </section>
<div class="info-box" style="margin-top:16px;" data-i18n="st.captcha.providers_security"></div>
</div>
</div>
diff --git a/src/firefox/src/agent/captcha-additional-providers.js b/src/firefox/src/agent/captcha-additional-providers.js
index 099560a83..4026a44fb 100644
--- a/src/firefox/src/agent/captcha-additional-providers.js
+++ b/src/firefox/src/agent/captcha-additional-providers.js
@@ -15,6 +15,8 @@ export function buildAdditionalCaptchaTask(id, task) {
if (mapped.type?.startsWith('RecaptchaV2')) delete mapped.userAgent;
return mapped;
}
+ // Solvecha accepts the same ImageToTextTask body as the other JSON providers.
+ if (id === 'solvecha') return mapped;
if (id !== 'capmonster') throw new Error(`Unknown CAPTCHA provider: ${id}`);
if (task.type === 'AntiTurnstileTaskProxyLess') {
const { action, pagedata, ...rest } = mapped;
@@ -93,6 +95,7 @@ async function solveWithSolveCaptcha(apiKey, task) {
const JSON_PROVIDERS = {
capmonster: { base: 'https://api.capmonster.cloud', name: 'CapMonster Cloud' },
'anti-captcha': { base: 'https://api.anti-captcha.com', name: 'Anti-Captcha' },
+ solvecha: { base: 'https://api.solvecha.com', name: 'Solvecha' },
};
export async function getAdditionalCaptchaBalance(id, apiKey) {
if (['nopecha', 'nonecap'].includes(id)) return getHcaptchaProviderBalance(id, apiKey);
diff --git a/src/firefox/src/agent/captcha-catalog.js b/src/firefox/src/agent/captcha-catalog.js
index 10a9d4f0e..a1d52c361 100644
--- a/src/firefox/src/agent/captcha-catalog.js
+++ b/src/firefox/src/agent/captcha-catalog.js
@@ -199,5 +199,10 @@ export const CAPTCHA_CATALOG = [
{"provider":"anti-captcha","method":"RecaptchaV3TaskProxyless:enterprise","family":"recaptcha_v3_enterprise","fields":{"websiteURL":{"type":"string","required":true},"websiteKey":{"type":"string","required":true},"minScore":{"type":"number","required":true},"pageAction":{"type":"string","required":false},"apiDomain":{"type":"string","required":false}},"fixed":{"type":"RecaptchaV3TaskProxyless","isEnterprise":true},"docs":"https://anti-captcha.com/apidoc/task-types/RecaptchaV3TaskProxyless"},
{"provider":"solvecaptcha","method":"recaptcha_v3:enterprise","family":"recaptcha_v3_enterprise","fields":{"googlekey":{"type":"string","required":true},"pageurl":{"type":"string","required":true},"domain":{"type":"string","required":false},"action":{"type":"string","required":false},"min_score":{"type":"number","required":false},"proxy":{"type":"string","required":false},"proxytype":{"type":"string","required":false},"cookies":{"type":"string","required":false},"userAgent":{"type":"string","required":false}},"fixed":{"method":"userrecaptcha","version":"v3","enterprise":1},"docs":"https://solvecaptcha.com/captcha-solver-api"},
{"provider":"nopecha","method":"token/recaptcha2:enterprise","family":"recaptcha_v2_enterprise","fields":{"sitekey":{"type":"string","required":true},"url":{"type":"string","required":true},"proxy":{"type":"object","required":false},"cookie":{"type":"array","required":false},"useragent":{"type":"string","required":false},"data":{"type":"object","required":false}},"fixed":{"data.enterprise":true},"docs":"https://nopecha.com/api-reference/","path":"/v1/token/recaptcha2"},
- {"provider":"nopecha","method":"token/recaptcha3:enterprise","family":"recaptcha_v3_enterprise","fields":{"sitekey":{"type":"string","required":true},"url":{"type":"string","required":true},"proxy":{"type":"object","required":false},"cookie":{"type":"array","required":false},"useragent":{"type":"string","required":false},"data":{"type":"object","required":false}},"fixed":{"data.enterprise":true},"docs":"https://nopecha.com/api-reference/","path":"/v1/token/recaptcha3"}
+ {"provider":"nopecha","method":"token/recaptcha3:enterprise","family":"recaptcha_v3_enterprise","fields":{"sitekey":{"type":"string","required":true},"url":{"type":"string","required":true},"proxy":{"type":"object","required":false},"cookie":{"type":"array","required":false},"useragent":{"type":"string","required":false},"data":{"type":"object","required":false}},"fixed":{"data.enterprise":true},"docs":"https://nopecha.com/api-reference/","path":"/v1/token/recaptcha3"},
+ {"provider":"solvecha","method":"recognition/funcaptcha","family":"funcaptcha_recognition","fields":{"task":{"type":"string","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/funcaptcha"},
+ {"provider":"solvecha","method":"recognition/funcaptcha_match","family":"funcaptcha_match","fields":{"task":{"type":"string","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/funcaptcha_match"},
+ {"provider":"solvecha","method":"recognition/geetest","family":"geetest_recognition","fields":{"task":{"type":"string","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/geetest"},
+ {"provider":"solvecha","method":"recognition/recaptcha","family":"recaptcha_recognition","fields":{"task":{"type":"string","required":true},"grid":{"type":"string|null","required":true},"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/recaptcha"},
+ {"provider":"solvecha","method":"recognition/textcaptcha","family":"image_to_text","fields":{"image_data":{"type":"array","required":true}},"fixed":{},"docs":"https://solvecha.com/docs","path":"/v1/recognition/textcaptcha"},
];
diff --git a/src/firefox/src/agent/captcha-hcaptcha-providers.js b/src/firefox/src/agent/captcha-hcaptcha-providers.js
index a8cc479c9..ee12d7b45 100644
--- a/src/firefox/src/agent/captcha-hcaptcha-providers.js
+++ b/src/firefox/src/agent/captcha-hcaptcha-providers.js
@@ -1,7 +1,7 @@
// Current contracts: https://nopecha.com/api-reference/ and
// https://nonecap.com/api-reference/. Token and recognition transports share the documented v1 lifecycle.
-const API_BASES = { nopecha: 'https://api.nopecha.com', nonecap: 'https://api.nonecap.com' };
-const NAMES = { nopecha: 'NopeCHA', nonecap: 'NoneCap' };
+const API_BASES = { nopecha: 'https://api.nopecha.com', nonecap: 'https://api.nonecap.com', solvecha: 'https://api.solvecha.com' };
+const NAMES = { nopecha: 'NopeCHA', nonecap: 'NoneCap', solvecha: 'Solvecha' };
const POLL_MS = 2000;
const TIMEOUT_MS = 180_000;
@@ -21,7 +21,7 @@ async function request(id, apiKey, path, { body, timeoutMs = 30_000, allowPendin
// terminal even if their body happens to contain a pending code.
const code = result.code ?? result.error?.code ?? result.error;
const incomplete = code === 14 || code === '14';
- if (allowPending && !body && id === 'nopecha' && incomplete
+ if (allowPending && !body && id !== 'nonecap' && incomplete
&& (response.ok || response.status === 409)) return null;
if (!response.ok || result.error || result.code) {
const message = String(result.error?.message || result.message || result.error?.code || 'Request failed')
@@ -70,21 +70,23 @@ export async function getHcaptchaProviderBalance(id, apiKey) {
return { balance, unit: 'credits' };
}
-export async function solveNopechaTask(apiKey, path, body) {
- if (!/^\/v1\/(token|recognition)\/[a-z0-9_]+$/.test(path)) throw new Error('Invalid NopeCHA solving route.');
- const created = await request('nopecha', apiKey, path, { body });
+export async function solveNopechaTask(apiKey, path, body, id = 'nopecha') {
+ const name = NAMES[id];
+ // Solvecha implements only the NopeCHA-compatible recognition routes.
+ if (!/^\/v1\/(token|recognition)\/[a-z0-9_]+$/.test(path) || (id === 'solvecha' && !path.startsWith('/v1/recognition/'))) throw new Error(`Invalid ${name} solving route.`);
+ const created = await request(id, apiKey, path, { body });
const taskId = created.data;
- if (typeof taskId !== 'string' || !taskId.trim()) throw new Error('NopeCHA: missing task ID.');
+ if (typeof taskId !== 'string' || !taskId.trim()) throw new Error(`${name}: missing task ID.`);
const deadline = Date.now() + TIMEOUT_MS;
while (Date.now() + POLL_MS < deadline) {
await new Promise(resolve => setTimeout(resolve, POLL_MS));
- const result = await request('nopecha', apiKey, `${path}?id=${encodeURIComponent(taskId)}`, { allowPending: true, timeoutMs: Math.min(30_000, deadline - Date.now()) });
+ const result = await request(id, apiKey, `${path}?id=${encodeURIComponent(taskId)}`, { allowPending: true, timeoutMs: Math.min(30_000, deadline - Date.now()) });
if (!result) continue;
- if (path.includes('/token/') && (typeof result.data !== 'string' || !result.data.trim())) throw new Error('NopeCHA: missing solution token.');
- if (result.data == null) throw new Error('NopeCHA: missing recognition result.');
+ if (path.includes('/token/') && (typeof result.data !== 'string' || !result.data.trim())) throw new Error(`${name}: missing solution token.`);
+ if (result.data == null) throw new Error(`${name}: missing recognition result.`);
return { taskId, solution: result.data };
}
- throw new Error('NopeCHA: timed out waiting for solution.');
+ throw new Error(`${name}: timed out waiting for solution.`);
}
export async function solveNonecapTask(apiKey, body) {
diff --git a/src/firefox/src/agent/captcha-native-providers.js b/src/firefox/src/agent/captcha-native-providers.js
index f0c1c80df..016ce3c78 100644
--- a/src/firefox/src/agent/captcha-native-providers.js
+++ b/src/firefox/src/agent/captcha-native-providers.js
@@ -159,10 +159,10 @@ export function buildNativeCaptchaTask(entry) {
if (entry.provider === 'nopecha' && object(task.proxy)) {
if (!['http','https','socks4','socks5'].includes(task.proxy.scheme) || !task.proxy.host || !task.proxy.port) throw new Error('NopeCHA proxy requires scheme, host, and port.');
}
- if (entry.provider === 'nopecha' && ['recognition/awscaptcha','recognition/funcaptcha','recognition/textcaptcha'].includes(entry.method)) {
+ if (['nopecha', 'solvecha'].includes(entry.provider) && ['recognition/awscaptcha','recognition/funcaptcha','recognition/textcaptcha'].includes(entry.method)) {
if ((task.audio_data || task.image_data)?.length !== 1) throw new Error(`${entry.method} requires exactly one input.`);
}
- if (entry.provider === 'nopecha' && entry.method === 'recognition/recaptcha' && ![null,'1x1','3x3','4x4'].includes(task.grid)) throw new Error('Invalid reCAPTCHA recognition grid.');
+ if (['nopecha', 'solvecha'].includes(entry.provider) && entry.method === 'recognition/recaptcha' && ![null,'1x1','3x3','4x4'].includes(task.grid)) throw new Error('Invalid reCAPTCHA recognition grid.');
return { contract, task, family: effectiveCaptchaFamily(contract, task) };
}
@@ -538,7 +538,7 @@ export async function solveNativeCaptchaTasks(prepared, { onAttempt } = {}) {
const result = JSON_BASES[provider.id]
? await solveJsonCaptcha(JSON_BASES[provider.id], provider.id, provider.apiKey, task,
provider.id === 'capsolver' ? { pendingStatuses: ['idle', 'processing'] } : {})
- : provider.id === 'nopecha' ? await solveNopechaTask(provider.apiKey, contract.path, task)
+ : ['nopecha', 'solvecha'].includes(provider.id) ? await solveNopechaTask(provider.apiKey, contract.path, task, provider.id)
: provider.id === 'nonecap' ? await solveNonecapTask(provider.apiKey, task)
: await solveForm(provider.apiKey, contract, task);
if (!usable(result.solution)) throw new Error('No usable answer returned.');
diff --git a/src/firefox/src/agent/captcha-provider-config.js b/src/firefox/src/agent/captcha-provider-config.js
index 09513da23..f32e9cb81 100644
--- a/src/firefox/src/agent/captcha-provider-config.js
+++ b/src/firefox/src/agent/captcha-provider-config.js
@@ -12,6 +12,7 @@ export const CAPTCHA_PROVIDERS = [
{ id: 'anti-captcha', name: 'Anti-Captcha', key: 'antiCaptchaApiKey', enabled: 'antiCaptchaEnabled', weight: 'antiCaptchaWeight', defaultWeight: 96, domId: 'anti-captcha', types: STANDARD_TYPES, docs: 'https://anti-captcha.com/apidoc' },
{ id: 'nopecha', name: 'NopeCHA', key: 'nopechaApiKey', enabled: 'nopechaEnabled', weight: 'nopechaWeight', defaultWeight: 95, domId: 'nopecha', types: ["hcaptcha"], docs: 'https://nopecha.com/api-reference/' },
{ id: 'nonecap', name: 'NoneCap', key: 'nonecapApiKey', enabled: 'nonecapEnabled', weight: 'nonecapWeight', defaultWeight: 94, domId: 'nonecap', types: ["hcaptcha"], docs: 'https://nonecap.com/api-reference/' },
+ { id: 'solvecha', name: 'Solvecha', key: 'solvechaApiKey', enabled: 'solvechaEnabled', weight: 'solvechaWeight', defaultWeight: 93, domId: 'solvecha', types: ['image_to_text'], docs: 'https://solvecha.com/docs' },
].map(provider => ({ ...provider, nativeTypes: [...new Set(CAPTCHA_CATALOG.filter(c => c.provider === provider.id).map(c => c.family))] }));
export const CAPTCHA_SETTINGS_KEYS = [
...CAPTCHA_PROVIDERS.flatMap(provider => [provider.key, provider.enabled, provider.weight]),
@@ -26,8 +27,8 @@ export function isValidTwoCaptchaApiKey(value) {
export function isValidCaptchaApiKey(id, value) {
const key = normalizeTwoCaptchaApiKey(value);
if (id === 'nonecap') return /^nc_live_[A-Za-z0-9_-]{32}$/.test(key);
- // NopeCHA documents an opaque subscription key, not a 32-hex constraint.
- if (id === 'nopecha') return /^[A-Za-z0-9_-]{1,256}$/.test(key);
+ // NopeCHA and Solvecha document opaque keys, not a 32-hex constraint.
+ if (id === 'nopecha' || id === 'solvecha') return /^[A-Za-z0-9_-]{1,256}$/.test(key);
return id === 'capsolver' ? isValidCapsolverApiKey(value)
: CAPTCHA_PROVIDERS.some(provider => provider.id === id) && isValidTwoCaptchaApiKey(value);
}
diff --git a/src/firefox/src/agent/tools.js b/src/firefox/src/agent/tools.js
index c85688089..a30b9943c 100644
--- a/src/firefox/src/agent/tools.js
+++ b/src/firefox/src/agent/tools.js
@@ -1304,7 +1304,7 @@ export const AGENT_TOOLS = [
parameters: {
type: 'object',
properties: {
- providerTasks: {"type": "array", "minItems": 1, "maxItems": 7, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
+ providerTasks: {"type": "array", "minItems": 1, "maxItems": 8, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
type: {
type: 'string',
enum: ['recaptcha_v2', 'recaptcha_v3', 'recaptcha_v2_enterprise', 'recaptcha_v3_enterprise', 'hcaptcha', 'turnstile', 'image_to_text', 'aws_waf'],
diff --git a/src/firefox/src/config-transfer.js b/src/firefox/src/config-transfer.js
index c2acb8703..56080fdd4 100644
--- a/src/firefox/src/config-transfer.js
+++ b/src/firefox/src/config-transfer.js
@@ -104,6 +104,9 @@ export const DEFAULT_CONFIG_SETTINGS = Object.freeze({
nonecapApiKey: '',
nonecapEnabled: false,
nonecapWeight: 94,
+ solvechaApiKey: '',
+ solvechaEnabled: false,
+ solvechaWeight: 93,
// Unset: decision-config.js maps a profile from before modes (On when
// systemOneEnabled is true, else Auto), so old exports keep their meaning.
decisionMode: '',
@@ -163,6 +166,7 @@ const BOOLEAN_KEYS = new Set([
'antiCaptchaEnabled',
'nopechaEnabled',
'nonecapEnabled',
+ 'solvechaEnabled',
'decisionVisionSupported', 'systemOneDoneEnabled',
'systemOneEnabled',
'systemOneWatchEnabled',
@@ -178,6 +182,7 @@ const NUMBER_KEYS = new Set([
'antiCaptchaWeight',
'nopechaWeight',
'nonecapWeight',
+ 'solvechaWeight',
'maxAgentSteps',
'requestTimeoutMs',
'clarifyTimeoutSec',
@@ -210,6 +215,7 @@ const STRING_KEYS = new Set([
'antiCaptchaApiKey',
'nopechaApiKey',
'nonecapApiKey',
+ 'solvechaApiKey',
'decisionMode', 'decisionProvider', 'decisionModel', 'decisionBaseUrl', 'decisionApiKey', 'decisionLocalApiKey', 'decisionVisionMode',
'typesafeApiKey',
]);
diff --git a/src/firefox/src/ui/captcha-settings.js b/src/firefox/src/ui/captcha-settings.js
index 937d41c00..416ba7e61 100644
--- a/src/firefox/src/ui/captcha-settings.js
+++ b/src/firefox/src/ui/captcha-settings.js
@@ -45,7 +45,7 @@ export async function initCaptchaSettings(storage, sendToBackground, t) {
const validKey = () => {
const key = keyInput.value.trim();
if (isValidCaptchaApiKey(provider.id, key)) return key;
- show('fail', provider.id === 'capsolver' ? t('st.captcha.need_key') : t(['nopecha', 'nonecap'].includes(provider.id) ? 'st.captcha.hcaptcha_need_key' : 'st.captcha.provider_need_key', { provider: provider.name }));
+ show('fail', provider.id === 'capsolver' ? t('st.captcha.need_key') : t(['nopecha', 'nonecap', 'solvecha'].includes(provider.id) ? 'st.captcha.hcaptcha_need_key' : 'st.captcha.provider_need_key', { provider: provider.name }));
return null;
};
// Typing opts in by default, but an explicit unchecked box wins for this edit.
diff --git a/src/firefox/src/ui/settings.html b/src/firefox/src/ui/settings.html
index b0d11c945..5bd5d7ee9 100644
--- a/src/firefox/src/ui/settings.html
+++ b/src/firefox/src/ui/settings.html
@@ -640,7 +640,7 @@
<p class="captcha-description"><a id="nonecap-docs" target="_blank" rel="noopener noreferrer" data-i18n="st.captcha.docs"></a></p>
<div class="field">
<label for="nonecap-api-key" data-i18n="st.captcha.provider_key" data-i18n-params='{"provider":"NoneCap"}'></label>
- <input type="password" id="nonecap-api-key" pattern="nc_live_[A-Za-z0-9_\-]{32}" minlength="40" maxlength="40" placeholder="nc_live_…" autocomplete="off" spellcheck="false">
+ <input type="password" id="nonecap-api-key" pattern="[A-Za-z0-9_\-]{1,256}" maxlength="256" autocomplete="off" spellcheck="false">
</div>
<div class="btn-row">
<button class="btn-primary" id="btn-save-nonecap" data-i18n="st.captcha.save"></button>
@@ -656,6 +656,31 @@
</div>
</details>
</section>
+ <section class="captcha-provider" aria-labelledby="solvecha-heading">
+ <div class="captcha-provider-header">
+ <h4 id="solvecha-heading"><a href="https://solvecha.com/" target="_blank" rel="noopener noreferrer">Solvecha</a></h4>
+ <label class="captcha-enabled"><input type="checkbox" id="solvecha-enabled"><span data-i18n="st.captcha.enabled"></span></label>
+ </div>
+ <p class="captcha-description"><span data-i18n="st.captcha.coverage"></span> <span id="solvecha-coverage"></span></p>
+ <p class="captcha-description"><a id="solvecha-docs" target="_blank" rel="noopener noreferrer" data-i18n="st.captcha.docs"></a></p>
+ <div class="field">
+ <label for="solvecha-api-key" data-i18n="st.captcha.provider_key" data-i18n-params='{"provider":"Solvecha"}'></label>
+ <input type="password" id="solvecha-api-key" pattern="[A-Za-z0-9_\-]{1,256}" maxlength="256" autocomplete="off" spellcheck="false">
+ </div>
+ <div class="btn-row">
+ <button class="btn-primary" id="btn-save-solvecha" data-i18n="st.captcha.save"></button>
+ <button class="btn-secondary" id="btn-test-solvecha" data-i18n="st.captcha.check_balance"></button>
+ <button class="btn-secondary" id="btn-clear-solvecha" data-i18n="st.captcha.clear"></button>
+ </div>
+ <div class="test-result" id="test-solvecha" role="status" aria-live="polite"></div>
+ <details class="captcha-advanced">
+ <summary data-i18n="st.display.advanced"></summary>
+ <div class="field">
+ <label for="solvecha-weight" data-i18n="st.captcha.weight"></label>
+ <input type="number" id="solvecha-weight" value="93" step="any">
+ </div>
+ </details>
+ </section>
<div class="info-box" style="margin-top:16px;" data-i18n="st.captcha.providers_security"></div>
</div>
</div>
diff --git a/test/captcha-hcaptcha-providers.mjs b/test/captcha-hcaptcha-providers.mjs
index cf2c8f34a..cc0eb6f24 100644
--- a/test/captcha-hcaptcha-providers.mjs
+++ b/test/captcha-hcaptcha-providers.mjs
@@ -23,8 +23,8 @@ for (const build of ['chrome', 'firefox']) {
const h = await import(`../src/${build}/src/agent/captcha-hcaptcha-providers.js`);
const transfer = await import(`../src/${build}/src/config-transfer.js`);
const stored = Object.fromEntries(config.CAPTCHA_PROVIDERS.flatMap(p => [[p.key, keys[p.id] || (p.id === 'capsolver' ? 'CAP-0123456789abcdefghij' : 'a'.repeat(32))], [p.enabled, true]]));
- test(`${build}: seven-provider consent, weights, capabilities, key formats, and import`, () => {
- assert.deepEqual(config.getCaptchaProviders(stored).map(p => p.id), ['capsolver','2captcha','capmonster','solvecaptcha','anti-captcha','nopecha','nonecap']);
+ test(`${build}: eight-provider consent, weights, capabilities, key formats, and import`, () => {
+ assert.deepEqual(config.getCaptchaProviders(stored).map(p => p.id), ['capsolver','2captcha','capmonster','solvecaptcha','anti-captcha','nopecha','nonecap','solvecha']);
assert.equal(config.getCaptchaProviders({...stored, nonecapWeight: 200})[0].id, 'nonecap');
assert.equal(config.getCaptchaProviders({...stored, nopechaEnabled: false}).some(p => p.id === 'nopecha'), false);
for (const id of ['nopecha','nonecap']) {
diff --git a/test/captcha-native-providers.mjs b/test/captcha-native-providers.mjs
index e51c124ae..1bf86de50 100644
--- a/test/captcha-native-providers.mjs
+++ b/test/captcha-native-providers.mjs
@@ -42,7 +42,7 @@ for (const browser of ['chrome','firefox']) {
const native=await import(`../src/${browser}/src/agent/captcha-native-providers.js`);
const {CAPTCHA_CATALOG:catalog}=await import(`../src/${browser}/src/agent/captcha-catalog.js`);
const apply=await import(`../src/${browser}/src/agent/captcha-solution-application.js`);
- const providers=['capsolver','2captcha','capmonster','solvecaptcha','anti-captcha','nopecha','nonecap'].map((id,index)=>({id,apiKey:`secret-${id}`,weight:100-index}));
+ const providers=['capsolver','2captcha','capmonster','solvecaptcha','anti-captcha','nopecha','nonecap','solvecha'].map((id,index)=>({id,apiKey:`secret-${id}`,weight:100-index}));
for (const [provider,method,parameters,expected] of fixtures) test(`${browser}: native ${provider}/${method} matches its wire contract`,()=>{
assert.deepEqual(native.buildNativeCaptchaTask({provider,method,parameters}).task,expected);
});
@@ -109,14 +109,14 @@ for (const browser of ['chrome','firefox']) {
if(id==='bills_audio')assert.equal(task.metadata.PayloadType,'Audio');
}
});
- test(`${browser}: catalogs cover seven vendors without resurrecting draft hCaptcha methods`,()=>{
- assert.equal(catalog.length,198);
+ test(`${browser}: catalogs cover eight vendors without resurrecting draft hCaptcha methods`,()=>{
+ assert.equal(catalog.length,203);
for(const provider of providers) assert.ok(catalog.some(c=>c.provider===provider.id));
assert.deepEqual([...new Set(catalog.filter(c=>c.family==='hcaptcha').map(c=>c.provider))].sort(),['nonecap','nopecha']);
const cm=new Set(catalog.filter(c=>c.provider==='capmonster').map(c=>c.family));
for(const family of ['recaptcha_v2','recaptcha_v3','recaptcha_v2_enterprise','recaptcha_v3_enterprise','geetest','turnstile','cloudflare_challenge','cloudflare_waiting_room','datadome','tencent','aws_waf','basilisk','imperva','prosopo','image_to_text','yidun','mtcaptcha','altcha','funcaptcha','tspd','hunt','alibaba','friendly','complex_image','binance','recaptcha_recognition']) assert.ok(cm.has(family),family);
const discovery=native.getCaptchaCapabilities(providers);
- assert.equal(discovery.providers.length,7);assert.equal(JSON.stringify(discovery).includes('secret-'),false);
+ assert.equal(discovery.providers.length,8);assert.equal(JSON.stringify(discovery).includes('secret-'),false);
assert.equal(native.getCaptchaCapabilities([{id:'capsolver',useCloudBroker:true}]).providers.length,0);
});
test(`${browser}: validation prevents spend on malformed, unsupported, disabled, duplicated, or incompatible tasks`,()=>{
@@ -318,6 +318,23 @@ for (const browser of ['chrome','firefox']) {
assert.deepEqual(result.solution,[false,false,false]);assert.equal(calls[0].url.pathname,'/v1/recognition/recaptcha');assert.equal(calls[1].options.method,'GET');assert.equal(calls[0].options.headers.Authorization,'Basic secret-nopecha');
assert.equal(calls.some(c=>c.url.href.includes('secret-')),false);
});
+ test(`${browser}: Solvecha recognition uses Bearer auth and the NopeCHA-compatible lifecycle`,async t=>{
+ const calls=mockApi(t,(c,n)=>c.options.method==='POST'?{data:'job'}:n===2?{error:14}:{data:[true,false]});
+ const prepared=native.prepareNativeCaptchaTasks(providers,[{provider:'solvecha',method:'recognition/recaptcha',parameters:{task:'cars',grid:'3x3',image_data:['base64']}}]);
+ const result=await native.solveNativeCaptchaTasks(prepared);
+ assert.equal(result.provider,'solvecha');assert.deepEqual(result.solution,[true,false]);
+ assert.equal(calls[0].url.href,'https://api.solvecha.com/v1/recognition/recaptcha');
+ assert.equal(calls[0].options.headers.Authorization,'Bearer secret-solvecha');
+ assert.equal(calls.length,3);assert.equal(calls[1].url.search,'?id=job');
+ assert.equal(calls.some(c=>c.url.href.includes('secret-')),false);
+ });
+ test(`${browser}: Solvecha offers recognition methods only, never token tasks`,()=>{
+ const methods=catalog.filter(c=>c.provider==='solvecha').map(c=>c.method).sort();
+ assert.deepEqual(methods,['recognition/funcaptcha','recognition/funcaptcha_match','recognition/geetest','recognition/recaptcha','recognition/textcaptcha']);
+ assert.throws(()=>native.buildNativeCaptchaTask({provider:'solvecha',method:'token/recaptcha2',parameters:{sitekey:'site',url}}));
+ assert.throws(()=>native.buildNativeCaptchaTask({provider:'solvecha',method:'recognition/textcaptcha',parameters:{image_data:['a','b']}}),/exactly one input/);
+ assert.throws(()=>native.buildNativeCaptchaTask({provider:'solvecha',method:'recognition/recaptcha',parameters:{task:'cars',grid:'5x5',image_data:['a']}}),/Invalid reCAPTCHA recognition grid/);
+ });
test(`${browser}: SolveCaptcha form polling decodes object results, without flattening them into token strings`,async t=>{
const calls=mockApi(t,c=>c.url.pathname==='/in.php'?{status:1,request:'123'}:{status:1,request:'{"captcha_id":"id","lot_number":"lot"}'});
const result=await native.solveNativeCaptchaTasks(native.prepareNativeCaptchaTasks(providers,[{provider:'solvecaptcha',method:'geetest_v4',parameters:{pageurl:url,captcha_id:'id'}}]));
diff --git a/test/captcha-settings-ui.mjs b/test/captcha-settings-ui.mjs
index f02d7f5f0..96430a933 100644
--- a/test/captcha-settings-ui.mjs
+++ b/test/captcha-settings-ui.mjs
@@ -57,7 +57,7 @@ try {
await openSettings();
const card = page.locator('#captcha-card');
await card.scrollIntoViewIfNeeded();
- assert.equal(await card.locator('section').count(), 7);
+ assert.equal(await card.locator('section').count(), 8);
assert.equal(await card.evaluate(el => el.textContent.includes('st.captcha.') || el.textContent.includes('{provider}')), false);
assert.equal(await card.locator('.captcha-advanced[open]').count(), 0);
for (const id of ['captcha','two-captcha','capmonster','solve-captcha','anti-captcha']) {
@@ -69,7 +69,7 @@ try {
assert.ok((await page.locator('#nopecha-coverage').textContent()).includes('hCaptcha'));
assert.ok((await page.locator('#nopecha-coverage').textContent()).includes('reCAPTCHA v2'));
assert.equal(await page.locator('#nonecap-coverage').textContent(), 'hCaptcha');
- for (const [id, defaultWeight] of [['captcha', 100], ['two-captcha', 99], ['capmonster', 98], ['solve-captcha', 97], ['anti-captcha', 96], ['nopecha', 95], ['nonecap', 94]]) {
+ for (const [id, defaultWeight] of [['captcha', 100], ['two-captcha', 99], ['capmonster', 98], ['solve-captcha', 97], ['anti-captcha', 96], ['nopecha', 95], ['nonecap', 94], ['solvecha', 93]]) {
assert.equal(await page.locator(`#${id}-weight`).isVisible(), false);
assert.equal(await page.locator(`#${id}-weight`).locator('xpath=ancestor::details[1]/summary').evaluate(el => getComputedStyle(el, '::after').content), '"+"');
assert.equal(await page.locator(`#${id}-weight`).inputValue(), String(defaultWeight));
@@ -116,6 +116,7 @@ try {
['anti-captcha', 'antiCaptchaApiKey', 'antiCaptchaEnabled', 'antiCaptchaWeight'],
['nopecha', 'nopechaApiKey', 'nopechaEnabled', 'nopechaWeight'],
['nonecap', 'nonecapApiKey', 'nonecapEnabled', 'nonecapWeight'],
+ ['solvecha', 'solvechaApiKey', 'solvechaEnabled', 'solvechaWeight'],
]) {
await page.locator(`#${id}-api-key`).fill(id === 'nonecap' ? 'nc_live_' + key : key);
assert.equal(await page.locator(`#${id}-enabled`).isChecked(), true);
diff --git a/test/captcha-weighted-fallback.mjs b/test/captcha-weighted-fallback.mjs
index 01bc081d7..1e0e1ac82 100644
--- a/test/captcha-weighted-fallback.mjs
+++ b/test/captcha-weighted-fallback.mjs
@@ -26,7 +26,7 @@ for (const build of ['chrome', 'firefox']) {
const solver = await import(`../src/${build}/src/agent/captcha-solver.js`);
const extra = await import(`../src/${build}/src/agent/captcha-additional-providers.js`);
const transfer = await import(`../src/${build}/src/config-transfer.js`);
- const originalProviders = config.CAPTCHA_PROVIDERS.filter(p => !['nopecha', 'nonecap'].includes(p.id));
+ const originalProviders = config.CAPTCHA_PROVIDERS.filter(p => !['nopecha', 'nonecap', 'solvecha'].includes(p.id));
const all = Object.fromEntries(originalProviders.flatMap(p => [[p.key, p.id === 'capsolver' ? 'CAP-0123456789abcdefghij' : key], [p.enabled, true]]));
const ids = value => config.getCaptchaProviders(value).map(p => p.id);
@@ -124,6 +124,23 @@ for (const build of ['chrome', 'firefox']) {
}
}
+ test(`${build}: Solvecha solves text images through createTask and rejects token types before any request`, async t => {
+ const calls = api(t, call => call.path === '/createTask' ? { errorId: 0, taskId: 'task-id' }
+ : { errorId: 0, status: 'ready', solution: { text: 'AbC123' } });
+ const providers = [{ id: 'solvecha', apiKey: 'solvecha_key' }];
+ const result = await solver.solveCaptchaWithProviders(providers, { type: 'image_to_text', body: 'base64-image' });
+ assert.equal(result.provider, 'solvecha');
+ assert.equal(result.token, 'AbC123');
+ assert.deepEqual(calls.map(c => c.host + c.path), ['api.solvecha.com/createTask', 'api.solvecha.com/getTaskResult']);
+ assert.equal(calls[0].body.clientKey, 'solvecha_key');
+ assert.deepEqual(calls[0].body.task, { type: 'ImageToTextTask', body: 'base64-image' });
+ for (const type of ['recaptcha_v2', 'turnstile', 'hcaptcha']) {
+ assert.equal(config.captchaProviderSupportsType('solvecha', type), false);
+ await assert.rejects(solver.solveCaptchaWithProviders(providers, { ...params, type }), /No enabled provider supports/);
+ }
+ assert.equal(calls.length, 2);
+ });
+
test(`${build}: synchronous CapSolver OCR without task ID does not poll or fall back`, async t => {
const calls = api(t, () => ({ errorId: 0, status: 'ready', solution: { text: 'AbC123' } }));
const result = await solver.solveCaptchaWithProviders(config.getCaptchaProviders(all), { type: 'image_to_text', body: 'base64-image' });