Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between onActivated and onHighlighted?

I'm having trouble understanding the difference between the two.

onActivated: Fires when the active tab in a window changes. http://developer.chrome.com/extensions/tabs.html#event-onActivated

onHighlighted: Fired when the highlighted or selected tabs in a window changes. http://developer.chrome.com/extensions/tabs.html#event-onHighlighted

like image 499
Orry Avatar asked Dec 04 '13 18:12

Orry


1 Answers

In Chrome, the user can 'highlight' more than one tab by holding the Shift or Ctrl keys and clicking on the tabs (the usual rules apply, Shift extends the selection, Ctrl toggles it). When there is more than one tab highlighted, the context menu for the tabs changes so that some actions are in plural (for instance, 'Close tabs' instead of 'Close tab').

In contrast, there is always exactly one active tab per window, which in addition is always highlighted.

The different events refer to these two different concepts.

like image 191
rsanchez Avatar answered Nov 13 '22 02:11

rsanchez