为什么 addOns.common.universalActions 不需要 URL 在 urlFetchWhitelist 列表中就可以在 Google Workspace 附加组件清单中工作
Why doesn't addOns.common.universalActions not need the URL to be in the urlFetchWhitelist list for it to work in a Google Workspace Add-on manifest
Google 的文档说所有 URL 必须在 urlFetchWhitelist
.
中明确列出
但是,我在 universalActions
中有一个 URL,它可以工作,即使我在 urlFetchWhitelist
中没有 URL。我误会了什么?
{
"timeZone": "America/New_York",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"oauthScopes": [],
"addOns": {
"common": {
"universalActions": [
{
"label": "About",
"openLink": "https://github.com/imthenachoman/Gmail-Auto-Vacation-Responder"
}
]
},
"gmail": {},
"calendar": {}
}
}
如 documentation 中所述:
Universal actions are menu item elements that allow a user to open a new web page, display new UI cards, or run a specific Apps Script function when selected. In operation they are very similar to card actions, except that universal actions are always placed on every card in your add-on, regardless of the current add-on context.
通用操作的范围已经在 appscript.json
中定义,因此将它再次包含在 urlFetchWhiteList
中没有意义。正如您在文档中看到的那样:
Universal actions are configured in your add-on's project manifest. Once you've configured a universal action, it is always available to users of your add-on.
简而言之,通用操作适用于不依赖于当前执行上下文的操作,并且可从附加组件中的任何位置使用。对于任何其他类型的请求,例如,与外部 API 交互,该 API 的 url 应包含在 urlFetchWhiteList
.
中
Google 的文档说所有 URL 必须在 urlFetchWhitelist
.
但是,我在 universalActions
中有一个 URL,它可以工作,即使我在 urlFetchWhitelist
中没有 URL。我误会了什么?
{
"timeZone": "America/New_York",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"oauthScopes": [],
"addOns": {
"common": {
"universalActions": [
{
"label": "About",
"openLink": "https://github.com/imthenachoman/Gmail-Auto-Vacation-Responder"
}
]
},
"gmail": {},
"calendar": {}
}
}
如 documentation 中所述:
Universal actions are menu item elements that allow a user to open a new web page, display new UI cards, or run a specific Apps Script function when selected. In operation they are very similar to card actions, except that universal actions are always placed on every card in your add-on, regardless of the current add-on context.
通用操作的范围已经在 appscript.json
中定义,因此将它再次包含在 urlFetchWhiteList
中没有意义。正如您在文档中看到的那样:
Universal actions are configured in your add-on's project manifest. Once you've configured a universal action, it is always available to users of your add-on.
简而言之,通用操作适用于不依赖于当前执行上下文的操作,并且可从附加组件中的任何位置使用。对于任何其他类型的请求,例如,与外部 API 交互,该 API 的 url 应包含在 urlFetchWhiteList
.