Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/tabs/remove/index.md
6552 views
------{{AddonSidebar()}}
Closes one or more tabs.
This is an asynchronous function that returns a Promise.
Syntax
Parameters
tabIds:
integerorarrayofintegerThe ids of the tab or tabs to close.
Return value
A Promise that will be fulfilled with no arguments when all the specified tabs have been removed or their beforeunload prompts have been handled. If any error occurs, the promise will be rejected with an error message.
Examples
Close a single tab:
Close multiple tabs:
{{WebExtExamples}}
Browser compatibility
{{Compat}}
Note: This API is based on Chromium's
chrome.tabsAPI. This documentation is derived fromtabs.jsonin the Chromium code.