tabs.getSelected()

This method has been deprecated. Use tabs.query({active: true}, ...) instead.

Gets the tab that is selected in the specified window.

Syntax

browser.tabs.getSelected(
  windowId,           // optional integer
  function(tab) {...} // function
)

Parameters

windowIdOptional
integer. Defaults to the current window.
callback
function. The function is passed the following arguments:
tab
tabs.Tab.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?NoYesNo
Firefox
Basic supportNo

Acknowledgements

This API is based on Chromium's chrome.tabs API. This documentation is derived from tabs.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg, jonathanKingston
 Last updated by: wbamberg,