// ==UserScript== // @name ebay pricer // @namespace ebay-pricer // @version 1.0 // @description Adds shipping costs into the displayed ebay listing price. // @author Stabosa87 // @match https://www.ebay.com/* // @grant none // ==/UserScript== (function () { function money(text) { let m = text.match(/\$([\d.]+)/); return m ? parseFloat(m[1]) : 0; } function update() { document.querySelectorAll("li.s-card").forEach(card => { if (card.dataset.priced) return; let pricel = card.querySelector(".s-card__price"); if (!pricel) return; let price = money(pricel.textContent); let shipping = 0; card.querySelectorAll(".s-card__attribute-row").forEach(row => { if (row.textContent.includes("delivery") && row.textContent.includes("+$")) { shipping = money(row.textContent); } }); if (shipping > 0) { pricel.innerHTML += ` (or $${(price + shipping).toFixed(2)} total)`; } card.dataset.priced = 1; }); } update(); new MutationObserver(update).observe(document.body, { childList: true, subtree: true }); })();