From 443244809ef0df4d7bfcb83e1ee15fc5c9990ab2 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 28 Feb 2026 14:25:23 -0800 Subject: [PATCH] fix: make block number click-to-copy with etherscan link Block number on success-tx view now has click-to-copy and an external link to etherscan.io/block/{number}, consistent with how addresses and transaction hashes are displayed. 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