Ebay collection only filter

Hides all collection only listings.

< Feedback on Ebay collection only filter

Review: Bad - script does not work

§
Posted: 2017-07-28

Needs updated as site is all https and has variations of span tags and text to find and hide.

My sugestion is as per below

// ==UserScript==
// @name Ebay collection only filter
// @namespace CollectionOnlyFilter
// @version 0.1
// @description Hides all collection only listings.
// @match https://www.ebay.co.uk/*
// @grant none
// ==/UserScript==

$(document).ready(function() {
$('body').append('');
$("#FCO").css("position", "fixed").css("top", 2).css("left", 2);
$('#FCO').click(function(){
$("span.s-item__delivery-options:contains('Collection in person')").parent().parent().parent().parent().hide();
$("span.ship:contains('Collection only: Free')").parent().parent().parent().hide();
});
});

§
Posted: 2018-02-19

I suggest this code (works in Firefox 58)

// ==UserScript==
// @name Ebay collection only filter
// @namespace CollectionOnlyFilter
// @version 0.1
// @description Hides all collection only listings.
// @include https://www.ebay.co.uk/*
// ==/UserScript==


var elements = document.body.querySelectorAll("span.ship");

for (var i = 0; i < elements.length; i++)
{
if(elements[i].innerHTML.indexOf("Collection only: Free") != -1)
{
elements[i].parentElement.parentElement.parentElement.style.display = "none";
}
};

Post reply

Sign in to post a reply.