-
-
Notifications
You must be signed in to change notification settings - Fork 2
Message Passing
Leonardo Riether edited this page Feb 17, 2020
·
1 revision
The browser extension has many .js scripts that run in different contexts, so they need to send messages to each other to communicate. There are currently four distinct execution contexts:
- Index aka
index.js
- Content aka
contentScript.js
- Background aka
background.js
- Popup aka
popup.js
These are all of the ways you can send a message in Codeforces++. There's no direct index -> background communication, nor content -> all tabs, etc.
- who sends it: index
- params: key
- expected result:
{ [key]: {...} }
- who sends it: index
- params: key, value
- expected result:
undefined
. It's only there to differentiate between abg result
and anerror
type