So, I've got a tampermonkey script being injected into Twitter, and I want to add action to the beginning of an eventqueue when the Tweet button is clicked. So far, I have my action firing, but return false;
and e.preventDefault()
neither one stop the form from submitting when adding a click listener to the button or a submit listener to the form. The submit listener event never actually is triggered, but the button one is. So, my question is, what's the best way to make sure:
- My action happens first
- No other actions happen until my ajax is done
I can't seem to stop or find the way that Twitter is submitting the tweet. Unfortunately, my action fires off an ajax call and that ajax call doesn't call its done callback until after the tweet is submitted.
UPDATE: I've also tried e.stopImmediatePropogation()
to no avail..