Search code examples
google-chrome-extensionbrowser-tab

Where is the documentation for the chrome extension API tab method, "getSelected"?


So I'm creating my first chrome extension and was extremely confused for a while as I could not figure out how to grab the url of the currently open tab, until some research pointed me in the direction of chrome.tabs.getSelected(). The problem is, I cannot find anything in the API docs on this method. I've even found links to where it's supposed to be (http://code.google.com/chrome/extensions/tabs.html#method-getSelected) but it's not there. Am I missing something? Is this method deprecated and supposed to be replaced with something else?


Solution

  • chrome.tabs.getSelected was removed in release 16.

    The methods getAllInWindow() and getSelected() have been deprecated. To get details about all tabs in the specified window, use chrome.tabs.query() with the argument {'windowId': windowID}. To get the tab that is selected in the specified window, use chrome.tabs.query() with the argument {'active': true}.

    The documentation for chrome.tabs.query is here.