summaryrefslogtreecommitdiffstats
path: root/g4f/gui
diff options
context:
space:
mode:
authorfoxfire52 <foxfire52@virgilio.it>2024-10-26 13:28:08 +0200
committerGitHub <noreply@github.com>2024-10-26 13:28:08 +0200
commit8d010d892777ab7e191ade861ef1f357a54b3fe4 (patch)
tree2df1e386e34a24a89f8533739b812b41f82d9ef2 /g4f/gui
parentUpdate highlightjs-copy.min.js (diff)
downloadgpt4free-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
Diffstat (limited to 'g4f/gui')
-rw-r--r--g4f/gui/client/static/js/chat.v1.js5
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);