How does sendToContentScript from popup work?

I have 2 buttons on my popup, and when I click them, I want them to send a message to the respective contentscript via the sendToContentScript method, where I have a different function to handle each message. To do so, I have created different tsx files for each of the contentScripts. E.g. sendToContentScript({"name" : "generateFields"} is being listened at the generateFields.tsx file and generateFields() function. However, the message being sent for both buttons keeps going only to one of the content scripts even tho the name being called is different. Could anyone help to explain how the sendToContentScript function works in the popup? Thank you
1 Reply
BlazingBane™
BlazingBane™9mo ago
Have you found the solution? Its been days for me i cant figure out how to fetch local store of a site from my extension
Want results from more Discord servers?
Add your server