6

语境:

我尝试编写一个显示提要列表的简单 Microsoft Teams 选项卡。我可以将我的选项卡侧加载到 Teams 并从频道“+”菜单中选择它。

问题:

如果我想保存我的设置,则会出现一条错误文本,上面写着“我们无法保存您的标签设置。请重试。” 我的浏览器的 javascript 错误控制台中没有错误。

我的 config.html 选项卡 javascript 代码:

<script type="text/javascript">
    microsoftTeams.initialize();
    microsoftTeams.settings.registerOnSaveHandler(function (saveEvent) {

        microsoftTeams.settings.setSettings({
            entityId: "example",
            contentUrl: "https://example.com/tab.html",
            suggestedDisplayName: "example",
            websiteUrl: "https://example.com",
            removeUrl: "https://example.com/remove.html"
        });

        saveEvent.notifySuccess();
    });

    function onClick() 
    {
        microsoftTeams.settings.setValidityState(true);
    }
</script>

我的清单.json

{
  "$schema": "https://statics.teams.microsoft.com/sdk/v0.4/manifest/MicrosoftTeams.schema.json",
  "manifestVersion": "0.4",
  "id": "ee90834a-d649-458d-a4e2-0b0f8d425c11",
  "version": "1.0",
  "name": "WINSider Community Deutschland",
  "developer": {
      "name": "WINSider Community Deutschland",   
      "websiteUrl": "https://windowscommunity.de",
      "privacyUrl": "https://windowscommunity.de/de/impressum/",
      "termsOfUseUrl": "http://windowscommunity.de/de/impressum/"
  },
  "tabs" : [{
    "id": "ee90834a-d649-458d-a4e2-0b0f8d425c11",
    "name": "WINSider Community",
    "description" : {
      "short": "WINsider article list as a tab",
      "full": "Summarizes the windowscommunity.de blog posts as a clickable list."
    },
    "icons": {
      "44": "icon44.png",
      "88": "icon88.png"
    },
    "accentColor" : "#37A3CF",
    "configUrl": "https://tscholze.github.io/public/teamstab/config.html",
    "canUpdateConfig": true
  }],
  "needsIdentity": false,
  "validDomains": [
      "*.github.io",
      "*.github.com",
      "*.googleapis.com",
      "*.microsoft.com",
      "*.rss2json.com",
      "*windowscommunity.de"
  ]
}
4

2 回答 2

4

供您参考

David 将答案作为对我的Github 问题的评论发布。谢谢你。

长话短说 *example.org,允许域调用像http://example.org并且http://www.example.org不是一个有效的定义 oaf a validDomain

于 2017-04-25T06:16:14.153 回答
3

看起来您的contentUrlwebsiteUrlremoveUrl正在使用不在您validDomains列表中的域。这将导致保存失败。

于 2017-04-21T15:14:34.753 回答