Add captcha-passcheck.js

This commit is contained in:
Arma-Damna-Dillo 2025-02-15 17:00:26 +00:00
parent 303ce83990
commit 49078efe1f

22
captcha-passcheck.js Normal file
View 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";
}
}