diff --git a/frontend/src/routes/bots/TelegramBotTab.svelte b/frontend/src/routes/bots/TelegramBotTab.svelte index f0594ca..11b458b 100644 --- a/frontend/src/routes/bots/TelegramBotTab.svelte +++ b/frontend/src/routes/bots/TelegramBotTab.svelte @@ -171,7 +171,19 @@ function copyChatId(e: Event, chatId: string) { e.stopPropagation(); - navigator.clipboard.writeText(chatId); + if (navigator.clipboard?.writeText) { + navigator.clipboard.writeText(chatId); + } else { + // Fallback for non-HTTPS contexts + const ta = document.createElement('textarea'); + ta.value = chatId; + ta.style.position = 'fixed'; + ta.style.opacity = '0'; + document.body.appendChild(ta); + ta.select(); + document.execCommand('copy'); + document.body.removeChild(ta); + } snackInfo(`${t('snack.copied')}: ${chatId}`); }