Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chrome.tabs.highlight giving error "No tab at index"

When calling chrome.tabs.highlight({'tabs': tabId}, function(){}); I'm getting this error:

Unchecked runtime.lastError while running tabs.highlight: No tab at index: 7355.

like image 582
drew hintz Avatar asked May 05 '15 21:05

drew hintz


1 Answers

chrome.tabs.highlight requires a tab index, not a tabId. You can convert a tabId into an index using chrome.tabs.get:

chrome.tabs.get(tabId, function(tab) {
  chrome.tabs.highlight({'tabs': tab.index}, function() {});
});
like image 146
drew hintz Avatar answered Sep 21 '22 13:09

drew hintz