From f6d908b1fa6e8cd7f4c48824923876440413926a Mon Sep 17 00:00:00 2001 From: proffapt Date: Mon, 10 Apr 2023 17:35:46 +0530 Subject: [PATCH] feat: support for Enter key --- extension-src/firefox/js/feedback.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/extension-src/firefox/js/feedback.js b/extension-src/firefox/js/feedback.js index a7ecdcf..79c62d9 100644 --- a/extension-src/firefox/js/feedback.js +++ b/extension-src/firefox/js/feedback.js @@ -55,6 +55,7 @@ browser.runtime.sendMessage({ submitButton.setAttribute("onclick", "document.form1.method = 'POST'; document.form1.action = 'rev_feed_submit.jsp'; document.form1.submit();") submitButton.addEventListener("click", async () => { + console.log("Submit kardiya.. wuhu") await sleep(3000); prof = document.getElementById('myframe').contentDocument.querySelectorAll('input[name="check"]'); if (profCounter < prof.length) { @@ -73,6 +74,30 @@ browser.runtime.sendMessage({ handleCourse(); } }); + + captchaText = document.getElementById('myframe').contentDocument.getElementById('passline'); + captchaText.addEventListener("keydown", async (event) => { + if (event.key === "Enter") { + console.log("Submit kardiya.. wuhu") + await sleep(3000); + prof = document.getElementById('myframe').contentDocument.querySelectorAll('input[name="check"]'); + if (profCounter < prof.length) { + if (submitButton == null) { + fill_form(); + submitButton.setAttribute("onclick", "document.form1.method = 'POST'; document.form1.action = 'rev_feed_submit.jsp'; document.form1.submit();") + } + profCounter--; + handleProf(); + } else { + if (submitButton == null) { + fill_form(); + submitButton.setAttribute("onclick", "document.form1.method = 'POST'; document.form1.action = 'rev_feed_submit.jsp'; document.form1.submit();") + } + courseCounter--; + handleCourse(); + } + } + }); } else { if (profCounter < prof.length) handleProf(); else handleCourse();