eBay: show the item ID
Displays the numeric item ID as a corner badge that can be copied with a single click.
Code to copy
// Show the numeric item ID as a copyable badge on item pages
function showItemId() {
if (document.getElementById('jz-eby-itemid')) { return; }
const m = window.location.pathname.match(/\/itm\/(?:.*\/)?(\d{6,})/);
if (!m) { return; }
const badge = document.createElement('div');
badge.id = 'jz-eby-itemid';
badge.textContent = 'Item ID: ' + m[1];
badge.title = 'Click to copy';
badge.style.cssText = 'position:fixed;bottom:12px;left:12px;z-index:99999;'
+ 'background:#111;color:#fff;padding:6px 10px;border-radius:6px;'
+ 'font:600 12px sans-serif;cursor:pointer';
badge.addEventListener('click', function () {
if (navigator.clipboard) { navigator.clipboard.writeText(m[1]); }
badge.textContent = 'Copied ' + m[1];
});
document.body.appendChild(badge);
}
showItemId();
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.