diff --git a/src/popup/index.html b/src/popup/index.html
index 74dfb69..2118551 100644
--- a/src/popup/index.html
+++ b/src/popup/index.html
@@ -999,18 +999,18 @@
class="text-xs"
>
-
`;
detailsHtml += `
${escapeHtml(d.label)}
`;
- if (d.address) {
+ if (d.address && d.isToken) {
+ // Token entry: show symbol on its own line, then dot + address + Etherscan link
const dot = addressDotHtml(d.address);
- detailsHtml += `
${dot}${copyableHtml(d.value, "break-all")}
`;
+ const tokenSymbol = d.value.match(/^(\S+)\s*\(/)?.[1];
+ if (tokenSymbol) {
+ detailsHtml += `
${escapeHtml(tokenSymbol)}
`;
+ }
+ const etherscanUrl = `https://etherscan.io/token/${d.address}`;
+ detailsHtml += `
${dot}${copyableHtml(d.address, "break-all")}${etherscanLinkHtml(etherscanUrl)}
`;
+ } else if (d.address) {
+ // Protocol/contract entry: show name + Etherscan link
+ const dot = addressDotHtml(d.address);
+ const etherscanUrl = `https://etherscan.io/address/${d.address}`;
+ detailsHtml += `
${dot}${copyableHtml(d.value, "break-all")}${etherscanLinkHtml(etherscanUrl)}
`;
} else {
detailsHtml += `
${escapeHtml(d.value)}
`;
}
@@ -228,13 +241,16 @@ async function loadCalldata(txHash, toAddress) {
section.classList.remove("hidden");
- // Bind copy handlers for new elements
- section.querySelectorAll("[data-copy]").forEach((el) => {
- el.onclick = () => {
- navigator.clipboard.writeText(el.dataset.copy);
- showFlash("Copied!");
- };
- });
+ // Bind copy handlers for new elements (including raw data now outside section)
+ const copyTargets = [section, rawSection].filter(Boolean);
+ for (const container of copyTargets) {
+ container.querySelectorAll("[data-copy]").forEach((el) => {
+ el.onclick = () => {
+ navigator.clipboard.writeText(el.dataset.copy);
+ showFlash("Copied!");
+ };
+ });
+ }
} catch (e) {
log.errorf("loadCalldata failed:", e.message);
}