From 8eda6720ff3b27bc748b9329fc0a5442310aa291 Mon Sep 17 00:00:00 2001 From: Goldy <153996346+g0ldyy@users.noreply.github.com> Date: Sun, 7 Jul 2024 23:40:03 +0200 Subject: [PATCH] fix: webui copy button for non secured environments --- comet/templates/index.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/comet/templates/index.html b/comet/templates/index.html index a9611e8..c2d95cd 100644 --- a/comet/templates/index.html +++ b/comet/templates/index.html @@ -640,9 +640,16 @@ copyLinkButton.addEventListener("click", () => { const settings = getSettings(); - navigator.clipboard.writeText(`${window.location.origin}/${btoa(JSON.stringify(settings))}/manifest.json`).then(() => { - copyAlert.toast(); - }); + + const textArea = document.createElement("textarea"); + textArea.value = `${window.location.origin}/${btoa(JSON.stringify(settings))}/manifest.json`; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + document.execCommand("copy"); + document.body.removeChild(textArea); + + copyAlert.toast(); }); installButton.addEventListener("click", () => {