diff --git a/src/popup/index.html b/src/popup/index.html index 58d16ff..e9646ba 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -346,8 +346,20 @@ > < Back -

Export Private Key

-

+
+

Export Private Key

+

+

+ + +

Warning: anyone with this private key can access and transfer all funds from this address. Never share it. diff --git a/src/popup/views/addressDetail.js b/src/popup/views/addressDetail.js index 77b6d27..3c65e24 100644 --- a/src/popup/views/addressDetail.js +++ b/src/popup/views/addressDetail.js @@ -290,9 +290,20 @@ function init(_ctx) { moreBtn.classList.remove("bg-fg", "text-bg"); const wallet = state.wallets[state.selectedWallet]; const addr = wallet.addresses[state.selectedAddress]; - const title = addressTitle(addr.address, state.wallets); - const label = title || "Address " + (state.selectedAddress + 1); - $("export-privkey-label").textContent = "Exporting key for: " + label; + const blockieEl = $("export-privkey-jazzicon"); + blockieEl.innerHTML = ""; + const bImg = document.createElement("img"); + bImg.src = makeBlockie(addr.address); + bImg.width = 48; + bImg.height = 48; + bImg.style.imageRendering = "pixelated"; + bImg.style.borderRadius = "50%"; + blockieEl.appendChild(bImg); + $("export-privkey-title").textContent = + wallet.name + " \u2014 Address " + (state.selectedAddress + 1); + $("export-privkey-dot").innerHTML = addressDotHtml(addr.address); + $("export-privkey-address").textContent = addr.address; + $("export-privkey-address").dataset.full = addr.address; $("export-privkey-password").value = ""; $("export-privkey-flash").classList.add("hidden"); $("export-privkey-flash").textContent = ""; @@ -339,6 +350,14 @@ function init(_ctx) { } }); + $("export-privkey-address").addEventListener("click", () => { + const full = $("export-privkey-address").dataset.full; + if (full) { + navigator.clipboard.writeText(full); + showFlash("Copied!"); + } + }); + $("btn-export-privkey-back").addEventListener("click", () => { $("export-privkey-value").textContent = ""; $("export-privkey-password").value = "";