added filter for curren spam mails
This commit is contained in:
parent
35ee0eeb4b
commit
af62a449e6
1 changed files with 16 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
// Configuration and Messages
|
// Configuration and Messages
|
||||||
const debugEnabled = false
|
const debugEnabled = true
|
||||||
const mouseDebugEnabled = false
|
const mouseDebugEnabled = false
|
||||||
const zsrCheckEnabled = false
|
const zsrCheckEnabled = false
|
||||||
const interactionThreshold = 15 // Time in seconds
|
const interactionThreshold = 15 // Time in seconds
|
||||||
|
|
@ -43,6 +43,11 @@ const captcha = document.querySelectorAll('.captcha')
|
||||||
const captchaInput = document.querySelectorAll('.captcha-input')
|
const captchaInput = document.querySelectorAll('.captcha-input')
|
||||||
const captchaVerifyButton = document.querySelectorAll('.captcha-verify')
|
const captchaVerifyButton = document.querySelectorAll('.captcha-verify')
|
||||||
const botBadge = document.createElement('div')
|
const botBadge = document.createElement('div')
|
||||||
|
|
||||||
|
// Form fields
|
||||||
|
const subjectField = document.getElementById('subject')
|
||||||
|
const messageField = document.getElementById('description')
|
||||||
|
|
||||||
if (debugEnabled) {
|
if (debugEnabled) {
|
||||||
botBadge.className = 'bot-badge'
|
botBadge.className = 'bot-badge'
|
||||||
document.body.appendChild(botBadge)
|
document.body.appendChild(botBadge)
|
||||||
|
|
@ -102,6 +107,9 @@ function handleMouseMove(event) {
|
||||||
function checkForBotBehavior() {
|
function checkForBotBehavior() {
|
||||||
let timeSpent = (Date.now() - startTime) / 1000
|
let timeSpent = (Date.now() - startTime) / 1000
|
||||||
botDetected =
|
botDetected =
|
||||||
|
subjectField.value === "I promised." ||
|
||||||
|
// or if messageField Has string "Hi, this is" in it
|
||||||
|
messageField.value.startsWith("Hi, this is") ||
|
||||||
!userInteracted ||
|
!userInteracted ||
|
||||||
interactionCount === 0 ||
|
interactionCount === 0 ||
|
||||||
honeypotInput1.value !== '' ||
|
honeypotInput1.value !== '' ||
|
||||||
|
|
@ -131,7 +139,11 @@ function checkForBotBehavior() {
|
||||||
' honeypotInput2:' +
|
' honeypotInput2:' +
|
||||||
honeypotInput2.value +
|
honeypotInput2.value +
|
||||||
' verifyEmailInput:' +
|
' verifyEmailInput:' +
|
||||||
verifyEmailInput.value
|
verifyEmailInput.value +
|
||||||
|
' subjectField:' +
|
||||||
|
subjectField.value +
|
||||||
|
' messageField:' +
|
||||||
|
messageField.value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
function handleSubmit(e) {
|
function handleSubmit(e) {
|
||||||
|
|
@ -144,7 +156,6 @@ function handleSubmit(e) {
|
||||||
fakeOut()
|
fakeOut()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
const formData = new FormData(form)
|
const formData = new FormData(form)
|
||||||
const formDataEncoded = new URLSearchParams(formData).toString()
|
const formDataEncoded = new URLSearchParams(formData).toString()
|
||||||
const formURL = form.action + '.json'
|
const formURL = form.action + '.json'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue