简体   繁体   English

Microsoft 团队用户代理

[英]Microsoft teams user agent

Anyone know the name of user agent used by Microsoft Teams to parsing website?有人知道 Microsoft Teams 用于解析网站的用户代理的名称吗? A customer put a link of my website on his microsoft teams but link is not rendering correctly because is not redirect to my prerender.客户将我网站的链接放在他的 microsoft 团队中,但链接未正确呈现,因为未重定向到我的 prerender。

I also had this question because I wanted to block link unfurling from MS Teams for an app I was developing.我也有这个问题,因为我想阻止 MS Teams 为我正在开发的应用程序展开链接。

I used the following line from in a Flask app我在 Flask 应用程序中使用了以下行

request.user_agent.string

To get this user agent获取此用户代理

Mozilla/5.0 (Windows NT 6.1; WOW64) SkypeUriPreview Preview/0.5

This was January 2020 so it may change over time, FYI这是 2020 年 1 月,所以它可能会随着时间而改变,仅供参考

I suggest you can find it easily.我建议你可以很容易地找到它。 Develop a tiny website to record user-agent of all requests.开发一个小型网站来记录所有请求的用户代理。 Post the url of your website in teams.在团队中发布您网站的 url。 Then you can find it in the recorded user-agents.然后你可以在记录的用户代理中找到它。

On 13 January 2022, the User-Agent strings of the browser used to render Teams Tab content were as follows (running in a small sample of various contexts): 2022 年 1 月 13 日,用于呈现 Teams Tab 内容的浏览器的 User-Agent 字符串如下(在各种上下文的小样本中运行):

Microsoft Teams (work or school) desktop app my x64 Windows 11 machine: Microsoft Teams(工作或学校)桌面应用程序我的 x64 Windows 11 机器:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Teams/1.4.00.32771 Chrome/85.0.4183.121 Electron/10.4.7 Safari/537.36

Teams Android App:团队 Android 应用程序:

Mozilla/5.0 (Linux; Android 11; M2102J20SG Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/97.0.4692.70 Mobile Safari/537.36 TeamsMobile-Android

Teams Web App running in Chrome 97 on Windows:团队 Web 应用程序在 Windows 上的 Chrome 97 中运行:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

I got these by creating a simple tab app that loaded the content URL https://www.httpbin.org/headers , which is a public service that just echoes the request headers in the response, then navigating to that Tab in Teams in the various contexts above.我通过创建一个简单的选项卡应用程序来获得这些,该应用程序加载了内容 URL https://www.httpbin.org/headers ,这是一个公共服务,它只是在响应中回显请求标头,然后在 Teams 中导航到该选项卡上面的各种上下文。

Long story short: As is often the case with user-agent sniffing, it doesn't seem sensible here to depend on the user agent string in your application in any way, because it varies quite a lot depending on the Teams context from which the request is made.长话短说:就像用户代理嗅探的情况一样,在这里以任何方式依赖应用程序中的用户代理字符串似乎是不明智的,因为它根据 Teams 上下文而变化很大提出请求。 Even if you were to try to match "Teams" or "TeamsMobile" for the "app" cases, it doesn't seem documented anywhere and Microsoft could well change it in future.即使您尝试为“应用程序”案例匹配“团队”或“团队移动”,它似乎也没有记录在任何地方,微软将来很可能会改变它。 So, my suggestion is to forget about the Microsoft Teams user agent .所以,我的建议是忘记 Microsoft Teams 用户代理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM