// A button that opens as a link in an overlay and
// requires a reload when closed.
const button = CardService.newTextButton()
.setText('This button opens a link in an overlay window')
.setOpenLink(
CardService.newOpenLink()
.setUrl('https://www.google.com')
.setOpenAs(CardService.OpenAs.OVERLAY)
.setOnClose(CardService.OnClose.RELOAD_ADD_ON),
);
// An action response that opens a link in full screen and
// requires no action when closed.
const actionResponse = CardService.newActionResponseBuilder()
.setOpenLink(
CardService.newOpenLink()
.setUrl('https://www.google.com')
.setOpenAs(CardService.OpenAs.FULL_SIZE)
.setOnClose(CardService.OnClose.NOTHING),
)
.build();
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-12-02 (世界標準時間)。"],[[["`OpenLink` allows Google Workspace Add-ons and Google Chat apps to open specified URLs with customizable behaviors."],["Developers can set how the link opens (overlay or full-screen) and the action taken when it's closed (reload add-on or do nothing)."],["The `OpenLink` object provides methods like `setOnClose`, `setOpenAs`, and `setUrl` for configuration."],["When using `setOnClose` to reload add-ons, avoid links with Cross-Origin-Opener-Policy (COOP) enabled for proper functionality."]]],[]]