I'm facing an issue while trying to invoke the relayMessage function from a webpage. Regardless of the methods I have tried, I'm unable to successfully call the function. I would appreciate some assistance in resolving this problem.
Steps to Reproduce:
In my web project, I have included the necessary dependencies and initialized the required configurations as per the documentation.
I have written the code to call relayMessage at an appropriate location in the webpage, as shown below:
import type { PlasmoCSConfig } from "plasmo"
import { relayMessage} from "@plasmohq/messaging"
export const config: PlasmoCSConfig = {
matches: [
"*://*.localhost/*",
]
}
relayMessage({
name: "node"
})
I expect that after invoking the relayMessage function, the message should be sent successfully and trigger the corresponding logic.
Actual Result:
However, despite my attempts, the function fails to be called successfully. I have checked the console for any error messages, but I haven't come across any helpful hints.
Troubleshooting Steps Taken:
I have ensured that all the required dependencies and configurations are correctly loaded before invoking relayMessage.
I tried adding some debug logs before calling relayMessage to check for any errors or exceptions, but I still couldn't identify the root cause of the issue.
Possible Causes and Solutions:
Might be good to add this to the docs somewhere, or perhaps we should just add a document ready listener for the relay API. What do you think @brucetod ?
I'm facing an issue while trying to invoke the relayMessage function from a webpage. Regardless of the methods I have tried, I'm unable to successfully call the function. I would appreciate some assistance in resolving this problem.
Steps to Reproduce:
In my web project, I have included the necessary dependencies and initialized the required configurations as per the documentation. I have written the code to call relayMessage at an appropriate location in the webpage, as shown below:
And on our website page:
Expected Result:
I expect that after invoking the relayMessage function, the message should be sent successfully and trigger the corresponding logic.
Actual Result:
However, despite my attempts, the function fails to be called successfully. I have checked the console for any error messages, but I haven't come across any helpful hints.
Troubleshooting Steps Taken:
I have ensured that all the required dependencies and configurations are correctly loaded before invoking relayMessage. I tried adding some debug logs before calling relayMessage to check for any errors or exceptions, but I still couldn't identify the root cause of the issue. Possible Causes and Solutions:
Thank you!