Google ReCAPTCHA v3左下角 [英] google reCAPTCHA v3 bottomleft

查看:0
本文介绍了Google ReCAPTCHA v3左下角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通读https://www.gstatic.com/recaptcha/api2/v1531759913576/recaptcha__en.js处的代码时,有许多对bottomleft的引用(我假设与图标通常放置的bottomright相反)。

但如何启用此设置并将图标移动到左下角?

推荐答案

刚刚解决了这个问题。您需要:

window._grecaptcha_callback = () => {
  window.grecaptcha.render({
    sitekey: grecaptcha_key,
    badge: 'bottomleft',
  })
  window.grecaptcha.ready(() => {
    // grecaptcha is ready
  })
}

然后将脚本加载为https://www.google.com/recaptcha/api.js?onload=_grecaptcha_callback

这样,您调用Execute的方式必须稍微更改为简单

window.grecaptcha.execute(0, {action})

0而不是站点密钥作为第一个参数。

浏览代码时,还有许多其他未记录的设置:

sitekey, type, theme, size, tabindex, stoken, bind, preload, badge, s, pool, 'content-binding', action

但除了sitekeybadge,我不知道它们是做什么的。但它们可能大致对应于settings for v2

这篇关于Google ReCAPTCHA v3左下角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