tabs.update()

Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.

Syntax

browser.tabs.update(
  tabId,              // optional integer
  updateProperties,   // object
  function(tab) {...} // optional function
)

Parameters

tabIdOptional
integer. Defaults to the selected tab of the current window.
updateProperties
object. The set of properties to update for this tab. To learn more about these properties, see the tabs.Tab documentation.
 
urlOptional
string. A URL to navigate the tab to. 
For security reasons, in Firefox, this may not be a privileged URL. So passing any of the following URLs will fail, with runtime.lastError being set to an error message:
  • chrome: URLs
  • javascript: URLs
  • data: URLs
  • privileged about: URLs (for example, about:config, about:addons, about:debugging) . Non-privileged URLs (about:home, about:newtab, about:blank) are allowed.
activeOptional
boolean. Whether the tab should be active. Does not affect whether the window is focused (see windows.update).
highlightedOptional
boolean. Adds or removes the tab from the current selection.
selectedOptional
boolean. Whether the tab should be selected.

Deprecated.

pinnedOptional
boolean. Whether the tab should be pinned.
mutedOptional
boolean. Whether the tab should be muted.
openerTabIdOptional
integer. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab.
callbackOptional
function. The function is passed the following arguments:
tabOptional
tabs.Tab. Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl unless the "tabs" permission has been requested.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.01Yes33
Firefox
Basic supportNo

1. It's not possible to update the "highlighted" and "selected" properties.

Examples

Example add-ons

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,