I'm trying to get a message from a content script, and then pass a message to a different content script / tab:
chrome.extension.onRequest.addListener(function (request, sender) {
chrome.tabs.query({ url: "https://admin3.xxx.xxx.com" }, function (tab) {
chrome.tabs.update(tab[0].id, { highlighted: true }, function () {
chrome.tabs.sendMessage(tab[0].id, { whatsup: "Hello from background" });
console.log(request);
});
});
});
I get the request from the first content script on tab 1 but tab 2 does not pick up the sendMessage?