首页 > 解决方案 > 你能防止上下文触发吗?

问题描述

我正在使用homepageTrigger创建一个 Google Workplace 插件,但是当我测试部署它时,只要我在收件箱中打开电子邮件,插件就会重新加载。目前, manifest.json文件中的 gmail 对象是空的(见下文),因为我不希望在打开或撰写电子邮件时运行任何上下文触发器。在浏览我的收件箱中的电子邮件时,我是否缺少一些东西来防止上下文触发器重新运行?

{
  "addOns": {
    "common": {
      "homepageTrigger": {
        "runFunction": "builder"
      },
      "logoUrl": "https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/271/two-hearts_1f495.png",
      "name": "Apps",
      "layoutProperties": {
        "primaryColor": "rgb(87,46,140)",
        "secondaryColor": "rgb(255,193,7)"
      }
    },
    "gmail": {}
  },
  "timeZone": "America/New_York",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8"
}

标签: google-apps-scriptgmail-contextual-gadgets

解决方案


推荐阅读