Multiple Content Scripts are triggering on sendToContentScript. I want just one of them to trigger and I don't understand why multiple are triggering.
When I run the extension, the popup opens successfully. I can see two buttons:
But when I press either button, the console logs from BOTH content scripts are printed. The console logs from only the expected function is printed to the extension log.
What happened?
Multiple Content Scripts are triggering on
sendToContentScript
. I want just one of them to trigger and I don't understand why multiple are triggering.When I run the extension, the popup opens successfully. I can see two buttons:
But when I press either button, the console logs from BOTH content scripts are printed. The console logs from only the expected function is printed to the extension log.
Example:
I have 3 files that I'm editing. Everything else is the default from the initial creation of my Plasmo project. Here are the files:
popup.tsx
First content script:
contents/getHighlightedContent.tsx
Second content script:
contents/pasteContent.tsx
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
(OPTIONAL) Contribution
Code of Conduct