'+searchData.txt+'');
}
var iconimg ="url('"+searchData.thisSearchIcon+"')";
$(".zkdsearch-icon").css({"background-image":iconimg,"background-size":"20px 20px"});
searchData.thisSearch=deftkw;
}
for (var i = 0; i < searchData.data.length; i++) {
if (searchData.data[i].img==""){
searchData.data[i].img=gongjuimg;
}
var listyle="";
if (searchData.data[i].width){
listyle='style="width:'+searchData.data[i].width+'%"';
console.log(listyle);
}
$(".search-engine-list").append('
' + searchData.data[i].name + "");
}
function filterChildren(element) {
var thisText = $(element).contents().filter(function (index, content) {
return content.nodeType === 3
}).text().trim();
return thisText
}
$("#txt").keyup(function (e) {
if ($(this).val()) {
if (e.keyCode == 38 || e.keyCode == 40 || !searchData.hotStatus) {
return
}
} else {
$(".search-clear").css("display", "none");
$("#box").css("display", "none")
}
});
$("#txt").keydown(function (e) {
if (e.keyCode === 40) {
listIndex === (hotList - 1) ? listIndex = 0 : listIndex++;
$("#box ul li").eq(listIndex).addClass("current").siblings().removeClass("current");
var hotValue = filterChildren($("#box ul li").eq(listIndex));
$("#txt").val(hotValue)
}
if (e.keyCode === 38) {
if (e.preventDefault) {
e.preventDefault()
}
if (e.returnValue) {
e.returnValue = false
}
listIndex === 0 || listIndex === -1 ? listIndex = (hotList - 1) : listIndex--;
$("#box ul li").eq(listIndex).addClass("current").siblings().removeClass("current");
var hotValue = filterChildren($("#box ul li").eq(listIndex));
$("#txt").val(hotValue)
}
if (e.keyCode === 13) {
var baidugourl="";
if(searchData.thisSearch.indexOf("sosoname") >= 0 ) {
baidugourl=searchData.thisSearch.replace(/sosoname/, $("#txt").val());
}else{
baidugourl=searchData.thisSearch + $("#txt").val();
}
if (baidugourl.indexOf("baidu.com")){
window.location.href=baidugourl;
}else{
GM_openInTab(baidugourl, {active: !0});
}
$("#box").css("display", "none");
$("#txt").blur();
$("#box ul li").removeClass("current");
listIndex = -1
}
});
$("#txt").focus(function () {
$(".search-box").css("box-show", "inset 0 1px 2px rgba(27,31,35,.075), 0 0 0 0.2em rgba(3,102,214,.3)");
if ($(this).val() && searchData.hotStatus) {
}
});
$("#txt").blur(function () {
setTimeout(function () {
$("#box").css("display", "none")
}, 250)
});
$(" .search-engine").hover(function () {
$(".search-engine").css("display", "block");
}, function () {
$(".search-engine").css("display", "none")
});
$(" .zkdsearch-icon").hover(function () {
$(".search-engine").css("display", "block");
if (GM_getValue('searchindex')){
$(".search-engine-list li").eq(GM_getValue('searchindex')).css("background","#D2E9FF");
}
});
$(".search-engine-head strong").click(function () {
var strongindex = $(this).index();
for (var c = 0; c< GM_getValue('sodata').length; c++) {
if ( c==strongindex){
}else{
$(".search-engine-head strong").eq(c).css({"background":"#F2F2F2","color":"#6C6D76"});
}
}
$(this).css({"background":"#1E90FF","color":"#FFF"});
GM_setValue('searchindex', 0 );
GM_setValue('searchfl', strongindex );
searchData = GM_getValue('sodata')[strongindex];
$(".search-engine-list").html(' ');
for (var i = 0; i < searchData.data.length; i++) {
if (searchData.data[i].img==""){
searchData.data[i].img=gongjuimg;
}
var listyle="";
if (searchData.data[i].width){
listyle='style="width:'+searchData.data[i].width+'%"';
console.log(listyle);
}
$(".search-engine-list").append('
' +
searchData.data[i].name + "");
if (searchData.txt){
if ($('#bduptxt').length <= 0 ) {
$(".search-engine-list").before('
'+searchData.txt+'');
}
}else{
$("#bduptxt").remove();
}
}
});
$("#hot-btn").click(function () {
$(this).toggleClass("off");
searchData.hotStatus = !searchData.hotStatus;
});
searchData.hotStatus ? $("#hot-btn").removeClass("off") : $("#hot-btn").addClass("off");
$(".search-engine-list").on("click","li",function(){
var index = $(this).index();
if (searchData.data[index].img==""){
searchData.data[index].img=gongjuimg;
}
if (searchData.data[index].up){
GM_setValue('baidujg', 1);
}
if (searchData.txt){
}else{
if (searchData.data[index].type=="0"){
GM_setValue('searchindex', index);
searchData.thisSearch = searchData.data[index].url;
var iconimg ="url('"+searchData.data[index].img+"')";
$(".zkdsearch-icon").css({"background-image":iconimg,"background-size":"20px 20px"});
}
}
$(".search-engine").css("display", "none");
for (var z = 0; z < searchData.data.length; z++) {
if (z==index){
if ( searchData.data[index].type=="1"){
GM_openInTab(searchData.data[index].url, {active: !0});
return;
}
$(".search-engine-list li").eq(index).css("background","#D2E9FF");
}else{
$(".search-engine-list li").eq(z).css("background","#f9f9f9");
}
}
});
$("#search-btn").click(function () {
var textValue = $("#txt").val();
if (textValue) {
var baidugourl="";
if(searchData.thisSearch.indexOf("sosoname") >= 0 ) {
baidugourl=searchData.thisSearch.replace(/sosoname/, textValue);
}else{
baidugourl=searchData.thisSearch + textValue;
}
GM_openInTab(baidugourl, {active: !0});
$("#box ul").html("")
} else {
layer.msg("加载中", {
time: 500
}, function () {
$("#txt").focus()
})
}
})
}
if(zkddomain.indexOf(".op.gg") > 0 ) {
$(".vm-placement").remove();
}
if(zkddomain.indexOf("greasyfork.org") <= 0 ) {
delgoogle();
delzhihu();
deldouban();
delbaidu();
del360();
if($("iframe").length>0 ){
$("iframe").each(function(){
if($(this).attr('src') ){
if ($(this).attr('src').indexOf('pos.baidu.com') >=0) {
$(this).remove();
}
}
});
}
setTimeout(function(){
$("div").each(function(){
if ($(this).attr("data-type")=="GoogleRender"){
$(this).remove();
}
});
delgoogle();
delzhihu();
deldouban();
delbaidu();
del360();
$("iframe").each(function(){
if($(this).attr('src') ){
if ($(this).attr('src').indexOf('pos.baidu.com') >=0 ) {
$(this).remove();
}
}
});
},3000);
var ref = "";
ref = setInterval(function(){
delgoogle();
},2000);
function delgoogle() {
if($("ins").length>0 ){
$("ins").each(function(){
if ($(this).attr("class") ){
if ($(this).attr("class").indexOf('google') >=0){
$(this).remove();
}
}
});
}
var y = document.getElementsByClassName("adsbygoogle");
var j;
for (j = 0; j < y.length; j++) {
y[j].style.display = "none";
}
$(".adsbygoogle").remove();
$("script").each(function(){
if($(this).attr("src")){
let googads=$(this).attr("src");
if (googads.indexOf('adsbygoogle.js') >=0 || googads.indexOf('g.doubleclick.net') >=0){
$(this).remove();
}
}
});
$("div").each(function(){
$(this).attr("id");
if($(this).attr("id")){
let googsrcid=$(this).attr("id");
if (googsrcid.indexOf('google_ads') >=0){
$(this).remove();
}
}
if($(this).attr("data-google-query-id")){
$(this).remove();
}
});
}
function delzhihu() {
if(zkdurldomain.indexOf('zhihu.com') > 0){
if (isMobile()){
$("a[class='MBannerAd']").remove();
$("a[class='MHotFeedAd']").remove();
$("div[class='Card RelatedReadings']").remove();
}
$("html").bind("DOMNodeInserted",function(e){
if ( $(".Button.Modal-closeButton.Button--plain").length>0 && $(".signFlowModal-container").length>0 && zhihudl==0){
zhihudl=1;
$(".Button.Modal-closeButton.Button--plain").click();
}
})
$(".Pc-feedAd").remove();
$(".Banner-adsense").remove();
$("img").each(function(){
if ($(this).attr("alt")=="广告"){
$(this).remove();
}
});
}
}
function deldouban() {
if(zkdurldomain.indexOf('douban.com') > 0){
// $('div[ad-status]').attr('ad-status')
$('div[ad-status]').each(function() {
if ($(this).attr('ad-status') == "appended") {
$(this).remove();
}
})
}
}
}
function del360() {
if($("iframe").length>0 ){
$("iframe").each(function(){
if($(this).attr('src') ){
//console.log($(this).attr('src'))
}
});
}
if(zkddomain.indexOf('360kan.com') > 0 ){
$("li").each(function(){
if ($(this).attr("data-clicklog") ){
$(this).remove();
}
})
}
if (zkddomain.indexOf('so.com') > 0 && zkdurldomain.indexOf('so.com/s') > 0){
$("#e_idea_pp").remove();
$("#side").remove();
$("#mohe-360pic_sad--normal").remove();
$("#e_map_idea").remove();
$("#e_idea_pp_vip_bottom").remove();
}
if(zkddomain.indexOf('so.com') > 0 ){
$(".aside").remove();
$("#js-bussiness-bot-list").remove();
$("#js-mod-fixed-inn").remove();
$("#e_idea_wenda_leftBox").remove();
}
}
if(zkdurldomain.indexOf('.baidu.com/') > 0){
setInterval(function(){
delbaidu()
},2000);
}
function delbaidu() {
if(zkddomain.indexOf("baidu.com") > 0 ) {
//移动端
if ((zkdurldomain.indexOf('/s?word') > 0 || zkdurldomain.indexOf('&wd=') > 0 || zkdurldomain.indexOf('?wd=') > 0 || zkdurldomain.indexOf('&word=') > 0) && zkdurldomain.indexOf('&rtt=') < 0){
$("#content_right").find(".c-row").remove();
$("#top-ad").remove();
if (isMobile()){
$('body').on('click','a',function(){
if ($(this).attr("href")){
window.location.href=$(this).attr("href");
}
})
$("span[ref='open']").parent().parent().remove();
$(".ec_wise_ad").remove();
$(".ec-result-inner").remove();
$(".c-result.result[srcid='xcx_multi']").remove();
$("div[data-module='b']").remove();
}
}
//
if(zkdurldomain=="https://www.baidu.com/" || zkdurldomain=="https://www.baidu.com" || zkdurldomain.indexOf('www.baidu.com/?') > 0 ) {
$("div[class='san-card'][tpl='feed-ad']").remove();
}
if(zkdurldomain.indexOf('baijiahao.baidu.com/s') > 0 ) {
}
if(zkdurldomain.indexOf('www.baidu.com/s') > 0 && zkdurldomain.indexOf('&rtt=') < 0){
$("[cmatchid]").remove();
//$("#content_right").remove();
$("#top-ad").remove();
$(".ec-pc_mat_c_banner__cc_banner_background_b").remove();//品牌广告模块
//右边栏
$(".layout").remove();
$(".hint_right_middle").remove();
//$("#content_left").css("width","100%");
//$(".c-container").css("width","100%").css("padding-bottom","20px");
//
$("div[id='content_left'] >div").each(function(index,element) {
let t = $(element).children(':last-child').children(':last-child').text();
if (t=="广告"){
$(element).remove();
}
let xzggbt =$(element).find("span");
if (xzggbt){
xzggbt.each(function(index,elnt) {
if ( $(elnt).text()=="广告"){
$(element).remove();
}
})
}
})
if(zkdurldomain.indexOf("sf/vsearch") < 0 ) {
$("#content_left").find("div:eq(0)").each(function() {
let bid = String($(this).attr("id"));
let bclass = String($(this).attr("class"));
if (bid == "undefined" && bclass == "undefined" ) {
$(this).remove();
}
})
}
}
if(zkdurldomain.indexOf('zhidao.baidu.com') > 0){
$(".shop-entrance").remove();
$(".activity-entry").remove();
$(".task-list-button").remove();
}
if(zkdurldomain.indexOf('zhidao.baidu.com/index/') > 0){
if (isMobile()){
$("div[class='ecs-wraper']").remove();
}
}
if(zkdurldomain.indexOf('zhidao.baidu.com/search') > 0){
if ($("i[class='ariaicon ariaicon-exit ariaexit fixedSelect ariaskiptheme']").length>0){
$("i[class='ariaicon ariaicon-exit ariaexit fixedSelect ariaskiptheme']").click();
}
if (isMobile()){
$("div[class='ecs-wraper']").remove();
}
$(".bannerdown").remove();
$(".aside.fixheight").remove();
$(".wgt-bottom-ask").remove();
$(".leftup").remove();
$(".wgt-iknow-special-business").remove();
}
if(zkdurldomain.indexOf('zhidao.baidu.com/question') > 0){
if ($("i[class='ariaicon ariaicon-exit ariaexit fixedSelect ariaskiptheme']").length>0){
$("i[class='ariaicon ariaicon-exit ariaexit fixedSelect ariaskiptheme']").click();
}
if (isMobile()){
$("div[class='wap-youx-change-asp']").remove();
$("#feed-recommend").remove();
$("div[class*=ecom-ads']").remove();
if($(".circusee-bg").length>0 ){
$(".circusee-bg").hide();
$("div[class='chat-consult shorten']").css('height','auto');
}
}
if($(".circusee-bg").length>0 ){
$(".circusee-bg").hide();
$(".chat-consult-box").css('height','auto');
}
$("#knowledge-answer").remove();
$(".grid-r.qb-side").remove();
$(".wgt-ads").remove();
$(".wgt-bottom-union").remove();
$(".adTopImg").remove();
$(".exp-topwld-tip").remove();
$("#wgt-ecom-banner").remove();
$("#wgt-ecom-right").remove();
$(".question-number-text-chain").remove();
setTimeout(function(){
$(".ec-pc_mat_coeus__related_link_text-content").remove();
}, 1000);
}
if(zkdurldomain.indexOf('wapbaike.baidu.com/item') >= 0){
$("div[class='yitiao-content J-yitiao-content']").remove();
}
if(zkdurldomain.indexOf('baike.baidu.com') > 0){
setTimeout(function(){
$("#navbarAdNew").remove();
$(".userbar_mall").remove();
}, 1000);
}
if(zkdurldomain.indexOf('baike.baidu.com/item') > 0){
//$(".before-content").remove(); 百度百科多义词和秒懂百科视频相关
$(".configModuleBanner").remove();
setTimeout(function(){
$(".topA").remove();
$(".right-ad").remove();
$(".lemmaWgt-promotion-vbaike").remove();
$(".lemmaWgt-promotion-slide").remove();
$("#side_box_unionAd").remove();
}, 1000);
}
if(zkdurldomain.indexOf('wenku.baidu.com') > 0){
$(".banner-ad").remove();
$(".ad-box").remove();
$("#banurl").remove();
$("#my-wkHome-vip-tips").parent().remove();
$(".vip-card").remove();
setTimeout(function(){
$(".zsj-topbar").remove();
$(".lastcell-dialog").remove();
$(".zsj-toppos").remove();
}, 1000);
}
if(zkdurldomain.indexOf('wenku.baidu.com/search') > 0){
$("#fengchaoad").remove();
$("div[class='adlist-wrap']").remove();
$(".yuedu-recommend-wrap").remove();
$(".search-aside-adWrap").remove();
$(".fc-first-result-wrap").remove();
}
if(zkdurldomain.indexOf('wk.baidu.com/') > 0){
$(".fc-result").remove();
}
if(zkdurldomain.indexOf('wk.baidu.com/view') > 0){
if (isMobile()){
$(".middle-box-root").remove();
$(".fc-ad-contain").remove();
$(".shops-hot").remove();
$(".b-bigpic-root").remove();
$(".video-rec-wrap").remove();
$(".shops-hot").remove();
$("div[class='new-guideapp-card-btn new-guideapp-card-animation']").remove();
$("div[class='reader-wrap reader-copy']").css('height','auto');
$("#view-app").css('max-height','');
}
}
if(zkdurldomain.indexOf('wenku.baidu.com/view') > 0){
if (isMobile()){
$(".middle-box-root").remove();
$(".fc-ad-contain").remove();
$(".shops-hot").remove();
$(".b-bigpic-root").remove();
$(".video-rec-wrap").remove();
$(".shops-hot").remove();
$("div[class='fold-pager with-margin']").remove();
$("div[class='reader-wrap reader-copy']").css('height','auto');
$("#view-app").css('max-height','auto');
}
$(".hx-bottom-wrapper").remove();
$(".hx-warp").remove();
$(".fc-fold-page").remove();
$(".hx-recom-wrapper").remove();
$(".hx-bottom-wrapper").remove();
$(".relative-recommend-wrapper").remove();
$(".fc-container").remove();
$("#ggbtm").parent().remove();
$(".union-ad-bottom").remove();
$(".ad-vip-close-bottom").remove();
$(".operation-wrapper").remove();
$(".relative-course-wrapper").remove();
$(".hot-search-wrapper").remove();
$(".hx-right-wrapper").remove();
$("#relative-videos-wrap").remove();
$(".add-has-money-pay").remove();
$(".wk-color-vip-red").parent().parent().remove();
$(".vip-tips-wrap").parent().remove();
$(".top-ads-banner-wrap").remove();
setTimeout(function(){
$(".wangpan-tip").remove();
$(".new-user-discount-tip").remove();
$(".pay-vip-btn-wrap").remove();
$(".relative-doc-ad-wrapper").remove();
}, 1000);
setInterval(function(){
$(".view-like-recom-fc").remove();
}, 1000);
}
if(zkdurldomain.indexOf('baidu.com/video/page') > 0){
$("div[class='na-ec-item']").each(function() {
if ($(this).find("a[data-type='native_ad']").length > 0){
$(this).remove();
}
})
}
if(zkdurldomain.indexOf('baidu.com/s?') > 0){
$("div[class*='c-container ec_resitem']").remove();
$("span[ref='open']").parent().parent().remove();
}
if(zkdurldomain.indexOf('m.baidu.com') > 0 || zkdurldomain.indexOf('www.baidu.com') > 0){
$("div[style='overflow: hidden;background: #fff;position: relative;']").remove();
}
if(zkdurldomain.indexOf('baidu.com/sf/vsearch?pd=image_content') > 0){
$("div[class='sfc-image-content-waterfall-item']").each(function() {
if ($(this).find("div[class='sfc-image-content-img-toolbar-ad-text']").length > 0){
$(this).remove();
}
})
}
if(zkdurldomain.indexOf('baidu.com/sf/vsearch?pd=video') > 0){
$("div[data-type='ad']").remove();
}
if(zkdurldomain.indexOf('baidu.com/sf/vsearch?pd=wenku') > 0){
$("div[data-tpl='adv_wenku_fc']").remove();
}
if(zkdurldomain.indexOf('baidu.com/sf/vsearch?pd=tieba') > 0 || zkdurldomain.indexOf('baidu.com/sf/vsearch?pd=wenda_tab') > 0){
$("div[class*='c-container ec-container']").remove();
}
if(zkdurldomain.indexOf('image.baidu.com/search/index') > 0){
$("li[class='newfcImgli']").remove();
$("#pnlBeforeContent").remove();
setInterval(function(){
$(".fcImgli").remove();
}, 1000);
}
if(zkdurldomain.indexOf('image.baidu.com/search/detail') > 0){
$(".text-link-ads").remove();
$(".rsresult-card").remove();
$("#adCard").remove();
}
if(zkdurldomain.indexOf('tieba.baidu.com/sf/vsearch') > 0){
$("div[class*='c-container ec-container']").remove();
}
if(zkdurldomain.indexOf('tieba.baidu.com/f/search') > 0){
$(".s_aside").remove();
}
if(zkdurldomain.indexOf('tieba.baidu.com/p/') > 0){
if (isMobile()){
$("div[class='banner-wrapper-defensive']").remove();
$("div[class='fengchao-banner-defensive']").remove();
$("div[class='list-content']").find("div[class='list-content']").remove();
}
}
if(zkdurldomain.indexOf('tieba.baidu.com/f?') > 0){
if (isMobile()){
$("div[class='tb-banner-wrapper-defensive tb-banner tb-threadlist__item']").remove();
}
$("img[class='close_btn j_click_close']").click();
$("div[class='clearfix thread_item_box']").remove();
$("div[id='fc-wrap']").remove();
$("#mediago-frs-aside").remove();
$("#mediago-tb-pb-list-aside").remove();
$("div[class='fengchao-wrap']").hide();
setTimeout(function(){
$(".fengchao-wrap-box").remove();
$("div[class='fengchao-wrap']").remove();
$("div[id*='mediago-tb-']").remove();
$("div[ad-dom-img]").remove();
}, 1000);
}
if(zkdurldomain.indexOf('tieba.baidu.com/p') > 0){
//setInterval(function(){ }, 1000);
//$("span:contains('广告')").parent().parent().parent().parent().parent().parent().remove();
$("#mediago-frs-aside").remove();
$("#mediago-tb-pb-list-aside").remove();
$("div[class='fengchao-wrap']").hide();
$("div[id*='mediago-tb-']").remove();
$("div[ad-dom-img]").remove();
}
if(zkdurldomain.indexOf('map.baidu.com/search') > 0){
setInterval(function(){
$(".damoce-search-item.damoce-search-item-nopoi").remove();
}, 1000);
}
if(zkdurldomain.indexOf('jingyan.baidu.com/search') > 0){
$(".ec_ad").parent().remove();
}
if(zkdurldomain.indexOf('jingyan.baidu.com/article') > 0){
$("#fresh-share-exp-e").remove();
$(".wgt-income-money").remove();
$(".aside-pro-container").remove();
$("#bottom-ads-container").remove();
$(".magzine-list").remove();
$("div[class='aside-wrap wgt-cms-banner']").hide();
$("div[class='right-fixed-related-wrap']").hide();
$("div[class='ad-card']").hide();
$("aside[class='rel-exp-feed-ad-item']").hide();
}
if(zkdurldomain.indexOf('video.baidu.com') > 0 || zkdurldomain.indexOf('v.baidu.com') > 0){
setTimeout(function(){
$("#PCallpagesidebar1").remove();
$("#PCallpagesidebar2").remove();
$(".bdvideo-adver-carousel").parent().remove();
$("div[id*='adone']").remove();
$("div[id*='adtwo']").remove();
$("#pallcommoncolumnad").remove();
$("#index_right_top").remove();
$("#qzfcadid").remove();
$("#pcshortchannelTopRight").remove();
$("#__lawnImageContainer").parent().parent().remove();
$("#detail_adm_right").remove();
$(".ctt-adver1-banner").remove();
$("div[id*='PCDetailPageTopRightList']").remove();
}, 1000);
setInterval(function(){
$("div[id*='channelBannerAdver']").remove();
$("div[id*='channelColumn']").parent().remove();
$("div[id*='ChannelColumn']").parent().remove();
$("div[id*='pc']").remove();
$("div[id*='PC']").remove();
$("div[id*='adv-carousel-item']").parent().remove();
$("[id*='FeedAdSys']").remove();
$("div[id*='TabAd']").remove();
$(".section-ad").remove();
$(".full-collunm-ad").remove();
}, 1000);
}
if(zkdurldomain.indexOf('video.baidu.com/v') > 0 || zkdurldomain.indexOf('v.baidu.com/v') > 0){
$(".top-ad-cont").remove();
setTimeout(function(){
$("div[id*='searchMoreLong']").remove();
$("#searchPagefeedBanner").remove();
$(".side-content").remove();
$("#psBottomColumn").parent().remove();
}, 1000);
setInterval(function(){
$("#searchResultAdOne").remove();
$("#searchHotShortSeven").remove();
$("#searchHotShortSevenTwo").remove();
}, 1000);
}
if(zkdurldomain.indexOf('www.baidu.com/sf/vsearch') > 0){
$("#s_tab").next().next().each(function() {
var id = String($(this).attr("id"));
if (id == "undefined") {
$(this).remove();
}
})
}
}
}
if(zkdurldomain.indexOf("dalipan.com/detail") >= 0 ) {
$(".button").on("click",function(){
if (__NUXT__){
$(".el-dialog__wrapper").remove();
window.location.href=__NUXT__.data[0].url;
}
});
}
})();