3

as title I can't able find this method into the Api -> Tabs... Way and where? Thanks'

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Donovant
  • 3,091
  • 8
  • 40
  • 68

3 Answers3

11

It was deprecated in Chrome 16. The correct way is to use chrome.tabs.query with active:true and lastFocusedWindow:true.

// Get the current active tab in the lastly focused window
chrome.tabs.query({
    active: true,
    lastFocusedWindow: true
}, function(tabs) {
    // and use that tab to fill in out title and url
    var tab = tabs[0];
    run({
        url: tab.url,
        description: tab.title
    });
});
Rob W
  • 341,306
  • 83
  • 791
  • 678
Rick
  • 15,484
  • 5
  • 25
  • 29
2

It was removed. Use chrome.tabs.query instead.

abraham
  • 46,583
  • 10
  • 100
  • 152
1

https://developer.chrome.com/extensions/tabs#method-getSelected

It's a deprecated method, but you can still use it.

chrome.tabs.getSelected(null, function(tab) {
  var url = tab.url;
});
Dennis
  • 56,821
  • 26
  • 143
  • 139