I have added a click listener to the Gmail "Send" button and am using event.preventDefault()
and event.stopPropogation()
to try and stop the email from sending, however, the email is still sending and the try catch
blocks arent registering any errors.
$("div:contains('Send')").last().click(function(event){
try{
console.log("preventing default");
event.preventDefault();
}catch(error){
console.log(error);
}
try{
console.log("stopping propogation");
event.stopPropagation();
}catch(error){
console.log(error);
}
alert("Hello");
});
This is the code I am using, I'd appreciate any input on why this isn't stopping the event execution.