Forum Discussion
Javascript functions not working in New Teams Tab App
After switching to New Teams, Alert and Confirm javascript functions do not work.
Note: Alert and Confirm functions works in Teams Classic version.
Hello Vaibhavi2495
Regarding alert/confirm/prompt dialogsWe got an update from engineering team that:
The alert/confirm/prompt dialogs provide a subpar user experience and present a security risk since they can be used by apps to spoof the user. We are not planning to make these APIs work in New Teams and Chromium-based browsers are on a path to deprecating this functionality too:
https://groups.google.com/a/chromium.org/g/blink-dev/c/hTOXiBj3D6A/m/JtkdpDd1BAAJ
Please either render inline dialogs within their frame or launch a Task Module (aka Dialog):
https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/what-are-task-modulesWe have raised one bug also to add a note in the documentation:
6 Replies
- Prasad_Das-MSFT
Microsoft
Vaibhavi2495 - Could you please provide more details on your issue? Please provide the code snippets or SDK references
- Vaibhavi2495Copper Contributor
Hi Prasad_Das-MSFT ,
We are using basic JavaScript function "confirm( )" in our teams embedded tab web app. It is working fine in older version of MS Teams, But it is not working in the new Teams Desktop Version 23335.232.2637.4844.
I have attached the MS Teams App Package Zip file for your reference.
Here is my one line of code of my embedded page:
<input type="button" value="Are you sure?" onclick="javascript:confirm('Hey CONFIRM is working!!')"/>
Thanks in advance,
- Prasad_Das-MSFT
Microsoft
Vaibhavi2495 - We tested the app both in Legacy Teams and New Teams (Both in Desktop and Web client) and observed below behaviour.
In Teams Classic (Legacy): (Both Desktop and Web): It works fine
In New Teams: In web client it works fine, but in Desktop clients it doesn't work.
Web Client:
Desktop Client:
Is it working for you in web client (New Teams). Could you please confirm?