xdebug-helper-for-chrome
xdebug-helper-for-chrome copied to clipboard
Check status on every tab switch
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.
Simpler like this: https://github.com/rudiedirkx/xdebug-helper-for-chrome2/blob/master/xdebug2.background.js
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;
- Pages that are not on
http, like the welcome page, but this might not be necessary anymore because of the removal from the addressbar - Updating the state before the cookies where available (before the
completestate)
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.