【问题标题】:Microsoft teams configuration tab renders in browser but not native macOS appMicrosoft 团队配置选项卡在浏览器中呈现,但不是在本机 macOS 应用程序中呈现
【发布时间】:2026-01-30 22:15:02
【问题描述】:

我正在开发 Microsoft Teams 选项卡应用。在他们的网络客户端中安装我的应用程序时,我能够成功加载我的选项卡配置页面。在 macOS 客户端中重复此工作流会失败,并且不会呈现任何内容。启用电子日志记录后,我看到以下输出:

[2998:0828/101101.014965:INFO:CONSOLE(113)] "Controller 'kbList' or 'kbSelect', required by directive 'kbItem', can't be found!", source: https://statics.teams.microsoft.com/hashedjs/0-angular-jquery.min-dafbbdf5.js (113) [2998:0828/101101.151096:INFO:CONSOLE(76)] "Unrecognized Content-Security-Policy directive 'prefetch-src'. ", source: https://statics.teams.microsoft.com/hashedjs/0-angular-jquery.min-dafbbdf5.js (76) [2998:0828/101101.151309:INFO:CONSOLE(76)] "Unrecognized Content-Security-Policy directive 'prefetch-src'. ", source: https://statics.teams.microsoft.com/hashedjs/0-angular-jquery.min-dafbbdf5.js (76) [2998:0828/101101.223595:INFO:CONSOLE(76)] "Uncaught (in promise) undefined", source: https://statics.teams.microsoft.com/hashedjs/0-angular-jquery.min-dafbbdf5.js (76) [2998:0828/101101.223676:INFO:CONSOLE(76)] "Uncaught (in promise) undefined", source: https://statics.teams.microsoft.com/hashedjs/0-angular-jquery.min-dafbbdf5.js (76) [2998:0828/101101.400452:INFO:CONSOLE(0)] "Application Cache Checking event", source: https://teams.microsoft.com/_#/conversations/General?threadId=19:c63e6abc4e4b4474a991c921adf0ce77@thread.skype&ctx=channel (0) [2998:0828/101101.469231:INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://teams.microsoft.com/_#/conversations/General?threadId=19:c63e6abc4e4b4474a991c921adf0ce77@thread.skype&ctx=channel (0)

看起来我的 rails 应用程序从未真正收到对 iframed 内容的请求,因为没有记录任何内容。

【问题讨论】:

  • 您的 HTTP 标头设置是什么?特别是看到Content-Security-Policyhere上的评论
  • Content-Security-Policy: default-src https: 'self'; font-src 'self'; frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com; img-src 'self'; object-src 'none'; script-src 'self' *.walkme.com *.logrocket.io *.google-analytics.com ajax.googleapis.com; style-src 'self' 'unsafe-inline'
  • @AlexanderKron 我认为您希望从您的选项卡中获取日志,而不是 Teams 应用程序。尝试此处的说明以显示您的选项卡的 DevTools 窗口:docs.microsoft.com/en-us/microsoftteams/platform/resources/…
  • @AdrianSolis 我在那里看到了相同的日志,但知道这些日志的存在绝对有帮助。我会看看我是否可以使用开发工具获得更多信息

标签: microsoft-teams


【解决方案1】:

我在本地运行我的应用程序,但没有意识到本机客户端需要一个可从外部访问的 URI。使用 ngrok 解决了我的问题

https://docs.microsoft.com/en-us/microsoftteams/platform/resources/general/debug#locally-hosted

【讨论】: