Open rudiedirkx opened 7 years ago
Once up on a time the icons of extensions could be in the addressbar, at that time the state was stored with the tab. So we didn't have to do anything to get the behaviour you describe.
The early return was to prevent issues with;
http
, like the welcome page, but this might not be necessary anymore because of the removal from the addressbarcomplete
state)Now that we're pushed out of the addressbar this issue did indeed arise, I think the onActivated
is a nice solution for this.
Maybe add chrome.windows.onFocusChanged
too, for same origins in separate windows. I did it like this but yours will be different.
I don't understand the early return in
chrome.tabs.onUpdated
, because I always want to know the status. When you're loading a tab, you don't know it Xdebug is on. That's strange.This PR doesn't fix that, because you probably have your reasons, but it does add a
chrome.tabs.onActivated
to status check for every tab switch. Currently, you can only see the actual status inside the popup, because the icon doesn't update after a tab switch.I think the whole thing can be much simpler with webRequest, but this is a start.