Fixed names

This commit is contained in:
stab.ing
2026-05-18 03:01:01 -05:00
parent ace5d4546f
commit 71221d8f06
2 changed files with 0 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
// ==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 += ` <span style="font-size:.85em;color:#666;">(or $${(price + shipping).toFixed(2)} total)</span>`;
}
card.dataset.priced = 1;
});
}
update();
new MutationObserver(update).observe(document.body, {
childList: true,
subtree: true
});
})();