I am building a chrome extension for all gmail tabs.
I want to run some scripts only when I am visiting some other tab in chrome where it is not enabled/matched
. How can I do that?
I am building a chrome extension for all gmail tabs.
I want to run some scripts only when I am visiting some other tab in chrome where it is not enabled/matched
. How can I do that?
I think you are opt to use chrome.tabs.onActivated.addListener. This listener
"Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.
This listener is assigned in the background.js part of the extension. That's because background.js continues to listen to state changes of windows or tabs. Dont forget to include tab permissions when using this.
This SO thread might offer an insight also.