--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/4c6a295d-5e25-4ce3-b25a-0eec5ad40017%40chromium.org.
The background page cannot communicate with the tab itself, it has to communicate with code that runs in the world of the extension.The world of the extension consists of content scripts or scripts that were executed using chrome.tabs.executeScript.Either way, in order to get the messages, you have to add a listener to onMessage, like Muhammad Qayyum Abro showed.In order to communicate with the tab itself (from the content script or executed script), you can use the usual postMessage API.
☆PhistucK
On Mon, Jul 24, 2017 at 6:24 PM, GMathew <sonesh...@gmail.com> wrote:
To clarify, I have a tab open , in background.js I need to call a function located in that tab. I can do that by injecting code or sending a message from background ?
On Monday, July 24, 2017 at 11:20:03 AM UTC-4, Muhammad Qayyum Abro wrote:In content.jschrome.runtime.onMessage.addListener(function(msg, sender, sendResponse){if(msg.action == "message"){//CODE...}});
--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.