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
orinteger
ofarray
. The IDs of the tab or tabs to show.integer
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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | ||||
---|---|---|---|---|---|
Basic support | Chrome No support No | Edge No support No | Firefox
Full support
61
| Opera No support No | Firefox Android No support No |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- User must explicitly enable this feature.
- User must explicitly enable this feature.
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);