Use this event to listen for messages from another extension.
To send a message which will be received by the onMessageExternal
listener, use runtime.sendMessage()
, passing the ID of the recipient in the extensionId
parameter.
Along with the message itself, the listener is passed:
- a
sender
object giving details about the message sender - a
sendResponse
function which it can use to send a response back to the sender.
This API can't be used in a content script.