Greasy Fork

eBay Seller Blacklist

Adds a blacklist for sellers on eBay that will emphasize or remove results from blacklisted sellers

< 脚本 eBay Seller Blacklist 的反馈

评价:一般 - 脚本能用,但还有一些问题

§
发布于:2025-06-13

Hi, the script doesn't hide the sellers I blacklist.
* It's about ebay.com
* I am using Chrome Version 137.0.7151.104 (Official Build) (64-bit) in Windows
* The console errors are included in the screenshot below
* The userscript engine is Tampermonkey 5.3.3
* See the other screenshot to see my search result display setup

Not a frontend engineer, but this is what I have tried that sort of got it to work:
* I changed ebay.com to use the same logic as ebay.co.uk from line 99 to line 102
* In line 110, I changed "if (hideBlacklisted)" to "if (true)"

I like your script except for this bug. There is currently no alternative. Some feature requests:
* Make this blacklist button a floating window (the skelleton button that you click to expand the blocklist). This way, I can keep adding as I scroll.
* Make the blacklist separated by newlines instead of comma (,) for the ease of reading.
Good work! Looking forward to your updates. Thanks!

§
发布于:2025-06-19

I did some self-teaching, and this is what I ended up doing. It makes the blocklist a floating window and fixes its bug for the US site. Now the users are separated with newlines:

// ==UserScript==
// @name eBay Seller Blacklist
// @namespace https://www.ebay.co.uk/
// @version 0.4
// @description Adds a blacklist for sellers on eBay that will emphasize or remove results from blacklisted sellers
// @author xdpirate
// @license GPLv3
// @include /^https:\/\/www\.ebay\.(co\.uk|com|com\.au|de)\/(itm|sch|usr)\/.*/
// @icon https://www.google.com/s2/favicons?sz=64&domain=ebay.co.uk
// @run-at document-end
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
// @downloadURL https://update.greasyfork.org/scripts/441347/eBay%20Seller%20Blacklist.user.js
// @updateURL https://update.greasyfork.org/scripts/441347/eBay%20Seller%20Blacklist.meta.js
// ==/UserScript==

GM_addStyle(`
#eBSBToggleButton {
cursor: pointer;
}

#eBSBBlacklistArea {
background-color: black;
color: white;
font-family: monospace;
}

#eBSBOuterDiv {
float: left;
background-color: black;
color: white;
padding: 5px;
border: 1px solid white;
border-radius: 10px;
z-index: 2147483647;
display: block;
position: absolute;
top: 5px;
left: 5px;
}

.hidden {
display: none;
}
`);

let blacklist_serialized = GM_getValue("blacklist_serialized", "start_a_new_list") // retrieve key "blacklist" from cache, if not default to an empty string
let blacklist = new Set(blacklist_serialized.split("\n"));
// console.log(`${[...blacklist]}`)
let hideBlacklisted = GM_getValue("hideBlacklisted", true);

let newBox = document.createElement("div");
newBox.style.position = "fixed"
newBox.style.top = '65px';
newBox.style.left = '0px';
newBox.innerHTML = `


Your selller blocklist

eBay Seller Blacklist

Put each of the blocked seller in their own line:

${blacklist_serialized}


Hide listings from blacklisted sellers in search instead of emphasizing them?


`;

document.body.append(newBox);

document.getElementById("eBSBSaveButton").onclick = function() {
blacklist_serialized = document.getElementById("eBSBBlacklistArea").value.replace(/[ \t]+/g, '');
blacklist = new Set(blacklist_serialized.split("\n"));
GM_setValue("blacklist_serialized", blacklist_serialized); // the cache value has to be String, Integer or Boolean
GM_setValue("hideBlacklisted", document.getElementById("eBSBHideBlacklistedCheckBox").checked);
location.reload();
};

document.getElementById("eBSBToggleButton").onclick = function() {
document.getElementById('eBSBInnerDiv').classList.toggle('hidden');
};

