Hi @임 소은- Yes, there is a way to determine whether the built-in browser in Microsoft Teams is being used in the desktop app or in a web browser. You can use the microsoftTeams.getContext
method to retrieve the context of the Teams client.
The microsoftTeams.getContext
method returns an object that contains information about the current context, including the hostClientType
property. The hostClientType
property indicates whether the Teams client is running in the desktop app or in a web browser.
Here is an example of how you can use the microsoftTeams.getContext
method to determine the host client type:
microsoftTeams.getContext(function(context) {
var hostClientType = context.hostClientType;
if (hostClientType === "desktop") {
console.log("Teams is running in the desktop app.");
} else if (hostClientType === "web") {
console.log("Teams is running in a web browser.");
} else {
console.log("Unable to determine the host client type.");
}
});
In the example above, the hostClientType
property is checked to determine whether Teams is running in the desktop app or in a web browser. You can then perform different actions or display different content based on the host client type.
For more information about the microsoftTeams.getContext
method and the available properties, you can refer to the Microsoft Teams JavaScript SDK documentation.