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 - + Ethereum 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'); } }