feat: add support for reCAPTCHA Enterprise

Closes #236.
pull/270/head
dessant 4 years ago
parent 5b1cf4f514
commit 092f3b9492

@ -138,7 +138,11 @@ async function setChallengeLocale() {
'https://www.google.com/recaptcha/api2/anchor*', 'https://www.google.com/recaptcha/api2/anchor*',
'https://www.google.com/recaptcha/api2/bframe*', 'https://www.google.com/recaptcha/api2/bframe*',
'https://www.recaptcha.net/recaptcha/api2/anchor*', 'https://www.recaptcha.net/recaptcha/api2/anchor*',
'https://www.recaptcha.net/recaptcha/api2/bframe*' 'https://www.recaptcha.net/recaptcha/api2/bframe*',
'https://www.google.com/recaptcha/enterprise/anchor*',
'https://www.google.com/recaptcha/enterprise/bframe*',
'https://www.recaptcha.net/recaptcha/enterprise/anchor*',
'https://www.recaptcha.net/recaptcha/enterprise/bframe*'
], ],
types: ['sub_frame'] types: ['sub_frame']
}, },

@ -4,7 +4,7 @@
for (const [_, items] of Object.entries(client)) { for (const [_, items] of Object.entries(client)) {
for (const [_, v] of Object.entries(items)) { for (const [_, v] of Object.entries(items)) {
if (v instanceof Element && v.src === challengeUrl) { if (v instanceof Element && v.src === challengeUrl) {
grecaptcha.reset(k); (grecaptcha.reset || grecaptcha.enterprise.reset)(k);
return; return;
} }
} }

@ -44,7 +44,9 @@
{ {
"matches": [ "matches": [
"https://www.google.com/recaptcha/api2/bframe*", "https://www.google.com/recaptcha/api2/bframe*",
"https://www.recaptcha.net/recaptcha/api2/bframe*" "https://www.recaptcha.net/recaptcha/api2/bframe*",
"https://www.google.com/recaptcha/enterprise/bframe*",
"https://www.recaptcha.net/recaptcha/enterprise/bframe*"
], ],
"all_frames": true, "all_frames": true,
"run_at": "document_idle", "run_at": "document_idle",

Loading…
Cancel
Save