Skip to content

Instantly share code, notes, and snippets.

@abudden
Last active Nov 4, 2021
Embed
What would you like to do?
ebay.co.uk doesn't have a blacklist feature - this tampermonkey script allows me to avoid buying from blacklisted sellers again
// ==UserScript==
// @name Ebay Blacklist
// @namespace https://www.cgtk.co.uk
// @version 0.1
// @description Make it clear when ebay sellers are on a blacklist
// @author A. Budden
// @match https://*.ebay.co.uk/itm/*
// @icon https://www.google.com/s2/favicons?domain=ebay.co.uk
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Put the blacklisted seller names in here:
var blacklist = [
'seller1',
'seller2',
'seller3',
'seller4',
'seller5'
];
var sellerObjs = document.getElementsByClassName('mbg-nw');
var foundSeller = false;
for (var sellerObj of sellerObjs) {
console.log(sellerObj);
var seller = sellerObj.innerHTML;
if (blacklist.indexOf(seller) === -1) {
return;
}
foundSeller = true;
sellerObj.innerHTML = '<span class="blacklistBanner"><font color="red">BLACKLISTED!</font> </span>' + seller;
}
if ( ! foundSeller) {
return;
}
var titleObj = document.getElementById('itemTitle');
titleObj.innerHTML = '<span class="blacklistBanner"><font color="red">BLACKLISTED SELLER!</font> </span>' + titleObj.innerHTML;
var blink_speed = 250; // every 250 == 0.25 second
var t = setInterval(function () {
var eles = document.getElementsByClassName('blacklistBanner');
for (var ele of eles) {
ele.style.visibility = (ele.style.visibility == 'hidden' ? '' : 'hidden');
}
}, blink_speed);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment