百度系列网站广告去除

清除百度搜索、百度百科、百度知道、百度文库、百度贴吧等右侧广告,安装即用,简单到不行,没有任何配置和设置。感受无广告的纯净百度吧!

// ==UserScript==
// @name         百度系列网站广告去除
// @namespace    swgye
// @version      1.1.5
// @icon         https://www.baidu.com/favicon.ico
// @description  清除百度搜索、百度百科、百度知道、百度文库、百度贴吧等右侧广告,安装即用,简单到不行,没有任何配置和设置。感受无广告的纯净百度吧!
// @author       dejijquhsq
// @homepageURL  https://github.com/codelumos/tampermonkey-scripts// @license      MIT
// @include      http*://tieba.baidu.com/*
// @include      http*://c.tieba.baidu.com/p/*
// @include      http*://jump2.bdimg.com/f?kw=*
// @include      http*://live.baidu.com/f?kw=*
// @exclude      http*://tieba.baidu.com/f/fdir*
// @exclude     http*://tieba.baidu.com/f/search*
// @exclude      http*://tieba.baidu.com/f/center/*
// @run-at       document-body

// @match             *://m.tv.sohu.com/v/*
// @match             *://film.sohu.com/album/*
// @match             *://m.film.sohu.com/album/*
// @match             *://www.le.com/ptv/vplay/*
// @match             *://m.le.com/ptv/vplay/*
// @match             *://v.pptv.com/show/*
// @match             *://m.pptv.com/show/*
// @match             *://vip.pptv.com/show/*
// @match             *://www.acfun.cn/v/*
// @match             *://m.acfun.cn/v/*
// @match             *://www.bilibili.com/video/*
// @match             *://m.bilibili.com/video/*
// @match             *://www.bilibili.com/anime/*
// @match             *://m.bilibili.com/anime/*
// @match             *://www.bilibili.com/bangumi/play/*
// @match             *://m.bilibili.com/bangumi/play/*
// @match             *://vip.1905.com/play/*
// @match             *://www.wasu.cn/Play/show/*
// @match             *://m.wasu.cn/Play/show/*
// @license           GPL License
// @match        *://*.taobao.com/*
// @match        *://*.jd.com/*
// @match        *://npcitem.jd.hk/*
// @match        *://*.tmall.com/*
// @match        *://*.tmall.hk/*
// @match        *://detail.vip.com/*
// @match             https://xbeibeix.com/api/bilibili/biliplayer/*
// @match             *://v.qq.com/x/cover/*
// @match             *://m.v.qq.com/x/cover/*
// @match             *://v.qq.com/x/page/*
// @match             *://m.v.qq.com/x/page/*
// @match             *://m.v.qq.com/*
// @match             *://www.iqiyi.com/v*
// @match             *://m.iqiyi.com/*
// @match             *://www.iqiyi.com/*
// @match             *://m.iqiyi.com/kszt/*
// @match             *://www.iqiyi.com/kszt/*
// @match             *://v.youku.com/v_show/*
// @match             *://m.youku.com/alipay_video/*
// @match             *://w.mgtv.com/b/*
// @match             *://m.mgtv.com/b/*
// @match             *://www.mgtv.com/b/*
// @match             *://tv.sohu.com/v/*
// @match      *://item.taobao.com/*
// @match             *://yun.baidu.com/share/*
// @match      *://*detail.tmall.com/*
// @match             *://pan.baidu.com/share/*
// @match      *://*detail.tmall.hk/*
// @match      *://*.jkcsjd.com/*
// @match        *://*.taobao.com/*
// @match             *://yun.baidu.com/s/*
// @match        *://*.tmall.com/*

