I'm developing a Google Chrome extension, which produces an error I can't fix.
My manifest.json looks like this:
{
"name": "my extension",
"version": "1.0",
"background_page": "background.html",
"permissions": [
"tabs",
"<all_urls>"
],
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"],
"all_frames": true
}
]
}
background.html tries to talk with content.js:
<script>
chrome.tabs.onUpdated.addListener
(
function(tabId, changeInfo)
{
chrome.tabs.sendRequest(tabId, {action : 'getMyValue'}, function(output) {
console.log(output);
});
}
);
</script>
Finally, content.js:
chrome.extension.onRequest.addListener(function(request, sender, callback)
{
if (request.action == 'getMyValue')
{
callback('test');
}
});
Developer Tools console prints: "Port error: Could not establish connection. Receiving end does not exist." in "miscellaneous_bindings" on line 232.
Any ideas?