jd only

只显示京东自营商品

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         jd only
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  只显示京东自营商品
// @author       heroin
// @match        https://list.jd.com/list.html*
// @match        https://search.jd.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var list = document.getElementsByClassName("gl-warp clearfix")[0].children;
    var i = 0;
    for(i; i<list.length;i++){
        var item = list[i];
        var jd = item.children[0];
        var j = jd.children.length - 1;
        for (j;j>-1;j--){
            var subItem = jd.children[j];
            console.log( i +" ===========");
            if(subItem.className.indexOf("p-icons") > -1){
                if(subItem.children.length > 0){
                    var title = subItem.children[0].innerText;
                    console.log(title);

                    if('自营' != title){
                        item.style='display:none';
                    }
                }else{
                    item.style='display:none';
                    console.log("no p-icons");
                }
                break;
            }
        }

    }

})();