We want to add functionality to an already existing page using a browser extension. Suppose an element already has functions bound to its onclick
event. I am binding a new function to the onclick
of that element. I want to have my function run before all the other functions that have been bound to that event before. I don't want them to begin executing until my function is finished running.
I want to know how I can I bind my new function this way in JavaScript.