CloseTab Operation

This operation is used to close a particular browser tab, or an MSI tab that's opened in the current browser tab. This is an operation specific to the tab and should be executed on TabContext. The response fetches the closed tab's identifier details in the ITabInfo object.

Note: CloseTab Operation is an operation publishable from the TabContext level.
Here's a TypeScript example:
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID','V1');
    const tabContext: ITabContext = await frameworkProvider.getTabContext();
    const payload: IOperationRequest = 
frameworkProvider.requestHelper.createPublishRequest('cxEventBusCloseTabOperation');
    tabContext.publish(payload).then((message: IOperationResponse) => {
        const tabInfo: ITabInfo = (message as ITabCloseOperationResponse).getResponseData();
        const browserTabId: string = tabInfo.getTabId();
        const MSITabId: string = tabInfo.getMSITabId();
    }).catch((error: IErrorData) => {
    });
Here's a JavaScript example:
const frameworkProvider = await 
CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID', 'v1');
    const tabContext = await frameworkProvider.getTabContext();
    const payload = 
frameworkProvider.requestHelper.createPublishRequest('cxEventBusCloseTabOperation');
    tabContext.publish(payload).then((response) => {
        const tabInfo = response.getResponseData();
        const browserTabId = tabInfo.getTabId();
        const MSITabId = tabInfo.getMSITabId();
    }).catch((error) => {
    });