gpt4 book ai didi

google-apps-script - 具有有限身份验证的附加组件无法打开侧边栏

转载 作者:行者123 更新时间:2023-12-02 13:00:53 25 4
gpt4 key购买 nike

我有一个 Google 文档插件,它被编程为在文档打开时立即打开侧边栏。当然,这需要在文档中安装并启用该附加组件。

我发现,一周以来,在我们的用例中非常有用的侧边栏自动打开功能不再起作用。

在 StackDriver 日志中我看到此报告:

onOpen():  {authMode=LIMITED, source=Document, user=} 
publi-2.0.72-2017-11-27-18-57 [this is the publication version tag]
2017-11-27T18:02:50.126Z : show menu
2017-11-27T18:02:50.180Z : show sidebar
Error showing sidebar Exception: You do not have permission to call showSidebar
2017-11-27T18:02:50.283Z : end onOpen

很明显,根据 addon authorization lifecyle,该附加组件处于 LIMITED 模式,并且 showSidebar() 应该成功。 (只需查看表中的 LIMITED 列即可)。

--> 我怀疑最近引入了错误或新的安全限制。

这里有一个代码片段作为记录:

/**
* Basic setup. At the beginning:
* 1. Add a "Add-ons" menu item.
* 2. Display the doxMaster sidebar.
*/
function onOpen(e) {
console.log("onOpen(): ",e)
console.log(addonversion);
doServerLog("show menu");
showMenu();
doServerLog("show sidebar");
showSidebar();
doServerLog("end onOpen");
}

/**
* Creates the Add-ons menu at the google drive panel.
*/
function showMenu() {
DocumentApp.getUi().createAddonMenu()
.addItem(translate("sidebarMenu"), showSidebar.name)
.addItem(translate("joinFollowingParagraph"), insertJoinFollowingParaSymbol.name)
.addItem(translate("importDocument"), importDocument.name)
.addItem(translate("about"), about.name)
.addToUi();

}

/**
* Creates a doxMaster Add-on Sidebar.
*/
function showSidebar() {
try {
var htmlTemplate = HtmlService.createTemplateFromFile('sidebar');
var html = htmlTemplate.evaluate().setTitle(translate("appTitle"));
DocumentApp.getUi().showSidebar(html);
}
catch (e) {
console.log("Error showing sidebar ", e); // Add-on has not been enabled in this document
}
}

最佳答案

昨天,我们注意到了与您 Yves 完全相同的问题。然而对于我们来说,它出现在 Google Sheets 插件中。

我在 Google 上创建了一个问题:https://issuetracker.google.com/issues/69824548

请加注星标并发表评论,以便尽快被采纳!

关于google-apps-script - 具有有限身份验证的附加组件无法打开侧边栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47517334/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com