Contribution Date
Technology
Contribution Project
Contribution Details
I noticed that, this change wasn't working:
document.body.addEventListener('keypress', function (e) {
if ((e.code == 9) || (e.code == 13)) {
as e.code returns string values such as 'Enter' or 'Tab' and not the code.
I have done this change:
- document.body.addEventListener('keypress', function (e) {
- if ((e.code == 9) || (e.code == 13)) {
+ document.body.addEventListener('keydown', function (e) {
+ if ((e.code == 'Tab') || (e.code == 'Enter')) {
So, that antibot script can detect if the user has pressed enter or tab key. Also, changed the event from 'keypress' to 'keydown' as 'keypress' wasn't working with the tab key.
Let me know if this isn't the right solution.
Contribution Issue Link
Contribution Link
Files count
0
Patches count
0