{
"manifest_version": 2,
"name": "Test",
"description": "Тест расширения",
"version": "1.1",
"icons": {
"128": "128.png"
},
"browser_action": {
"default_popup": "index.html"
},
"permissions": [
//"tabs",
"activeTab"
],
"background": {
"scripts": [
"jquery.js",
"background.js"
]
},
"content_scripts": [
{
"matches": ["http://*/*"],
//"matches": ["https://www.yandex.ru/"],
"css": ["style.css"],
"js": ["jquery.js","popup.js"]
}
]
}
chrome.runtime.sendMessage({greeting: "hello"}, function(response) {
console.log(response.farewell);
});
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(sender.tab ?
"from a content script:" + sender.tab.url :
"from the extension");
if (request.greeting == "hello")
sendResponse({farewell: "goodbye"});
});