function highlightSeller(sellerElement) {
sellerElement.style.color = "red";
sellerElement.style.fontWeight = "bold";
sellerElement.innerHTML = sellerElement.innerHTML + " (Blacklisted!)";
}

if(window.location.href.includes("/itm/")) {
let sellerElement = document.querySelector("div.x-sellercard-atf__info span.ux-textspans.ux-textspans--BOLD");;
if(sellerElement) {
if(blacklist.includes(sellerElement.innerText.trim())) {
highlightSeller(sellerElement);
}
}
} else if(window.location.href.includes("/sch/")) {
let sellerElements, sellerParentElementName;

if(window.location.href.includes(".co.uk/") || window.location.href.includes(".com.au/")) {
sellerParentElementName = "li.s-item";
sellerElements = document.querySelectorAll(".s-item__seller-info > .s-item__seller-info-text");
} else {
sellerParentElementName = "li.s-card"; // item element
sellerElements = document.querySelectorAll(".su-card-container__attributes__secondary > .s-card__attribute-row > :nth-child(1 of .su-styled-text.secondary.large)");
}

if(sellerElements) {
for(let i = 0; i < sellerElements.length; i++) {
let seller = sellerElements[i].innerHTML.match(/^([^ ]+) .*/)[1];
if(seller) {
if(blacklist.has(seller)) {
// console.log(seller);
if(hideBlacklisted) {
// sellerElements[i].closest(sellerParentElementName).classList.add("hidden");
sellerElements[i].closest(sellerParentElementName).remove();
} else {
highlightSeller(sellerElements[i]);
sellerElements[i].closest(sellerParentElementName).style.border = "2px solid red";
}
}
}
}
}
} else if(window.location.href.includes("/usr/")) {
let sellerElement = document.querySelector("a.mbg-id");
if(sellerElement) {
let seller = sellerElement.href.match(/\/usr\/(.+)$/)[1];

if(seller) {
if(blacklist.includes(seller)) {
highlightSeller(sellerElement);
}
}
}
}
xdpirate作者
§
发布于:2025-06-19

Hi there.

Hi, the script doesn't hide the sellers I blacklist.

Check out the new version just posted - should be fixed now. eBay keeps changing the implementation of their frontend between regional sites, I'm pretty sure they're doing a phased rollout of a UI refresh at this point, that slowly propagates to other sites. This was fixed by using the same logic for .com as was used for .com.au and .co.uk sites.

Make this blacklist button a floating window (the skelleton button that you click to expand the blocklist). This way, I can keep adding as I scroll.

Yep, good idea, I changed the position attribute to fixed so that it now floats along with the page.

Make the blacklist separated by newlines instead of comma (,) for the ease of reading.

I won't be implementing this - the list isn't supposed to be easy to read, presumably once you add a name to it, you won't be removing it again. With newlines, the list will become long and unwieldy quickly and difficult to manage, requiring a long scroll to add new names to it.

§
发布于:2025-06-19
编辑于:2025-06-19

Hi, I just took a look at the newest version. I am not sure if they are doing AB tests, but your fix would have worked a few weeks ago. But yesterday the source code was different. So this is what worked for me. Please take a look:

sellerParentElementName = "li.s-card"; // item element
sellerElements = document.querySelectorAll(".su-card-container__attributes__secondary > .s-card__attribute-row > :nth-child(1 of .su-styled-text.secondary.large)");

In my case, there are multiple `.su-styled-text.secondary.large` under `s-card__attribute-row`, thus I needed `:nth-child(... of ...)` to select the first of the type. This will also handle the situations for those promoted sellers, as eBay will inject more attributes into the promoted item cards.

xdpirate作者
§
发布于:2025-06-20

Until the site HTML stabilizes, changing the way the page is parsed is a cat-and-mouse game. I suggest waiting for that to happen, and using your modified version in the mean time. If I change the script for A, it won't work for B, and vice versa. Since I can only see the version that I'm presented (across multiple computers, even), I can't really add support for both until they land on the final choice.

发布留言

登录以发布留言。