Add captcha-passcheck.js
This commit is contained in:
parent
303ce83990
commit
49078efe1f
1 changed files with 22 additions and 0 deletions
22
captcha-passcheck.js
Normal file
22
captcha-passcheck.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
// Function to extract the "captcha" parameter from the iframe's URL
|
||||||
|
function getUrlParameter(url, name) {
|
||||||
|
const urlParams = new URLSearchParams(new URL(url).search);
|
||||||
|
return urlParams.get(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to check CAPTCHA from the iframe
|
||||||
|
function checkCaptchaFromIframe() {
|
||||||
|
const iframe = document.getElementById('captcha-frame');
|
||||||
|
const iframeUrl = iframe.src; // Get the URL of the iframe
|
||||||
|
|
||||||
|
const captchaValue = getUrlParameter(iframeUrl, 'captcha');
|
||||||
|
|
||||||
|
// Check if the 'captcha' parameter exists and is a valid number
|
||||||
|
if (captchaValue && !isNaN(captchaValue)) {
|
||||||
|
document.getElementById('captcha-status').textContent = "CAPTCHA Passed!";
|
||||||
|
document.getElementById('captcha-status').style.color = "green";
|
||||||
|
} else {
|
||||||
|
document.getElementById('captcha-status').textContent = "CAPTCHA Failed. No valid answer found.";
|
||||||
|
document.getElementById('captcha-status').style.color = "red";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue