Forum Discussion
ccv_o
Feb 13, 2024Copper Contributor
Unable to launch website in pop-up window or new teams tab
I've built a teams tab app and have a requirement of being able to click on a link and load an external website within the teams environment, and not in an external browser. This could either be in an embedded browser pop-up window or in a teams tab. Did some research and found it could be possible using deeplinks. This is what I have so far to test it out:
import { app } from "@microsoft/teams-js";
const openExternalLink = () => {
app.openLink({
deepLink: `https://teams.microsoft.com/l/entity{TeamsAppId}/{TeamsTabId}?msLaunch=true&enableMobilePage=true&suppressPrompt=true&webUrl=google.com`
// an alternative deeplink format
// deepLink: 'https://google.com/',
});
};
Is there a more appropriate way to open the webpage in a pop-up or tab?
I keep getting errors when I run the code above.
The main error I get is: "TypeError: Failed to construct 'URL': Invalid URL"
I would appreciate any help.
2 Replies
- ChetanSharma-msft
Microsoft
Thanks for raising your query.
We will look into it and let you know the updates.- Meghana-MSFTFormer Employee
ccv_o - Please refer the below points.
- You can use dialogues (task modules) to create modal pop-up experiences in your Teams application. Dialogs - Teams | Microsoft Learn
- The deeplink you have used is not the documented format. Please refer this doc to create deeplinks - Deep link to an application - Teams | Microsoft Learn