Hide ebay range listings

Remove ebay listings that have range values

目前為 2017-10-27 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Hide ebay range listings
// @version      1.0
// @description  Remove ebay listings that have range values
// @author       Rolandas Valantinas
// @supportURL   https://github.com/rolandas-valantinas/gists/issues
// @include      *ebay.co.uk/sch*
// @run-at       document-start
// @grant        none
// @namespace https://greasyfork.org/users/157178
// ==/UserScript==

(function() {
    var interval = setInterval(hideListings, 2000);

    function hideListings() {
        var price = document.getElementsByClassName("prRange");

        for (var i = 0; i < price.length; i++) {
            price[i].parentNode.parentNode.parentNode.parentNode.remove();
        }

        console.log('cleaning');

        if (price.length === 0) {
            clearInterval(interval);
        }
    }
})();