2urnesst
PD🧩 Plasmo Developers
•Created by 2urnesst on 8/2/2024 in #👟framework
Messaging Port API BGSW->sidepanel
Hello! I am having a hard time understanding if Plasmo currently supports the Mesaging API for sending a message from the BGSW to a content script (or in my case, a sidepanel). The docs summary seems to say it exists, but then it doesn't look like the documentation is there yet. Also, the design of the port event handlers has a (req, res) as if it is just immediately responding to messages instead of keeping a connection. In order to send a message from the background, I need to have a reference to the port connection. I tried using it from the req.port, but that didn't seem to send messages successfully. Is this functionality currently supported, or is it only supporting one directional communication initiation currently? For clarity, the content script connects to the port, but then I just need it to recieve messages, not send any.
2 replies