diff options
author | foxfire52 <foxfire52@virgilio.it> | 2024-10-26 13:28:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-26 13:28:08 +0200 |
commit | 8d010d892777ab7e191ade861ef1f357a54b3fe4 (patch) | |
tree | 2df1e386e34a24a89f8533739b812b41f82d9ef2 | |
parent | Update highlightjs-copy.min.js (diff) | |
download | gpt4free-8d010d892777ab7e191ade861ef1f357a54b3fe4.tar gpt4free-8d010d892777ab7e191ade861ef1f357a54b3fe4.tar.gz gpt4free-8d010d892777ab7e191ade861ef1f357a54b3fe4.tar.bz2 gpt4free-8d010d892777ab7e191ade861ef1f357a54b3fe4.tar.lz gpt4free-8d010d892777ab7e191ade861ef1f357a54b3fe4.tar.xz gpt4free-8d010d892777ab7e191ade861ef1f357a54b3fe4.tar.zst gpt4free-8d010d892777ab7e191ade861ef1f357a54b3fe4.zip |
-rw-r--r-- | g4f/gui/client/static/js/chat.v1.js | 5 |
1 files changed, 4 insertions, 1 deletions
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); |