How to have a Google Workspace Add-on homepageTrigger multiple times?
@PierrickVoulet がすでに取り組んでいます。
2023年12月13日 から。
評価
この issue はまだ評価されていません。
説明
We have a Google Workspace add-on that operates via a sidebar, so we use homepageTrigger so that the user can open the sidebar from the right hand menu.
This works well - but only once per page load - so if the user opens the sidebar, closes it and attempts to reopen via the right hand menu we instead get this page:
How instead can we have the homepageTrigger function run every time?
Here is the appsscript.json:
{
"timeZone": "Australia/Sydney",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"enabledAdvancedServices": [
{
"userSymbol": "Drive",
"serviceId": "drive",
"version": "v2"
}
]
},
"oauthScopes": [
"https://www.googleapis.com/auth/script.scriptapp",
"https://www.googleapis.com/auth/documents.currentonly",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/presentations",
"https://www.googleapis.com/auth/script.container.ui",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.apps.readonly",
"https://www.googleapis.com/auth/script.external_request",
"https://www.googleapis.com/auth/script.locale",
"https://www.googleapis.com/auth/userinfo.email"
],
"urlFetchWhitelist": [
"https://cm234-wgs-1.icognition.cloud/",
"https://docs.google.com/feeds/download/documents/export/Export",
"https://docs.google.com/spreadsheets/export",
"https://docs.google.com/feeds/download/presentations/Export"
],
"addOns": {
"common": {
"name": "Content Manager",
"logoUrl": "https://cm234-wgs-1.icognition.cloud/CMServiceApiGoogle/TrimIcon/W64h64/trim.png",
"homepageTrigger": {
"runFunction": "showSidebar",
"enabled": true
}
},
"sheets": {},
"docs": {},
"slides": {}
}
}
Here is the function it is calling (when I add a log line at the start of this function it is only ever called once):
function showSidebar() {
var sidebarName = "sidebar";
if (getRecordUri() !== 0) {
sidebarName = "existing_record_sidebar";
}
var ui =
HtmlService.createHtmlOutputFromFile(sidebarName).setTitle(
"Content Manager",
);
getUi().showSidebar(ui);
}
- 主要言語
- JavaScript
- スター
- 5.2k
- フォーク
- 2k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleworkspace/apps-script-samples のほかの issue
-
Alvin Litana Mirasol オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#659 · コメント 1 件 · リアクション 1 件 ·
-
Password reset オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
googleworkspace/apps-script-samples#654 · リアクション 2 件 ·
-
cod gs オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
googleworkspace/apps-script-samples#651 · リアクション 1 件 ·
-
tespogrome オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#624 · リアクション 1 件 ·
-
googleworkspace/apps-script-samples#616 · 担当者 1 名 ·
googleworkspace/apps-script-samples の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
antfu-collective/icones#398 ·
-
ECmail.com オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
wesbos/burner-email-providers#554 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
components-web-app/docs#92 ·