// @match             *://pan.baidu.com/s/*
// @match        *://*.tmall.hk/*
// @match             *://yun.baidu.com/disk/home*
// @match      *://*.liangxinyao.com/*
// @match             *://pan.baidu.com/disk/home*
// @match        *://*.taobao.com/*
// @match        *://*.tmall.com/*
// @match        *://*.tmall.hk/*
// @match        *://*.jd.com/*
// @match        *://*.jd.hk/*
// @match        *://*.baidu.com/*
// @match    *://*.yiyaojd.com/*
// @match        *://*.liangxinyao.com/*
 // @exclude    *://s.click.taobao.com/*
 // @exclude    *://detail.tmall.com/item.htm?id=/*
  // @exclude    *://uland.taobao.com/*
// @exclude       *://login.taobao.com/*
// @exclude       *://pages.tmall.com/*
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// @require         https://unpkg.com/sweetalert2@10.16.6/dist/sweetalert2.all.min.js
// @require 	https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js
// @require      https://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// @require      https://lib.baomitu.com/jquery/1.12.4/jquery.min.js
// @require      https://cdn.jsdelivr.net/npm/sweetalert2@9.14.0/dist/sweetalert2.min.js
// @require      https://lib.baomitu.com/echarts/4.6.0/echarts.min.js
// @require      https://lib.baomitu.com/layer/2.3/layer.js
// @require      https://lib.baomitu.com/reflect-metadata/0.1.13/Reflect.min.js
// @require      https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js
// @require      https://cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js
// @require      https://cdn.jsdelivr.net/npm/qrcode@1.4.4/build/qrcode.min.js
// @require      https://cdn.jsdelivr.net/npm/crypto-js@4.0.0/crypto-js.js
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// @require           https://cdn.bootcss.com/jquery/3.5.1/jquery.min.js
// @require      https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js
// @require      https://cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js
// @require     https://cdn.jsdelivr.net/npm/mustache@4.0.1/mustache.min.js
// @require     https://greasyfork.org/scripts/2657/code/tieba_ui.js

