Skip to content

Commit

Permalink
feat: support for Enter key
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Apr 10, 2023
1 parent 7c3970f commit f6d908b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions extension-src/firefox/js/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down

0 comments on commit f6d908b

Please sign in to comment.