Broswer Plugin - Sending message from Content to the Plugin


John Clarke

In my plugin I have attached an event to all anchor tags on the content by using the following code :

My event for the hyperLinkHandler is as follows :

althought the console.log works the chrome.runtime.sendMessage isn't sending the message to the WebExtMessage event in order to be gathered by the plugin.

How can I fix this ?


DecSoft

Hello John,

Certainly, you touch a good point... you are right, the "sendMessage" don't work as expected, well, as you can see it working in the WebExtension sample app, for example. I think this can be caused because the "sendMessage" used in the WebExtension sample app is called after an action (a button click) in the same app, and not an event from the extension content script.

Let me to take a look, John, maybe I can find some possible alternative or finally find what can happen in this situation.



John Clarke
I think I have a working solution. I will email it to you.

Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.