Sends a single message from the extension's background scripts (or other privileged scripts, such as popup scripts or options page scripts) to any content scripts or extension pages/iframes that belong to the extension and are running in the specified tab.
The message will be received in the extension context by any listeners to the runtime.onMessage
event. Listeners may then optionally return something as a response back to the sender.
This is an asynchronous function that returns a Promise
.
Note: You can also use a connection-based approach to exchange messages.