From 8369109ea0d3e3503ca9cc308d98537c90a50ca7 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:13:09 -0700 Subject: [PATCH] Fix crypto copy buttons and correct ETH address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ETH address was wrong in the support modal. Also fixed clipboard copy failing on HTTP (Docker) — navigator.clipboard requires HTTPS. Added textarea fallback for insecure contexts, and shows the address in a toast as last resort if both methods fail. --- webui/index.html | 2 +- webui/static/script.js | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/webui/index.html b/webui/index.html index 23703a9e..ad3a9179 100644 --- a/webui/index.html +++ b/webui/index.html @@ -5881,7 +5881,7 @@ Bitcoin - diff --git a/webui/static/script.js b/webui/static/script.js index 9b988c05..df1e4eb1 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -5242,12 +5242,24 @@ function closeSupportModal() { async function copyAddress(address, cryptoName) { try { - await navigator.clipboard.writeText(address); + // navigator.clipboard requires HTTPS — use fallback for HTTP (Docker) + if (navigator.clipboard && window.isSecureContext) { + await navigator.clipboard.writeText(address); + } else { + const textarea = document.createElement('textarea'); + textarea.value = address; + textarea.style.position = 'fixed'; + textarea.style.opacity = '0'; + document.body.appendChild(textarea); + textarea.select(); + document.execCommand('copy'); + document.body.removeChild(textarea); + } showToast(`${cryptoName} address copied to clipboard`, 'success'); - console.log(`Copied ${cryptoName} address: ${address}`); } catch (error) { console.error('Failed to copy address:', error); - showToast(`Failed to copy ${cryptoName} address`, 'error'); + // Show the address so user can copy manually + showToast(`${cryptoName}: ${address}`, 'info'); } }