I have written an extension, which changing his icon on websites, who matches the if clause. Take a look:
chrome.tabs.onActivated.addListener(
function (activeInfo) {
chrome.tabs.get(activeInfo.tabId, function(tab){
hosterRegExp(tab.url); //Function to change Icon
});
}
);
chrome.tabs.onUpdated.addListener(
function checkHosts(tabId, changeInfo, tab) {
hosterRegExp(tab.url); //Function to change Icon
}
);
Every time the active tab is changed or a tab is getting reloaded the function hosterRegExp is called with the current URL. This works fine.
Now, that's not working with two windows. If I change between two windows, it doesn't call the hosterRegExp(); that's because the active tab is not reloaded nor is it changing the active tab.
Also I couldn't find another EventHandler which would help me. So I have to check also the current windowID? I don't know - please help me.
Thank you.