Пытаюсь связь между слоями расширения сделать. Но отчаянно не хочет у меня работать. Сделал простой сетап:
по нажатию на иконку расширения в браузере, юзаю chrome.runtime.sendMessage, но контент скрипт не реагирует на него( Есть у кого-то идеи почему? Что я упустил?)
chrome.tabs.sendMessage sends a message to all content scripts from the extension in a given tab (possibly filtered by frame ID)
So, to send a message TO a content script, you need to use chrome.tabs . To send a message FROM a content script (or within the extension pages), you need to use chrome.runtime .
The event is chrome.runtime.onMessage in both cases.