From 504b0dbf5b702532e545b8f710b7cfbb657d3200 Mon Sep 17 00:00:00 2001 From: foxfire52 Date: Sat, 26 Oct 2024 12:39:40 +0200 Subject: Clean up highlightjs-copy.min.js --- g4f/gui/client/static/js/highlightjs-copy.min.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'g4f/gui/client') 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; -- cgit v1.2.3