Hide eBay items with price range

Hide items with a price range from the eBay search results

  1. // ==UserScript==
  2. // @name Hide eBay items with price range
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description Hide items with a price range from the eBay search results
  6. // @author Steve Chambers
  7. // @match https://www.ebay.com/*
  8. // @match https://www.ebay.co.uk/*
  9. // ==/UserScript==
  10.  
  11. // $("h3:contains('Show only')").parent().parent().next().prepend('<div class="cbx"><a class="cbx"><input style="margin: 0 3px 0 4px;" tabindex="-1" type="checkbox" name="LH_NoPriceRanges"><span class="cbx">No price ranges</span></input></a></div>');
  12. $("h3:contains('Show only')").parent().parent().next().prepend('<li class="x-refine__main__list"><div><h3 class="x-refine__item"><input style="margin: 0 3px 0 4px;" tabindex="-1" type="checkbox" name="LH_NoPriceRanges"><span class="cbx">No price ranges</span></input></h3></div></li>');
  13. $("h3:contains('Show only')").parent().parent().find('ul:first').append('<li class="x-refine__main__list"><input style="margin: 6px 6px 0 1px;" tabindex="-1" type="checkbox" name="LH_NoPriceRanges"/>No price ranges</li>');
  14.  
  15. $("input[name='LH_NoPriceRanges']").change(function() {
  16. $("span.prRange").closest('li.sresult').toggle(!this.checked);
  17. $("span.DEFAULT:contains(' to ')").closest('li.s-item').toggle(!this.checked);
  18. });
  19.  
  20. $("input[name='LH_NoPriceRanges']").prop("checked", false).change();