发现了一个问题,当用户在IE中点击刷新时,Google recaptcha(不可见或v2)将无限期地旋转。通过监控流量,当有人点击复选框时,似乎从未向Google调用API以进行重新访问。
使用recaptchaV2重现的步骤:
注意:
grecaptcha.reset()
没有运气以下是我用来隔离问题的代码。我使用npm install http-server -g和http-server来提供文件。
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes">
<script src="https://www.google.com/recaptcha/api.js?onload=onload&render=explicit" async defer></script>
</head>
<body>
<div id="gr123"></div>
<script>
window.hasLoaded = false;
window.onload = function() {
var elem = document.getElementById("gr123");
if(!window.hasLoaded) {
window.hasLoaded = true;
grecaptcha.render(elem, {
"sitekey": "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI",
"size": 'normal'
});
grecaptcha.reset();
}
}
</script>
</body>
</html>