I have a Google Docs add-on that is programmed to open the sidebar as soon as the document is open. Of course, this requires the add-in to be installed and included in the document.
I see that from a week the automatic opening of the sidebar, which is very useful in our use case, no longer works.
In StackDriver logs, I see this report:
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
Itβs clear that the add-in is in LIMITED mode, and showSidebar () should succeed according to the lifecyle authorization admin (just look at the LIMITED column in the table).
β I suspect that a bug or a new security restriction has recently been detected.
Here's a snippet of code for the record:
function onOpen(e) { console.log("onOpen(): ",e) console.log(addonversion); doServerLog("show menu"); showMenu(); doServerLog("show sidebar"); showSidebar(); doServerLog("end onOpen"); } 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(); } 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);
source share