xdebug-helper-for-chrome icon indicating copy to clipboard operation
xdebug-helper-for-chrome copied to clipboard

Check status on every tab switch

Open rudiedirkx opened this issue 8 years ago • 3 comments

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.

rudiedirkx avatar Sep 01 '17 11:09 rudiedirkx

Simpler like this: https://github.com/rudiedirkx/xdebug-helper-for-chrome2/blob/master/xdebug2.background.js

rudiedirkx avatar Sep 01 '17 12:09 rudiedirkx

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 complete 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.

mac-cain13 avatar Sep 01 '17 12:09 mac-cain13

Maybe add chrome.windows.onFocusChanged too, for same origins in separate windows. I did it like this but yours will be different.

rudiedirkx avatar Sep 01 '17 16:09 rudiedirkx