Del via


closeTab (app-profiladministrator)

Lukker den angivne appfane i den aktuelle session.

Notat

Ankerfanen for en session (den første fane) kan ikke lukkes.

Syntaks

Microsoft.Apm.closeTab(tabId);

Parametre

Navn Type Obligatorisk Beskrivelse
tabId String Ja Entydig identifikator for den fane, der skal lukkes.

Returværdi

Ingen.

Eksempler

Lukke en fane ved hjælp af Microsoft.Apm.closeTab

const tab = Microsoft.Apm.getFocusedSession().getFocusedTab();
if (tab.canClose) {
    Microsoft.Apm.closeTab(tab.tabId);
}

Lukke en fane ved hjælp af Microsoft.Apm.getFocusedSession().getFocusedTab().close()

const tab = Microsoft.Apm.getFocusedSession().getFocusedTab();
if (tab.canClose) {
    tab.close();
}