Editor manifest resource

The resource configuration that is used to define Add-on content and behavior within the editors. Add-on manifests must have all the components marked as Required if they extend the Editor.

Editors

The Add-on manifest configuration for Editor extensions. See Extending Editors with Add-ons for more information.

JSON representation
{
  "homepageTrigger": {
    object (HomepageTrigger)
  },
  "onFileScopeGrantedTrigger": {
    object (OnFileScopeGrantedTrigger)
  },
    "linkPreviewTriggers": {
    object (LinkPreviewTriggers)
  }
}
Fields
homepageTrigger

object (HomepageTrigger)

This trigger function creates the add-on homepage in the host app. This overrides addOns.common.homepageTrigger.

onFileScopeGrantedTrigger

object (OnFileScopeGrantedTrigger)

Required if your add-on includes behavior specific to the current Editor document, triggered when the user authorizes the drive.file scope.

linkPreviewTriggers

object (LinkPreviewTriggers)

Required for link previews. Defines the URL patterns that preview content for a third-party or non-Google service. For details, see Preview links in Google Docs (Developer Preview).

OnFileScopeGrantedTrigger

A configuration for a contextual trigger that fires when the add-on presents the request file scope dialog using CardService.newEditorFileScopeActionResponseBuilder() .requestFileScopeForActiveDocument().build(); and the user grants drive.file scope authorization.

JSON representation
{
  "runFunction": string
}
Fields
runFunction

string

The name of the function to run if drive.file scope is granted. If specified, you must implement this function to build and return an array of Card objects for display in the add-on UI.

LinkPreviewTriggers

The configuration for a trigger that fires when a user types or pastes a link from a third-party or non-Google service into a Google Docs document.

To set up this trigger for a Google Workspace Add-on, see Preview links in Google Docs (Developer Preview).

JSON representation
{
  "labelText": string,
  "runFunction": string,
  "Icon": string,
  "patterns": [
    {
      object(patterns)
    }
  ]
}
Fields
labelText

string

Required. The text for an example smart chip that prompts users to preview the link, such as Example: Support case. This text is static and displays before users execute the add-on.
localizedLabelText

map

Optionally, a labelText that is localized into another language. Specify the language and country/region identifier in the format of ISO 639 language code-ISO 3166 country/region code. For example, en-US.
runFunction

string

The name of the function to run when the user authorizes the https://www.googleapis.com/auth/documents.readonly scope. If specified, you must implement this function to accept an event object containing docs.matchedUrl.url as an argument and return a single Card object that displays a link preview in the add-on UI.
icon

string

The icon that displays in the smart chip. If omitted, the chip uses your add-on’s toolbar icon, logoUrl.
patterns

object (Patterns)

Required. An array of URL patterns that trigger the add-on to preview links.

Patterns

The configuration for each URL pattern that triggers a link preview.

JSON representation
{
  "hostPattern": string,
  "pathPrefix" : string
}
Fields
hostPattern

string

Required for each URL pattern to preview.The domain of the URL pattern. The add-on previews links to this domain. To preview links for a specific subdomain, like subdomain.example.com, include the subdomain. To preview links for the entire domain, specify a wildcard character with an asterisk (*) as the subdomain.

For example, *.example.com matches subdomain.example.com and another.subdomain.example.com.

pathPrefix

string

Optionally, the path that appends the hostPattern‘s domain.

For example, if the URL host pattern is support.example.com, to match URLs for cases hosted at support.example.com/cases/, enter cases.

To match all URLs in the host pattern domain, leave pathPrefix empty.