I know that question has been repeatedly asked in different ways, but I tried to go through all the answers (hopefully I didn\'t miss anyone) and none of them worked for me.
Here's an example of a background script that sends a message to the content-script file.
background.js
chrome.tabs.sendMessage(tabs[0].id,"your message");
content-script/content.js
chrome.runtime.onMessage.addListener(function (response, sendResponse) { console.log(response); });