最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Difference between onActivated and onHighlighted? - Stack Overflow

programmeradmin4浏览0评论

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

onActivated: Fires when the active tab in a window changes. .html#event-onActivated

onHighlighted: Fired when the highlighted or selected tabs in a window changes. .html#event-onHighlighted

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

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

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

Share Improve this question asked Dec 4, 2013 at 18:54 OrryOrry 2771 gold badge3 silver badges11 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 14

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.

发布评论

评论列表(0)

  1. 暂无评论