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.

Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.