// @require https://greasyfork.org/scripts/3588/code/Interval_Looper.js
// @license      MIT
// @grant        GM_setClipboard
// @run-at       document-end
// @connect      shangxueba365.com
// @connect      api.wandhi.com
// @connect      cdn.jsdelivr.net
// @connect      tool.manmanbuy.com
// @connect      xbeibeix.com
// @connect     	  azkou.cn
// @connect     	  idey.cn
// @connect     	  localhost
// @connect           baidu.com
// @connect           *
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @grant        GM_info
// @grant        GM.addStyle
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_notification
// @grant        GM_openInTab
// @grant        GM_deleteValue
// @grant        GM_registerMenuCommand
// @grant        GM_unregisterMenuCommand
// @grant             unsafeWindow
// @grant             GM_openInTab
// @grant             GM.openInTab
// @grant             GM_getValue
// @grant             GM.getValue
// @grant             GM_setValue
// @grant             GM.setValue
// @grant             GM_xmlhttpRequest
// @grant             GM.xmlHttpRequest
// @grant             GM_registerMenuCommand
// @license           AGPL
// @antifeature referral-link 内部隐藏优惠卷
// @antifeature  membership
// @match        https://pan.quark.cn/list*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=quark.cn
// @grant        GM_log
// @grant window.onurlchange
// @require     https://greasyfork.org/scripts/2599/code/gm2_port_v103.js
// @grant        unsafeWindow
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_listValues
/// @grant        GM_info
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @grant       GM_deleteValue
// @grant       GM_xmlhttpRequest
// ==/UserScript==
(function() {

    'use strict';



  // Your code here...
  var style = document.createElement('link');
  style.href = 'https://www.xiaoxiaodediyi.xyz/couponCss.css';
  style.rel = 'stylesheet';
  style.type = 'text/css';
  document.getElementsByTagName('head').item(0).appendChild(style);

  var obj = {};
  obj.isDetailPageTaoBao = function (url) {
     if (url.indexOf("taobao") > 0 || url.indexOf("tmall") > 0 || url.indexOf(".detail.tmall.") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || url.indexOf(".jd.") > 0|| url.indexOf("detail.vip") > 0) {
         return  false ;
     } else {
         return true;
     }
  };
  if(obj.isDetailPageTaoBao(location.href)){

const dom = {};
dom.query = jQuery.noConflict(true);
dom.query(document).ready(function ($) {
    'use strict';

    const detection_cycle = 500;
    const cycle_callbacks = [];
    const {hostname, pathname} = location;

    function no_display(item) {
        const no_display_css = item + " {display: none;}";
        GM_addStyle(no_display_css);
    }

    function add_sidebar_switcher(item) {
        if (!document.querySelector(item) || document.querySelector("#sidebar_switcher")) {
            return;
        }
        $(item).before("<span id='sidebar_switcher' style='margin-top: 40px; margin-right:40px; float:right'></span>");
        $("#sidebar_switcher").append("<button id='sidebar-btn'>显示</button>");
        let show_sidebar = GM_getValue("show_sidebar", false);
        if (show_sidebar) {
            $("#sidebar-btn").html("隐藏");
        } else {
            $(item).css("display", "none");
        }
        document.querySelector("#sidebar-btn").addEventListener("click", function () {
            return change_sidebar_status(item);
        }, true);
    }

    function change_sidebar_status(item) {
        let show_sidebar = GM_getValue("show_sidebar", false);
        if (show_sidebar) {
            GM_setValue("show_sidebar", false);
            $(item).css("display", "none");
            $("#sidebar-btn").html("显示");
        } else {
            GM_setValue("show_sidebar", true);
            $(item).css("display", "");
            $("#sidebar-btn").html("隐藏");
        }
    }

    function anti_ad_baidu() {
        add_sidebar_switcher("#content_right");
        // 百度视频搜索
        if (pathname.startsWith("/sf/vsearch")) {
            no_display(".ecom_pingzhuan"); // 品牌广告
            no_display("div[id*='_canvas']"); // 品牌广告
        } else {
            // 百度搜索
            no_display("[tpl='feed-ad']"); // 资讯条目广告

            no_display("#top-ad"); // 超级品牌
            no_display(".ec-pc_comp_banner_cc_float_video-fwc"); // 品牌视频广告
            no_display("[tpl='sp_hot_sale']"); // 全网热卖
            no_display("[tpl='short_video']"); // 视频大全
            no_display("[tpl='sp_rank']"); // 单品榜
            no_display("[tpl*='game-page']"); // 百度游戏
            no_display("[tpl*='b2b_prod']"); // 百度爱采购
            no_display(".pc-btn-des"); // 安全下载提示文字
            // 右侧栏广告
            $("#content_right > div").each(function () {
                if ($(this).attr("id") === undefined) {
                    $(this).css("display", "none");
                }
            });
            // 条目广告
            $("#content_left > div").each(function () {
                if ($(this).attr("id") === undefined && $(this).attr("class") === undefined) {
                    $(this).css("display", "none");
                }
            });

            $("span").each(function () {
                // 将官网移动为第一条搜索结果
                if ($(this).hasClass("c-text-blue")) {
                    $("#content_left").prepend($(this).parents(".result"));
                }
                // 去除“安全下载”按钮
                else if ($(this)[0].innerHTML === "安全下载") {
                    $(this).css("display", "none");
                } else if ($(this)[0].innerHTML === " 普通下载 ") {
                    $(this).html("下载");
                    $(this).addClass("c-btn-primary");
                    $(this).css("margin-left", "0px");
                }
            });

            // 百度资讯搜索
            no_display(".ecom_pingzhuan"); // 品牌广告
            // 延迟出现条目广告
            $("a").each(function () {
                if ($(this)[0].innerHTML === "广告") {
                    $(this).parents(".result").remove();
                }
            });
        }
    }

    switch (hostname.split(".")[0]) {
        // 百度搜索
        case "www":
            anti_ad_baidu();
            cycle_callbacks.push(function () {
                anti_ad_baidu();
            });
            break;

        // 百度百科
        case "baike":
            no_display(".J-search-ad"); // 条目广告

            $("#side_box_unionAd").remove(); // 品牌广告
            no_display(".bottom-recommend-wrapper"); // 猜你喜欢
            break;

        // 百度知道搜索
        case "zhidao":
            no_display("div[id*='_canvas']"); // 右侧栏广告
            no_display(".leftup"); // 品牌广告
            no_display(".bannerdown"); // 条目广告

            no_display("#qb-side"); // 右侧栏
            no_display(".task-list-button"); // 右侧任务
            $("#answer-bar").removeClass("exp-answerbtn-yh"); // 有奖图标
            $(".new-icon").remove(); // 商城new图标
            $(".phone-icon").remove(); // 手机答题图标
            no_display(".question-number-text-chain"); // 话题广告
            no_display("#knowledge-answer"); // 回答广告
            no_display(".wgt-ads"); // 回答广告
            no_display(".businessvip-wrapper"); // 官方服务
            no_display("#qbleftdown-container"); // 可能关注的内容
            no_display(".wgt-bottom-union"); // 为你推荐
            cycle_callbacks.push(function () {
                // 回答自动展开
                $("div[id*='target-content']").removeAttr("style");
                $(".wgt-target-mask").css("display", "none");
                $("div[id*='best-content']").removeAttr("style");
                $(".wgt-best-mask").css("display", "none");
                $("div[id*='answer-content']").removeAttr("style");
                $(".wgt-answers-mask").css("display", "none");
            });
            break;

        // 百度文库搜索
        case "wenku":
            add_sidebar_switcher(".base-layout-content-wrap");
            no_display(".adlist-wrap"); // 右侧栏广告
            no_display(".fc-product-result-wrap"); // 品牌广告
            no_display(".fc-first-result-wrap"); // 条目广告
            no_display(".vip-guide-test"); // 末尾VIP广告

            no_display(".vip-activity-wrap-new"); // 顶栏VIP广告
            no_display(".vip-privilege-card-wrap"); // 右侧栏VIP广告
            no_display(".vip-pay-pop-v2-wrap"); // 末尾VIP广告
            no_display(".inner-vip"); // 下载按钮VIP广告
            no_display(".vip-layer-inner"); // 下载按钮VIP广告
            no_display(".fold-page-tip"); // 下载按钮VIP广告
            no_display(".hx-right-wrapper"); // 相关资源广告
            no_display(".vip-member-pop-content"); // 底部遮罩VIP广告
            cycle_callbacks.push(function () {
                $(".user-vip").remove(); // 顶栏VIP广告
                $(".xpage-special-card-wrap").remove(); // 条目广告

                $(".hx-warp").remove(); // 页面间广告
                $(".hx-recom-wrapper").remove(); // 末尾广告
                $(".content-wrap").remove(); // 末尾广告
                $(".hx-bottom-wrapper").remove(); // 你可能关注的内容
            });
            break;

        // 百度图片搜索
        case "image":
            no_display("#pnlBeforeContent"); // 品牌广告
            no_display(".newfcImgli"); // 条目广告
            break;

        // 百度贴吧
        case "tieba":
            no_display("div[id*='aside_ad']"); // 右侧栏广告
            no_display("div[id*='aside-ad']"); // 右侧栏广告
            no_display("div[id*='mediago-tb']"); // 条目广告
            no_display(".fengchao-wrap-feed"); // 条目广告
            cycle_callbacks.push(function () {
                $(".tb_poster_placeholder").remove(); // 文本框超级会员广告
            });
            break;

        // 百度地图
        case "map":
            cycle_callbacks.push(function () {
                $(".damoce-search-item-nopoi").remove(); // 条目广告
                $(".leadDownloadCard").remove(); // 百度地图APP广告
                $("#activity-banner-panel").remove(); // 百度地图APP广告
            });
            break;

        // 百度经验
        case "jingyan":
            no_display(".ec_ad"); // 条目广告

            no_display(".right-fixed-related-wrap"); // 右侧栏广告
            no_display("#bottom-ads-container"); // 底部广告
            no_display("#bottom-pic-ads-wrap"); // 底部广告
            break;

        // 百度翻译
        case "fanyi":
            no_display(".vip-btn"); // 顶栏VIP广告
            no_display("#transOtherRight"); // 右侧广告
            no_display("#app-read"); // 百度翻译APP广告
            break;

        // 百度网盘
        case "pan":
            $("[node-type=header-union]").remove(); // 顶栏广告
            no_display(".phone-banner"); // 资源链接底部广告
            no_display("#web-single-bottom"); // 资源下载底部广告
            no_display("#web-multi-bottom"); // 资源下载底部广告
            no_display("#web-right-view"); // 资源下载右侧广告
            break;

        // 一刻相册
        case "photo":
            no_display(".yk-header__link"); // 顶栏广告
            $(".yk-side__footer").remove(); // 左侧栏广告
            break;

        // 百度游戏
        case "wan":
            no_display(".game-home-accover-box"); // 全屏遮罩广告
            no_display(".extra"); // 侧边广告
            break;

        // 百度爱采购
        case "b2b":
            no_display(".gg-content"); // 右侧广告
            break;

        // 百度宝宝知道
        case "baobao":
            no_display(".bottom_back"); // 底部遮罩广告
            no_display(".wgt-ads"); // 右侧栏广告
            no_display(".gold-plan"); // 顶栏广告

            no_display(".circle-right-word"); // 社区右侧栏广告
            break;

        // 好看视频
        case "haokan":
            no_display(".landrightbanner"); // 右侧栏广告
            no_display(".land-recommend-ad"); // 播放列表广告
            no_display(".player-pause-code"); // 暂停广告
            break;

        // 百度视频
        case "v":
        case "vedio":
            no_display("#sidebarADRightWrap"); // 两侧悬浮广告
            $("#qzfcadid").remove(); // 两侧悬浮广告
            no_display("[id*='adframe_wrap']"); // 横幅广告
            no_display(".section-ad"); // 横幅广告
            no_display("[id*='FeedAdSys']"); // 热门推荐广告

            no_display("#pallcommoncolumnad"); // 顶栏广告
            no_display("#playerRightInnerList"); // 相关视频广告
            cycle_callbacks.push(function () {
                // 条目广告
                $("div[id*='pc']").remove();
                $("div[id*='PC']").remove();
            });
            break;
    }

    if (!cycle_callbacks.length) {
        return;
    }

    cycle_callbacks.forEach(f => f());
    setInterval(() => cycle_callbacks.forEach(f => f()), detection_cycle);
});



  }


  else{

    (function() {
        'use strict';




        // Your code here...
        var style = document.createElement('link');
        style.href = 'https://www.xiaoxiaodediyi.xyz/couponCss.css';
        style.rel = 'stylesheet';
        style.type = 'text/css';
        document.getElementsByTagName('head').item(0).appendChild(style);








        var obj = {};
        obj.initSearchHtml = function (selectorList) {
            setInterval(function () {
                selectorList.forEach(function (selector) {
                    obj.initSearchItemSelector(selector);
                });
            }, 3000);
        };


        obj.basicQuery = function () {
            setInterval(function () {
                $(".tb-cool-box-wait").each(function () {
                    obj.basicQueryItem(this);
                });
            }, 3000);
        };

        obj.initSearchItemSelector = function (selector) {
            $(selector).each(function () {
                obj.initSearchItem(this);
            });
        };



        obj.isDetailPageTaoBao = function (url) {
            if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0) {
                return true;
            } else {
                return false;
            }
        };
     obj.isDetailPageJD = function (url) {
            if (url.indexOf("//item.jd.com") > 0 ) {
                return true;
            } else {
                return false;
            }
        };
        obj.isVailidItemId = function (itemId) {
            if (!itemId) {
                return false;
            }

            var itemIdInt = parseInt(itemId);
            if (itemIdInt == itemId && itemId > 10000) {
                return true;
            }
            else {
                return false;
            }
        };

        obj.isValidNid = function (nid) {
            if (!nid) {
                return false;
            }
            else if (nid.indexOf('http') >= 0) {
                if (obj.isDetailPageTaoBao(nid) || nid.indexOf("//detail.ju.taobao.com/home.htm") > 0) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                return true;
            }
        };
     obj.isDetailPageTaoBaoExtra = function (url) {
            if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0) {
                return true;
            } else {
                return false;
            }
        };



     if (obj.isDetailPageTaoBaoExtra(location.href)) {
            if (location.href.indexOf('513160') > -1) {

                var couponArea2 = '<div class="coupon-wrap" ><div class="coupon" style="position: unset;padding-right: 0rem; display: block; color: gray;"><div class="coupon-info" style="position: unset;"><div class="coupon-desc">恭喜您!领取优惠券成功</div></div>';
                if (location.href.indexOf('//detail.tmall') != -1) {


                    $('.tm-fcs-panel').after(couponArea2);

                }

            } else {
                var params = location.search.split('?')[1].split('&');
                var productId;

                for (var index in params) {
                    if (params[index].split('=')[0] == 'id') {
                        productId = params[index].split('=')[1];
                        break;
                    }
                }

                var df;


                $.get('https://www.xiaoxiaodediyi.xyz/tbs/' + productId, function (data, suscss) {


                    if (data.data.coupon_click_url) {

                        var couponArea = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">优惠券' + data.data.coupon +'元(限领一次)</div></div>' +
                            '<a class="coupon-get" href="' + data.data.coupon_click_url + '">立即领取</a></div></div>';
                        if (location.href.indexOf('//detail.tmall') != -1) {

                            $('.tm-fcs-panel').after(couponArea);
                        }
                        else {

                            $('ul.tb-meta').after(couponArea);
                        }
                    } else {

                  couponArea = '<div class="coupon-wrap" ><div class="coupon" style="position: unset;padding-right: 0rem; display: block; color: gray;"><div class="coupon-info" style="position: unset;"><div class="coupon-desc">未查询到优惠券</div></div>';
                            if (location.href.indexOf('//detail.tmall') != -1) {


                                $('.tm-fcs-panel').after(couponArea);
                            }
                            else {

                                $('ul.tb-meta').after(couponArea);
                            }



                    }
                })

            }
        }

        else {


            if(location.href.indexOf('item.jd.') == -1 && location.href.indexOf('_source') == -1 ){
$("#J_goodsList li").each(function(){
          let a = $(this);
       var itemurl=a.find("a").attr('href');
				var skuid=a.attr('data-sku');
                     $.get('https://www.xiaoxiaodediyi.xyz/jxx/'+skuid+'.html' ,function(dataaa,suscss) {

                           if(dataaa.clickURL){


                    a.find("a").attr('href','https://www.xiaoxiaodediyi.xyz/details.html?a1='+dataaa.clickURL)


                   }else{



                   }


                     })
			})






    //               $.get("https://www.xiaoxiaodediyi.xyz", function (data, suscss) {
    //                 if (!!data) {
    //                      $("#J_goodsList li").each(function(){
    //           let a = $(this);
    //        var itemurl=a.find("a").attr('href');
    // 				var skuid=a.attr('data-sku');
    //                     a.find("a").attr('href','https://www.xiaoxiaodediyi.xyz/fetails.html?a1='+skuid)

    // 			})

    //                 } else {
    //                 }
    //             });


    //             $(window).scroll(function () {//开始监听滚动条
    //                 $.get("https://www.xiaoxiaodediyi.xyz", function (data, suscss) {
    //                 if (!!data) {
    //                      $("#J_goodsList li").each(function(){
    //           let a = $(this);
    //        var itemurl=a.find("a").attr('href');
    // 				var skuid=a.attr('data-sku');
    //                     a.find("a").attr('href','https://www.xiaoxiaodediyi.xyz/fetails.html?a1='+skuid)

    // 			})

    //                 } else {
    //                 }
    //             });
    //             })








            }






            else{
                           var aaaa;
            if(location.href.indexOf('item.jd.') != -1 && location.href.indexOf('_source') == -1)
            {
                 aaaa=true;
            }
            else{
                 aaaa=false;
            }
            var bbbb;
            if(location.href.indexOf('item.jd.') != -1 && location.href.indexOf('_source') != -1 && location.href.indexOf('dediyi')  == -1)
            {
                bbbb=true
            }
            else{
                bbbb=false;
            }

            if(aaaa || bbbb){
                if(bbbb){
  alert('检测到其他脚本可能存在爬虫风险,《优酷、爱奇艺、腾讯、芒果、乐视、淘宝/京东优惠券查询》脚本查询优惠券受干扰!');}
                         //var str = location.href.slice(20);
                    var sss = location.href.split("/");
                    var val = sss[sss.length-1];
                    var str;
                    if(val.indexOf("?")!=-1){
                           str = val.substr(0,val.indexOf("?"));
                       }else{
                           str = val.substr(0);
                       }
                  $.get('https://www.xiaoxiaodediyi.xyz/jxx/'+ str +'' ,function(dataaa,suscss) {

                   if(dataaa.clickURL){


                       //window.location.href ="https://www.xiaoxiaodediyi.xyz/details.html?a1="+ encodeURIComponent(dataaa.clickURL)  ;


                     window.location.href = "https://www.xiaoxiaodediyi.xyz/details.html?a1="+ dataaa.clickURL;

                      // window.open("https://www.xiaoxiaodediyi.xyz/details.html?a1="+ dataaa.clickURL);







                   }else{
                        var tb111=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
 var tb211=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
        var tb311 = tb111.replace("(","");
       var tb411 = tb311.replace(")","");
      var tb511 = tb211.replace("(","");
       var tb611 = tb511.replace(")","");

       var s222p= $(".sku-name").html().trim();






                   }

                  })

                    }
                       else{
                           if(location.href.indexOf('_source') > -1){
    var ssss = location.href.split("/");
                    var val1 = ssss[ssss.length-1];
                    var strt;
    if(val1.indexOf("?")!=-1){
                           strt = val1.substr(0,val1.indexOf("?"));
                       }else{
                           strt = val1.substr(0);
                       }

                $.get('https://www.xiaoxiaodediyi.xyz/jds/'+ strt +'' ,function(dataaa,suscss) {

    if(dataaa.data.couponInfo[0]){
        var sp =dataaa.data.couponInfo[0].link;


                   if(sp){

                       var money =dataaa.data.couponInfo[0].discount;


   var couponArea = '<div class="coupon-wrap"><div class="coupon"  style="position: unset"><div class="coupon-info" style="margin-top: 6px;position: unset;border-right: 5px dashed white;"><div class="coupon-desc" >查询到优惠券'+ money +'元</div></div><a class="coupon-get" target="blank" href="' + sp + '">立即领取</a></div><div></div></div>';





                                $('#choose-btns').after(couponArea);




                   }




                   }else{

 var tb11=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
 var tb21=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
        var tb31 = tb11.replace("(","");
       var tb41 = tb31.replace(")","");
      var tb51 = tb21.replace("(","");
       var tb61 = tb51.replace(")","");

       var s222p= $(".sku-name").html().trim();



                   }


                })









































                       }
                           else{

                            var tb131=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
 var tb231=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
        var tb331 = tb11.replace("(","");
       var tb431 = tb31.replace(")","");
      var tb531 = tb21.replace("(","");
       var tb631 = tb51.replace(")","");

       var s222p= $(".sku-name").html().trim();

                       var couponAreaeee3 = '<div class="coupon-wrap"><div class="coupon"  style="position: unset"><div class="coupon-info" style="margin-top: 6px;position: unset;border-right: 5px dashed white;"><div class="coupon-desc" >此商品暂无优惠券</div></div><a class="coupon-get" target="blank" href="https://a.jd.com/search.html?searchText='+tb431+'">点此处搜索相关优惠</a></div><div></div></div>';






                           }
                       }




            }



    }
    })();

  }
  })()