Communicating between two chrome extensions

Viewed 1884

I am trying to communicate between two chrome extensions, but unable to do so.

Any help would be great in resolving this issue.

1st extension sending msg in background.js:

chrome.browserAction.onClicked.addListener(
function(tab)
{
    chrome.runtime.onConnect.addListener(function(port)
{
     port.postMessage({status:"hello"});
});

2nd extension receiving msg in background.js:

var port = chrome.runtime.connect({name: "lkddmaimhocofkfhngkdhdicmldnfdpn"});
port.onMessage.addListener(function(message,sender)
{
  alert('listened bg');
});
1 Answers
Related