We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Shows one or more tabs that were previously hidden by a call to tabs.hide.

This is an asynchronous function that returns a Promise.

Syntax

var showing = browser.tabs.show(
  tabIds          // integer or integer array
)

Parameters

tabIds
integer or array of integer. The IDs of the tab or tabs to show.

Return value

A Promise that will be fulfilled with no arguments. If any error occurs, the promise will be rejected with an error message.

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
Basic support No No591 No No

1. From version 59: this feature is behind the extensions.webextensions.tabhide.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

Examples

Show a single tab:

function onShown() {
  console.log(`Shown`);
}

function onError(error) {
  console.log(`Error: ${error}`);
}

browser.tabs.show(2).then(onShown, onError);

Show multiple tabs:

function onShown() {
  console.log(`Shown`);
}

function onError(error) {
  console.log(`Error: ${error}`);
}

browser.tabs.show([15, 14, 1]).then(onShown, onError);

Document Tags and Contributors

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