ACtl.closeTab
Closes one or more tabs and windows.
ACtl.closeTab([tabSpec]) tabSpec Type: TabSpec Default: undefined
One or more tabs to close. It can be either a tab ID, a filter object, a tab-selection name or an array combining all that. Full details at Tab Specifier.
If omitted, the tab the script is running in will be closed.
Returns Type: Promise Resolves to: number
Returns immediately. The Promise will resolve with the number of tabs that were closed, which may be zero if tabSpec gives an empty set.
Throws Type: string
Error description if tabSpec is not a valid Tab Specifier.
Examples
Close all tabs to the right of the current tab.
let tabCount = await ACtl.closeTab('#allRightTabs') ;
Close the current window.
let tabCount = await ACtl.closeTab('#currWinTabs') ;
Open a URL in a pop-up window, then wait 2 seconds and close the window.
let [tabId] = await ACtl.openURL('http://example.com', {newWindow: 'popup'}) ;
await ACtl.sleep(2000) ;
ACtl.closeTab(tabId) ;