In my content_script.js for a chrome extension I'm working on I have:
document.addEventListener("funcDoRequest", function (params)
{
alert('From content_script');
});
In my index.html web page how do I call this funcDoRequest from jQuery? Any examples? I need to pass detail.x parameters to it too.
I can do it like this without jQuery but I don't want this:
<script>
var event = new CustomEvent('funcDoRequest', { 'detail': { something: 'something' } });
var go = function () { document.dispatchEvent(event); }
</script>
<a href="javascript:go();">Click me</a>
Thanks.