jd only

只显示京东自营商品

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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;
            }
        }

    }

})();