From 49078efe1fe25ce8d0ceb996b38fd96149947624 Mon Sep 17 00:00:00 2001 From: sneedgroup-holder Date: Sat, 15 Feb 2025 17:00:26 +0000 Subject: [PATCH] Add captcha-passcheck.js --- captcha-passcheck.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 captcha-passcheck.js diff --git a/captcha-passcheck.js b/captcha-passcheck.js new file mode 100644 index 0000000..60c9d4c --- /dev/null +++ b/captcha-passcheck.js @@ -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"; + } +} \ No newline at end of file