How to open a Teams card action URL in a collaborative view instead of new browser window? - botframework

I have a bot that ultimately returns a hero card to a chat message box. This card has an action button that is currently configured to use openUrl, which spawns a new browser window upon click. We now have a requirement to display the same Url in a collaborative view within Teams (i.e. along-side a chat conversation).
I've seen similar functionality when sharing a document via a chat conversation, but can't seem to find any code samples that take this approach for a Url.
Is something like this possible and if so, any ideas how to best implement this approach?

When you use open URL action it will redirect to browser. This is by Design. But you open open the URL with in the task module when you click on the button, The page need to be publicly available and it should be IFrame. Also you need to add the URL domain to the valid domain, so that you can view the Page inside taskmodule without redirecting to browser. Please check this docs for more info

Related

Microsoft teams user detection

I am showing a wordpress website in iframe inside Microsoft teams Tabs. is there any way to detect the loggedIn user in my website?
If you are able to wrap your website inside a Teams app (which you can do for example very easily using App Studio, then you could surface your website as a "Tab" app. Doing this means you can reference the Teams JS library in your code, which will enable you to get a context object. You can get a lot of user information from that.
Be aware though that this context is not really 'trusted' data (it's just inserted via Javascript), so it could be spoofed into your page by a malicious actor. If that's a problem, you should look to implement Tab SSO in your app, which will give you a proper JWT token that you can validate.

How to stop teams tab to redirecting to webpage

I am working on teams tab, looking for a solution to stop teams tab redirecting to browser or redirecting to any website from website icon🌐 on top right corner.
For a configurable tab , in your config page you call setSettings().
There you specify:
the entityId,
contentUrl,
the websiteUrl,
and optionally the removeUrl
Here you can leave the websiteUrl empty/null/None
Note that you will need to provide a content contentUrl which will point to your angular app/site to render the tab in Teams.
However it is important to be aware that this may have impact on the way a mobile client renders the tab.
If you distribute your App via the tenant store , this will have no impact.
For a published store app (via Appsource), the app needs to be approved / whitelisted to use the url in contentUrl. (this should be handled by the AppValidation Team)
Apps that are approved for mobile will use the contentUrl
Non-approved apps will use the websiteUrl, and if you did not provide that , there is nothing to display😶.
This process is intended make sure existing Apps+Tabs properly render on mobile devices,
and is something to be aware of when design / deploying and sending the app for store approval.
https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/what-are-tabs#mobile-clients
also see :
https://learn.microsoft.com/en-us/graph/api/resources/teamstabconfiguration?view=graph-rest-1.0

MSTeams dev: Navigate from Personal tab to different Team/conversation

Question
How can I create a link to navigate to a Team's channel, from within a custom personal tab?
Context
I'm trying to navigate from within a personal tab to a Team the user is a member of. I've tried the only 2 options I can think of so far:
using an a tag
using microsoftTeams.executeDeepLink
But they don't work.
When clicking the a tag, the tab contents are redirect to the general MS Teams navigation page, where you can choose to open in client or web.
When using the microsoftTeams.executeDeepLink function, a result is returned containing the error message The executeDeepLink API is not implemented in this client.
It seems the API only works on team (configurable) tabs on the desktop client.
#Nsevens This feature is not public yet. Could you please try this in the Developer Preview

Automating Wi-Fi Authorization with Firefox SDK

I'm trying to make a Firefox addon with the Firefox Add-on SDK and API, and I have some questions about their possibilities before I start using them.
My college's Wi-Fi authorization expires every 30 minutes only to have fun pissing off their students. There are already some autofill addons available on many browsers but it's still destructing to move the mouse pointer onto the "Login" button and click it when there is one second left to turn in a midterm paper. I've heard my friends complaining like this for months and I myself think the thing is actually annoying sometimes, so I decided to develop a Firefox addon that takes charge of the job so that the authorization process will feel not even existing once the addon is activated. (I just want to impress my friends honestly.)
For ease I would like to develop the addon within the Firefox add-on SDK. I found that my addon would be utilizing the page-mod, password and request APIs; page-mod to detect the Wi-Fi service's auto-redirection into their authorization page, password to fill in the page's form by a student ID and password stored in the individual Firefox browser, request to redirect the "Login Successful!" page into the originally given destination.
So I guess it should be possible to achieve my goal with this SDK and APIs, but there are still some questions that I need to ask before I proceed:
Is it possible to pass a callback function to page-mod::PageMod (not as a String or a URL to another JavaScript file)? If not, can it be done using the lower level API?
Is it possible to actually redirect a page in a tab into another page only using high level APIs?
Is it possible to remember the original destination's location (with the request method and contents) and call it in the process of page-mod::PageMod (in order to re-redirect out of the authorization page)? If not, can it be done using the lower level API?
Is it possible to perform the addon's redirection function on inactive (background) tabs where the opened webpages automatically keep connecting to the Internet and get redirected to the authorization page?
Thank you so much for reading and please spare a little bit of your time for me. Thank you again!
Is it possible to pass a callback function to page-mod::PageMod (not as a String or a URL to another JavaScript file)? If not, can it be done using the lower level API?
No, everything that goes through the port is serialized using JSON serialization (See docs). Instead you would probably emit an event from your content script to execute the callback method with parameters you pass it in the module scope and hardcode parts that need to be done in the content script with port event listeners.
Is it possible to actually redirect a page in a tab into another page only using high level APIs?
Totally, if you're in a content script, you can just set window.location, or in your modules you set the location of a tab, see https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs#url.
Is it possible to remember the original destination's location (with the request method and contents) and call it in the process of page-mod::PageMod (in order to re-redirect out of the authorization page)? If not, can it be done using the lower level API?
Possible? Yes, depends a lot on how the redirection from the W-LAN works. Generally all the SDK offers you is getting load/ready events for tabs and reading a tab's current URL. So if you get a ready event at the point of the redirect you're fine. If your college login remembers the redirect target using a get parameter in the URL you're fine. If your college doesn't adjust the URL, you're fine. If you really need to dig through the request, you'll have to ge a bit deeper than even what the SDK offers you, but it is possible.
Is it possible to perform the addon's redirection function on inactive (background) tabs where the opened webpages automatically keep connecting to the Internet and get redirected to the authorization page?
JS execution for Add-ons is not paused based on a tabs state.

Access to SMS and browser content tombstoning

WP7 newbie here..
In my application, I am using embedded web browser control to load an external web page.
I have a PIN based validation step in that application, which involves
1) User Leaving the current application, (which has a external web page loaded in the embedded web browser) to launch the SMS Inbox.
2) User reads the SMS he just received, which has the PIN. I am sending this SMS to the user.
3) The User then needs to resume back to the original application by hitting back button, to enter the PIN which he received in the SMS earlier.
Once user enters Step2, my application will go into background, and subsequently will get tombstoned. Once user enter Step3, I want to restore application state (with the embedded web browser control), without making a fresh HTTP request again to load the web page.
So, with the given scenario in my mind, I have following two questions -
1) Is there a better way to do all this, like not having to exit the original application, and still let user read the SMS. ( i.e any api to read sms ?)
2) Is there a way to serialize the browser state/save entire web page (with images, css, js) , such that entire web page can be rendered exactly the way it was, when user left the running application.
Important points:
1) I can only use SMS as a communication channel. I can not use something like raw push notification channel, which could let me show PIN to the user, without exiting the application.
2) I am targeting Windows phone 7.0 runtime, but if there is a better option available in Windows Mango update, please do tell me.
Any sort of help is greatly appreciated.
Update:
Added link to the embedded web browser component.
1) There is no API that would let you access the contents of the Messaging hub from inside your application. This is set up for privacy purposes.
2) By default, the web browser saves its state. So if you navigate away from your app, and then come back - the same web page will still be there unless you explicitly re-navigate on activation
1) The better way to do this would be to not embed the web page within an app. Just build a mobile website. If all the functionality is within the web page you gain nothing but problems by trying to put it inside an app.
The web browser control is not intended to be used to create an alternative browser (which is really what you're doing).
2) You can try using the SaveToString() method to store the state of the page when tombstoned but this doesn't allow for modifications to the page since it was loaded (including anything dynamically updated or any state in javascript). If you have multiple pages you'll also need to maintain the internal backstack and the state of each page separately.
Short answer: If you want to put your application logic in a webBrowser control then you can't support tombstoning. Fast-App-Switching (in Mango) partially addresses this but not completely.

Resources