Вот мой манифест:
{
"name": "my-app",
"version": "0.0.9",
"manifest_version": 2,
"description": "my App",
"content_scripts": [
{
"matches": [
"https://*/*"
],
"js": [
"js/vendors/jquery-3.3.1.min.js",
"js/content.js"
]
}
],
"background": {
"scripts": [
"js/background.js"
]
}
}
и вот мои сценарии:
// background.js
chrome.tabs.query({active: true, currentWindow: true}, function(tabs){
setInterval(() => {
chrome.tabs.sendMessage(tabs[0].id, 'some-message');
}, 3000);
});
// content.js
chrome.runtime.onMessage.addListener(function(msg, sender, sendResponse) {
console.log('in runtime')
console.log(msg);
});
chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {
console.log('in extensions')
console.log(msg);
});
Я никогда ничего не регистрирую;что мне здесь не хватает?