How to communicate betweeen background and MAIN content script?

Hello! My design is like this: 1. In option page, set value. 2. In a specific websites, show its value (just simplified yeah) I'm struggle with finding the way to send value from option page to content script in MAIN area. Is there any recommended/standard way?
2 Replies
Roeniss
RoenissOP•4mo ago
GitHub
[BUG] Example code in documentation throws an error. Sending a mess...
What happened? Docs example of sending a message from MAIN world CS to background throws an error. When trying to send a message to background thread from MAIN world CS I get this error: Error: Ext...
Roeniss
RoenissOP•4mo ago
Oh, never mind. I successfully use storage api with removing below line:
export const config: PlasmoCSConfig = {
matches: ["..."],
world: "MAIN",
run_at: "document_end"
}
export const config: PlasmoCSConfig = {
matches: ["..."],
world: "MAIN",
run_at: "document_end"
}
but still wondering why I can modify DOM without this "MAIN" line
Want results from more Discord servers?
Add your server