Adds a blacklist for sellers on eBay that will emphasize or remove results from blacklisted sellers
< 脚本 eBay Seller Blacklist 的反馈
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 = `
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.
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.
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.
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!