Pithy JD | 简洁 京东

首页仅保留导航栏、logo、搜索框。商品详情页信息居中,商品大图去水印,隐藏二维码,隐藏相关商品推荐,删除按钮边框虚线,隐藏搜索框推荐词

// ==UserScript==
// @name         Pithy JD | 简洁 京东
// @namespace    https://greasyfork.org/zh-CN/scripts/407394
// @version      2024-10-24
// @description  首页仅保留导航栏、logo、搜索框。商品详情页信息居中,商品大图去水印,隐藏二维码,隐藏相关商品推荐,删除按钮边框虚线,隐藏搜索框推荐词
// @author       AN drew
// @run-at       document-end
// @match        *://*.jd.com/*
// @exclude      https://passport.jd.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    if(window.location.href=="https://order.jd.com/center/list.action"||window.location.href=="https://order.jd.com/center/list.action?search=0&d=1&s=4096")
    {
        window.location.href="https://order.jd.com/center/list.action?search=0&d=2&s=4096";
    }
    if(window.location.href=="https://order.jd.com/center/recycle.action"||window.location.href=="https://order.jd.com/center/recycle.action?d=1"||window.location.href=="https://order.jd.com/center/recycle.action?search=0&d=1&s=4096")
    {
        window.location.href="https://order.jd.com/center/recycle.action?search=0&d=2&s=4096";
    }

    if(window.location.href.indexOf("www.jd.com") > -1)
    {
        GM_addStyle(`
#J_searchbg, #J_accessibility, #J_promotional-top, #J_mobile, #J_footer{
    display:none !important;
}
html, body, .mod_container{
    height:100%;
}
#header{
    border:none ;
    height:calc(100% - 31px);
}
.logo_subtit, .logo_extend, .logo_scene.logo_scene_hide, #logo>a{
    display:none !important;
}
#navitems, #hotwords, #treasure{
    display:none !important;
}
.fs, #app{
    display:none !important;
}
#logo{
    position:fixed;
    top:calc(30% - 80px);
    left:calc(50% - 100px);
}
.logo_tit_lk{
    position:fixed;
    top:calc(30% - 80px);
    left:calc(50% - 100px);
    margin:0px auto;
    width:250px;
    background: url(https://misc.360buyimg.com/jdf/1.0.0/unit/global-header/5.0.0/i/jdlogo-201708-@1x.png)  no-repeat;
}
#J_logo_extend{
    display:none!important;
}
#search .form{
    position:fixed;
    top:calc(60% - 80px);
    left:calc(50% - 273px);
    width:546px;
}
.search-m .search_bg, .search-m .text{
    background:white!important;
}
#settleup .cw-icon{
    position:fixed;
    top:33px;
    left:calc(100% - 137px);
    width:132px;
    height:32px;
}
#settleup .dropdown-layer{
   position:fixed;
    top:68px;
    left:calc(100% - 313px);
}
body:nth-of-type(2) {
    display:none!important;
}
.logo_extend{
    display:block!important;
}
#J_enjoyTop{
    display:none!important;
}
`);

        $("#settleup .cw-icon").wrap('<a target="_blank" href="//cart.jd.com/cart.action"></a>');
        $("#settleup .cw-icon a").replaceWith('<span>我的购物车<span>');
        $("#settleup .cw-icon span").attr("style","color: #e1251b;");

        $(".logo_tit_lk").attr("href","javascript:void(0);").css("cursor","default");
        $("#J_logo_extend").attr("href","javascript:void(0);").css("cursor","default");

    }

    GM_addStyle(`
.choose-support a span{
    z-index:1;
}
a.service, a.feedback, a.backtop{
    border: 0px; border-top: 1px solid #fff !important; border-bottom: 1px solid #fff!important;
}
.product-intro.clearfix{
    display:flex;justify-content:center;
}
.itemInfo-wrap{
    margin-left:20px;
}
#J_fs_act_lk, #toolbar-qrcode, #J_news, #shopRecSuit, #pop-hot, #sp-new, #shop-similar-promotion {
    display:none !important;
}

.jTdCode, .user_profit, .track, .mobile_static, .purchase-op, .smart-guide-bottom{
    display:none !important;
}
#fittings{
    display:none !important;
}
#view-buy, #yuyue-reco, #view-view, #cart-smart, #c-tabs-new{
    display:none !important;
}
.m.m-aside:not([class*='popbox']){
    display:none !important;
}
.m.m-content.hide{
    display:none !important;
}
#shareRecDemo, #guessing-liked, #orderAdids, #menu-ads, #miaozhen10772{
    display:none !important;
}
.bottom-search, .may-like, #main>.mod-main:nth-last-of-type(1):not([class*='message-box']){
    display:none !important;
}
.m.m-block.m-plus, .m.m-block.m-what
{
    display:none !important;
}
#top-banner
{
    display:none !important;
}
#o-header-2013
{
    display:none !important;
}
#popup_0_2
{
    display:none !important;
}
.topAdsPart
{
    display:none !important;
}
#bottomCode
{
    display:none !important;
}
div[style='background:;']
{
    display:none !important;
}
.ui-dialog
{
    display:none !important;
}
.ui-mask, .br-tab-wrap
{
    display:none !important;
}
.jdMaskIframe
{
    display:none !important;
}
.order-tb .ordertime-cont .time-txt {
	border: 2px solid #0084ff;
	border-radius:5px;
	background:white;
}
.order-tb .tr-th .dealtime {
	color:black;
	font-weight:bold;
}
.aside-bar{
    display:none!important
}
.g-main2 .m-list .ml-wrap{
    margin-left:0px
}
.goods-list-v2 .gl-warp{
    margin-left:95px
}
.zone-adimg{
    display:none !important
}
.amount span:nth-of-type(1){
	font-size:15px;
	color:#e4393c;
}
.m-item-ext.J-ext-trigger{
    display:none!important;
}
    `);

    $('[data-anchor="#comment"]').click(function(){
        setTimeout(function(){
            if($("#comm-curr-sku").length>0 && $("#comm-curr-sku").prop('checked')==false)
            {
                $("#comm-curr-sku").get(0).click();
                setTimeout(function(){
                    let comments = $('[clstag="shangpin|keycount|product|allpingjia"]').find("em").text();
                    $('[data-anchor="#comment"]').find("s").text(comments);
                },1000)
            }
        },500)
    })


    setInterval(function() {
        if($(".bigimg").length>0 && $(".bigimg").attr("src").indexOf("/n0/") > -1)
        {
            $(".bigimg").attr("src", $(".bigimg").attr("src").replace("/n0/","/n12/"));
        }
        $(".zoomImg").each(function(){
            if($(this).attr("src").indexOf("/n0/") > -1)
                $(this).attr("src", $(this).attr("src").replace("/n0/","/n12/"));
        })

    },1);

    var timer = setInterval(function(){
        if($(".jdm-tbar-tab-top").length>0)
        {
            $(".jdm-tbar-tab-top a").children().unwrap();

            $(".jdm-tbar-tab-top").click(function(){
                $(window).scrollTop(0);
            })
            clearInterval(timer);
        }
    },100)

    })();