Hi all,
After a few tests, I just wanted to share my understanding of it, in case someone has the same issue.
So,
What is the difference between 'active' and 'highlighted' properties in Chrome extensions Tabs api?
- An active tab is always highlighted. There is only one active tab per window. Careful, as explained
in the doc, a tab can be active even if it's not in the focused window.
- You can have several highlighted tabs in a same window. But then all highlighted tabs are not active. Example: select a tab, hold your Shift key, and select another tab. The last tab clicked will become the active tab for this window, but all tabs between them (including the two limit ones) are now highlighted.
My confusion was also coming from the fact that I thought that 'highlighted' was meaning 'hovered' (you can actually see a highlight on tabs when you hover them, plus it could be useful in the api for notifications, like when you get a mail or message in gmail/hangout).
I personally think that 'selected' would be a better wording.
Simple test for understanding, along with the previously described procedure:
chrome.tabs.query({
'active':true,
}, function(lTabs) {
console.log(lTabs)
});
and
chrome.tabs.query({
'highlighted':true,
}, function(lTabs) {
console.log(lTabs)
});
Hope it can help someone one day. If any mistake from my part, please feel free to correct me!
Raphaël