In my Content Script, I have an element (an a
tag, to be more specific) and I need to add an event to it. The event handler, however, is defined in the page JS, and I dont know how to attach it to the event of my element in the extension. What I want to achieve is:
element.addEventListener("mouseover", pageFunction("foo", "bar"));
I have read other questions, like this one, which suggests injecting code or using location.href="javascript:pageFunction(); void 0";
but I dont see how I could apply them in my case.