From 8d010d892777ab7e191ade861ef1f357a54b3fe4 Mon Sep 17 00:00:00 2001 From: foxfire52 Date: Sat, 26 Oct 2024 13:28:08 +0200 Subject: Update chat.v1.js --- g4f/gui/client/static/js/chat.v1.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'g4f/gui/client') diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js index 9682de59..d5a1ffaa 100644 --- a/g4f/gui/client/static/js/chat.v1.js +++ b/g4f/gui/client/static/js/chat.v1.js @@ -115,7 +115,10 @@ const register_message_buttons = async () => { const message_el = el.parentElement.parentElement.parentElement; const copyText = await get_message(window.conversation_id, message_el.dataset.index); - try { + try { + if (!navigator.clipboard) { + throw new Error("navigator.clipboard: Clipboard API unavailable."); + } await navigator.clipboard.writeText(copyText); } catch (e) { console.error(e); -- cgit v1.2.3