HomepageTrigger 清单资源
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
用于定义 Google Workspace 插件
首页触发器的资源配置。
HomepageTrigger
适用于首页触发器的 Google Workspace 插件清单配置。
可以在 addOns.common.homepageTrigger
资源或各个宿主应用的资源中定义首页触发器。如果宿主应用的首页触发器已定义并启用,则该触发器会替换 addOns.common.homepageTrigger
中定义的首页触发器。
如需了解详情,请参阅首页配置。
JSON 表示法 |
{
"enabled": boolean,
"runFunction": string
} |
字段 |
enabled |
boolean
是否为此宿主应用启用了首页(非情境)卡片。默认值为 true 。
|
runFunction |
string
触发器触发时要运行的函数的名称。如果指定了此函数,您必须实现此函数,以构建并返回一个或多个 Card 对象数组,以便在相应宿主应用中将此插件的首页显示为这些对象。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eHomepage triggers define the configuration for Google Workspace Add-on homepages, letting you control card display and functionality.\u003c/p\u003e\n"],["\u003cp\u003eThese triggers can be set globally or for specific host applications, with host-specific settings taking precedence.\u003c/p\u003e\n"],["\u003cp\u003eHomepage triggers are configured using the \u003ccode\u003eenabled\u003c/code\u003e and \u003ccode\u003erunFunction\u003c/code\u003e fields within the add-on's manifest file.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erunFunction\u003c/code\u003e field points to a function that constructs and returns \u003ccode\u003eCard\u003c/code\u003e objects to populate the add-on's homepage.\u003c/p\u003e\n"]]],[],null,["# HomepageTrigger manifest resource\n\nThe resource configuration that is used to define\n[Google Workspace add-on](/workspace/add-ons/concepts/types#g_suite_add-ons)\n[homepage triggers](/workspace/add-ons/concepts/homepages#homepage_configuration).\n\nHomepageTrigger\n---------------\n\nThe Google Workspace add-on manifest configuration for\n[homepage triggers](/workspace/add-ons/concepts/homepages#homepage_configuration).\n\nHomepage triggers can be defined in the\n[`addOns.common.homepageTrigger`](/apps-script/manifest/addons#Common.FIELDS.homepageTrigger)\nresource or the resources of the individual\n[host applications](/workspace/add-ons/guides/glossary#host_or_host_application).\nThe homepage trigger of a host application, if defined and enabled, overrides\nthe homepage trigger defined in\n[`addOns.common.homepageTrigger`](/apps-script/manifest/addons#Common.FIELDS.homepageTrigger).\n\nSee [Homepage configuration](/workspace/add-ons/concepts/homepages#homepage_configuration)\nfor more details.\n\n| JSON representation |\n|-----------------------------------------------------------|\n| ```text { \"enabled\": boolean, \"runFunction\": string } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `enabled` | `boolean` Whether or not homepage (non-contextual) cards are enabled for this host application. Defaults to `true`. |\n| `runFunction` | `string` The name of the function to run this trigger fires. If specified, you must implement this function to build and return an array of one or more [`Card`](/apps-script/reference/card-service/card) objects for display as this add-on's homepage in this host application. |"]]