插件类型
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页简要介绍了您可以构建的两种类型的插件:Google Workspace 插件和编辑器插件。这些插件类型的不同之处在于它们扩展的应用、创建方式以及所受的限制。
Google Workspace 插件
Google Workspace 加购项是最新一代的加购项,可提供许多功能,包括:
只需为多个 Google Workspace 应用构建一个插件:您只需构建并管理一个可在整个 Google Workspace 中使用的 Google Workspace 插件,而无需为每个 Google Workspace 应用分别创建插件。
Google Workspace 加载项可以扩展以下宿主应用:
- Gmail
- Google 日历
- Google Chat(开发者预览版)
- Google 文档
- Google 云端硬盘
- Google Meet
- Google 表格
- Google 幻灯片
提高品牌认知度:默认情况下,插件图标会显示在插件宿主应用的右侧面板中。
打造首页体验:您可以为插件扩展的每个 Google Workspace 应用创建单独的首页,也可以为多个应用使用同一首页。
在插件中反映用户的情境:您可以设计 Google Workspace 加载项,使其显示特定于加载项宿主应用的界面。例如,加载项可以显示电子邮件或日历活动中的信息,或者根据当前的 Google Workspace 应用页面建议操作。
使用标准化界面:使用 Apps 脚本 Card
服务提供的内置 widget 元素构建界面。您无需具备任何 HTML 或 CSS 方面的专业知识即可定义这些界面。
扩展桌面版和移动版 Gmail 客户端:如果 Google Workspace 加载项扩展了 Gmail,您可以在桌面版和移动版 Gmail 中使用该加载项。如果您构建的 Google Workspace 插件可扩展 Gmail,则无需为该插件设计单独的移动版。在任何地方都使用相同的接口。
使用首选运行时。您可以使用自己偏好的托管基础架构、开发工具链、源代码控制系统、编码语言和代码库来开发 Google Workspace 加载项。
编辑器插件
编辑器插件可扩展 Google 编辑器应用(例如 Google 文档、表格、幻灯片或表单)的功能。每种编辑器插件类型(例如 Google 表格插件)都可以有自己的一组特定于类型的功能、限制和特殊注意事项。在构建编辑器插件时,请务必了解这些编辑器特有的详细信息。如需详细了解特定编辑器的插件,请参阅相应部分:
编辑器插件可以自动执行常见的编辑器任务,例如创建、修改、格式化文件以及在应用之间移动数据。编辑器插件界面可高度自定义,以满足当前任务的需求。
编辑器插件非常适合在 Google 文档、表格、幻灯片或表单中自动执行任务,供个人或内部使用。对于需要大规模功能、需要处理大量用户、需要低延迟或需要完全控制基础架构的插件,请考虑在其他运行时环境中构建 Google Workspace 插件,以便更好地控制基础架构、部署和发布流程。
编辑器插件与 Google Workspace 插件在以下方面有所不同:
- 编辑器插件可以创建包含菜单项、对话框和边栏的界面。插件对话框和边栏使用标准 HTML 和 CSS 进行定义。
- 编辑器插件具有特殊的授权规则,因为它们会创建、修改 Google 云端硬盘中的文件或以其他方式与这些文件互动。在开发编辑器插件时,请务必了解编辑器插件授权。
- 在每个编辑器中创建和更新的文件都有特定的结构。例如,Google 幻灯片演示文稿由页面组成,这些页面可以是幻灯片、母版或布局。您应该了解这些文件结构,因为在读取或修改文件时,插件通常会与这些文件结构进行交互。
- 编辑器插件仅在桌面客户端中运行,无法在 Android 或 iOS 中运行。
- 编辑器插件必须在 Apps 脚本中实现。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-26。
[null,null,["最后更新时间 (UTC):2025-08-26。"],[[["\u003cp\u003eGoogle Workspace add-ons offer a unified solution, extending functionalities across multiple Google Workspace applications like Gmail, Calendar, and Docs with a single add-on.\u003c/p\u003e\n"],["\u003cp\u003eEditor add-ons focus on enhancing specific Google Editors (Docs, Sheets, Slides, Forms) with custom interfaces and automation capabilities but are limited to desktop use.\u003c/p\u003e\n"],["\u003cp\u003eWhile Workspace add-ons utilize standardized interfaces and work seamlessly across platforms, Editor add-ons require HTML/CSS knowledge and adhere to specific authorization rules.\u003c/p\u003e\n"],["\u003cp\u003eBoth add-on types provide distinct advantages; Workspace add-ons enhance cross-application workflows, while Editor add-ons offer deep, editor-specific customization and task automation.\u003c/p\u003e\n"]]],["There are two add-on types: Google Workspace and Editor add-ons. Google Workspace add-ons offer a single build for multiple apps (Gmail, Calendar, Chat, Docs, Drive, Sheets, Slides), and they feature standardized interfaces, mobile and desktop compatibility, and customizable homepages. Editor add-ons extend Docs, Sheets, Slides, and Forms, allowing for highly customizable interfaces using HTML and CSS, but require specific authorization and only function on desktop. They are built to automate common editor tasks.\n"],null,["This page provides a general overview of the two types of add-ons\nyou can build:\n*Google Workspace add-ons* and *Editor add-ons*. These\nadd-on types differ in what applications they extend,\nhow they are created, and what restrictions they have.\n\nGoogle Workspace add-ons\n\n*Google Workspace add-ons* are the latest generation of add-ons, and\nprovide many capabilities, including:\n\n- **Build just one add-on for multiple\n Google Workspace apps**: Instead of creating separate\n add-ons for\n each Google Workspace application, you can build and manage a single\n Google Workspace add-on that works across Google Workspace.\n A Google Workspace add-on can extend the following host applications:\n\n - Gmail\n - Google Calendar\n - Google Chat (Developer Preview)\n - Google Docs\n - Google Drive\n - Google Meet\n - Google Sheets\n - Google Slides\n- **Increase your brand awareness**: Add-ons icons are by\n default visible in the right-side panel of the\n add-on's host apps.\n\n- **Build homepage experiences** : You can create individual [homepages](/workspace/add-ons/concepts/homepages)\n for each Google Workspace app your add-on\n extends, or use the same homepage for multiple apps.\n\n- **Reflect the user's context in your add-on**: You\n can design your Google Workspace add-on to show interfaces specific to the\n add-on's host app. For example, your\n add-on can display info from an email or calendar\n event, or suggest an action based on the current Google Workspace app\n page.\n\n- **Use standardized interfaces** : Construct user interfaces from built-in\n widget elements provided by the Apps Script\n [`Card`](/apps-script/reference/card-service/card) service. You don't need\n any expertise with HTML or CSS to define these interfaces.\n\n- **Extend desktop and mobile clients for Gmail**: If a\n Google Workspace add-on extends Gmail, you can use it in both the\n desktop and mobile versions of Gmail. If you build a\n Google Workspace add-on that extends Gmail, you don't need to\n design a separate mobile version of the add-on. The\n same interface is used everywhere.\n\n- **Use your preferred runtime.** You can develop Google Workspace add-ons with your\n preferred hosting infrastructure, development tool chain, source control\n system, coding language, and code libraries.\n\nEditor add-ons\n\n*Editor add-ons* extend one of the Google Editor applications,\nsuch as Docs, Sheets, Slides, or\nForms. Each Editor add-on type (for\nexample, Sheets add-ons) can have its own set of\ntype-specific capabilities, restrictions, and special considerations. When\nbuilding Editor add-ons, it's important to understand these\nEditor-specific details. For more details on add-ons for specific\nEditors, see the corresponding sections:\n\n- [Google Docs](/workspace/add-ons/editors/docs)\n- [Google Forms](/workspace/add-ons/editors/forms)\n- [Google Sheets](/workspace/add-ons/editors/sheets)\n- [Google Slides](/workspace/add-ons/editors/slides)\n\nEditor add-ons can automate common editor tasks such as file\ncreation, editing, formatting, and moving data between applications.\nEditor add-on interfaces are highly-customizable for\nthe tasks at hand.\n\nEditor add-ons are ideal for automating tasks within Google\nDocs, Sheets, Slides, or\nForms for individual or internal use. For add-ons\nrequiring large-scale capabilities that need to handle many users, require low\nlatency, or demands full control over your infrastructure, consider building a\nGoogle Workspace add-ons on a [different runtime](/workspace/add-ons/guides/alternate-runtimes)\nenvironment for better control over infrastructure, deployment and release\nprocesses.\n\nEditor add-ons behave differently from Google Workspace add-ons in the\nfollowing ways:\n\n- Editor add-ons can create interfaces consisting of menu items, dialogs, and sidebars. Add-ons dialogs and sidebars are defined using standard [HTML and\n CSS](/workspace/add-ons/concepts/html-interfaces).\n- Editor add-ons have special authorization rules because they create, modify, or otherwise interact with files within Google Drive. It is important to understand the [Editor add-on\n authorization](/workspace/add-ons/concepts/editor-auth-lifecycle) while developing an Editor add-on.\n- Files created and updated in each editor have specific structures. For example, Google Slides presentations are composed of pages which can be slides, masters, or layouts. You should understand these file structures, as add-ons often interact with them when reading or editing files.\n- Editor add-ons only function in desktop clients, not Android or iOS.\n- Editor add-ons must be implemented in Apps Script."]]