How to detect if a SPFx Application Customizer is running inside Microsoft Teams
SharePoint Application customizers allow you to customize SharePoint further, giving you access to safe containers where you can add extra components to improve the out of the box experience. This type of customization is perfect for solutions that you want to make available in all modern pages within a site collection or even in the entire tenant.
All this is great but there is a twist when it comes to using SPFx Application customizers in the context of SharePoint pages rendered inside Microsoft Teams, if you want to change the behavior on this scenario or simply not load the extension at all, there are no straightforward way to detect the Teams context as we have with web parts.