TabOpen Event
TabOpen event subscription gives a notification about a browser tab or new window tab open event, or a new MSI tab open event happening in any already opened browser tabs with the Fusion application.
The event response will give the TabContext of the opened tab, on top of which you can call APIs to subscribe or publish APIs or any other tabContext supported APIs. Also, by calling getType API on tabContext, you can identify the type of the opened tab. The type could be the Browser tab, MSI tab, or MSI sub tab.
Note: TabOpen is an event listenable from GlobalContext.
Here's a TypeScript
example:
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID','V1');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const payload: IEventRequest =
frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabOpenEvent');
globalContext.subscribe(payload, (response: IEventResponse) => {
const tabOpenResponse = response as ITabEventResponse;
const tabContext: ITabContext = tabOpenResponse.getResponseData();
const type = tabOpenResponse.getType();
})
Here's a JavaScript example:
const frameworkProvider =await
CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID', 'v1');
const globalContext = await frameworkProvider.getGlobalContext();
const payload =
frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabOpenEvent');
globalContext.subscribe(payload, (response) => {
const tabContext = response.getResponseData();
const type = tabOpenResponse.getType();
})