diff options
Diffstat (limited to 'g4f/gui/client')
-rw-r--r-- | g4f/gui/client/static/js/highlightjs-copy.min.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/g4f/gui/client/static/js/highlightjs-copy.min.js b/g4f/gui/client/static/js/highlightjs-copy.min.js index 20b7d52b..0c3c1cee 100644 --- a/g4f/gui/client/static/js/highlightjs-copy.min.js +++ b/g4f/gui/client/static/js/highlightjs-copy.min.js @@ -26,13 +26,11 @@ class CopyButtonPlugin { } try { - console.warn("newText type: ", typeof newText); - console.warn("Current Text: " + newText); await navigator.clipboard.writeText(newText); } catch (e) { - console.error("Clipboard API writeText failed!!") console.error(e); - fallback_copy(newText); + console.error("Clipboard API writeText() failed! Fallback to document.exec(\"copy\")..."); + fallback_clipboard(newText); } button.innerHTML = "Copied!"; button.dataset.copied = true; |