wish.com Tweaks

Filtering by max price, autoload items

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name      wish.com Tweaks
// @namespace  [email protected]
// @version    1.3
// @description  Filtering by max price, autoload items
// @match      https://www.wish.com/*
// @copyright  [email protected]
// ==/UserScript==




$(document).ready(function() {   
    
    if ($("#nav-search").length > 0){
        
        $("#header-left").after('<div id="wish_tweaks_config" style="float: left; margin-top: 18px;"><p style="color: black;float: left;"> Autolad Products:</p><input type="checkbox" id="wtc_autoload_items" name="autoload_items" value="value" style="float: left;"><p style="color: black;float: left;">Max Price: </p><input id="wtc_max_price" type="text" maxlength="4" style="width: 30px;width: 2;margin-left: 5px;margin-top: 0px;"></div>');
        
        $("#wtc_max_price").keydown(function (e) {
            if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
                (e.keyCode == 65 && e.ctrlKey === true) || 
                (e.keyCode >= 35 && e.keyCode <= 39)) {
                return;
            }
            if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
                e.preventDefault();
            }
        });
        
        setInterval(function(){
            
            if($("#wtc_max_price").val() == ''){                
            }else{
                
                window.max_price = parseInt($("#wtc_max_price").val());
                                
                var items = $(".actual-price");
                
                $.each( items, function() {    
                    
                    if($(this).text().replace(/\D/g,'') > window.max_price){                                       
                        $(this).parent().parent().parent().parent().remove();                                       
                    }
                    
                });    
                
            }
            
            if($("#wtc_autoload_items").is(':checked')){
                $("#feed-more-btn").click();        
            }
            
        }, 500);
        
    }    
    
});