From 5565e76796f12d32ca5197413b00c4dbac580c7d Mon Sep 17 00:00:00 2001 From: user Date: Sat, 28 Feb 2026 14:09:23 -0800 Subject: [PATCH] feat: add etherscan link and click-to-copy on block number in success-tx view Block numbers are blockchain entities like addresses and tx hashes. They now receive the same treatment: click-to-copy and an external link icon pointing to etherscan.io/block/{number}. Closes #99 --- src/popup/views/txStatus.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/popup/views/txStatus.js b/src/popup/views/txStatus.js index e8dee6e..66edb5d 100644 --- a/src/popup/views/txStatus.js +++ b/src/popup/views/txStatus.js @@ -59,6 +59,16 @@ function txHashHtml(hash) { ); } +function blockNumberHtml(blockNumber) { + const num = String(blockNumber); + const link = `https://etherscan.io/block/${num}`; + const extLink = `${EXT_ICON}`; + return ( + `${escapeHtml(num)}` + + extLink + ); +} + function attachCopyHandlers(viewId) { document .getElementById(viewId) @@ -189,7 +199,7 @@ function renderSuccess() { $("success-tx-to").innerHTML = toAddressHtml(d.to); } - $("success-tx-block").textContent = String(d.blockNumber); + $("success-tx-block").innerHTML = blockNumberHtml(d.blockNumber); $("success-tx-hash").innerHTML = txHashHtml(d.hash); // Show decoded calldata details if present