(tab, tabs)
| 159 | // Find a tab's actual index in a given tab array returned by chrome.tabs.query. In Firefox, there |
| 160 | // may be hidden tabs, so tab.tabIndex may not be the actual index into the array of visible tabs. |
| 161 | function getTabIndex(tab, tabs) { |
| 162 | // First check if the tab is where we expect it, to avoid searching the array. |
| 163 | if (tabs.length > tab.index && tabs[tab.index].index === tab.index) { |
| 164 | return tab.index; |
| 165 | } else { |
| 166 | return tabs.findIndex((t) => t.index === tab.index); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | // |
| 171 | // Selects the tab with the ID specified in request.id |
no outgoing calls
no test coverage detected