如何配置Google表格编辑器插件的appscript.json?解决分类误判
解决Google表格编辑器插件被误判为Workspace插件的问题
核心配置修正:appscript.json 关键字段
你的当前配置缺少编辑器插件专属的addOns配置段,这是导致审核误判的核心原因。Google通过这个字段区分编辑器插件和Workspace插件,编辑器插件需要明确指定与表格编辑器集成的触发方式。
以下是适配Google表格编辑器插件的完整appscript.json配置示例:
{ "timeZone": "America/Los_Angeles", "dependencies": {}, "exceptionLogging": "STACKDRIVER", "runtimeVersion": "V8", "oauthScopes": [ "https://www.googleapis.com/auth/spreadsheets.currentonly", "https://www.googleapis.com/auth/script.external_request", "https://www.googleapis.com/auth/script.container.ui" ], "urlFetchWhitelist": [ "https://example.com" ], "addOns": { "sheets": { "homepageTrigger": { "runFunction": "showAddonUi", "enabled": true }, "onFileScopeGrantedTrigger": { "runFunction": "onFileScopeGranted" } } } }
关键配置说明
addOns.sheets:明确声明这是Google表格的编辑器插件,而非跨Workspace应用的插件homepageTrigger:指定插件在表格编辑器侧边栏的入口触发函数(需对应你代码中打开UI的函数,比如showAddonUi)onFileScopeGrantedTrigger:可选,用于处理用户授权插件访问当前表格后的逻辑
其他可能的误判因素
- 代码中使用了Workspace插件专属API:比如调用了
AdminDirectory这类仅Workspace插件可用的服务,需检查代码并移除或替换 - 提交时的分类选择错误:在应用市场提交流程中,确认选择了「编辑器插件」分类,而非「Workspace插件」
- 测试部署类型错误:确保部署时选择的是「编辑器插件」部署类型,而非「Workspace插件」
内容的提问来源于stack exchange,提问作者Allen N
相关产品推荐
相关产品推荐

