Recently, Google Chrome is updated to new version 49.0.2623.87. After this update, my extension stopped working. (Previous versions works fine)
Here is the part of my code
// Content.js
chrome.runtime.onMessage.addListener(function (message, sender, response) {
console.log(message); // > { action: "start" } - I can see message what i've sent.
if(message.action == "start"){
response({result: true});
}else {
response({result: false});
}
});
// Background.js
chrome.tabs.query({currentWindow: true, active: true}, function (tabs) {
console.log(tabs[0]); // here is tab { object } what I've expected
console.log(tabs[0].id); // here id for example 19
// Background.js
chrome.tabs.sendMessage(tabs[0].id, {action: "start"}, function(response){
// RESPONSE = undefined
});
});
Probably something changed in Chrome Extension Api?
I tried to research it, but not found for now. I'll keep looking.. but hope that somebody knows about it!
Thanks!
Also, I found this bug in Chrome bug-tracker.