您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
去文章自定义主题、首页博客谷歌化 - lrc
当前为
// ==UserScript== // @name CSDN美化精简 - 在whoami 作者上二次开发 // @namespace http://tampermonkey.net/ // @version 1.3.6 // @description 去文章自定义主题、首页博客谷歌化 - lrc // @author whoami - lrc(在前者代码基础上进行二次装饰) // @match *://blog.csdn.net/*/article/details/* // @match *://*.blog.csdn.net/article/details/* // @match *://bbs.csdn.net/topics/* // @match *://*.iteye.com/blog/* // @match *://www.csdn.net/ // @match *://i.csdn.net/* // @match https://mp.csdn.net/* // @match *://so.csdn.net/so/search/* // @match *://blog.csdn.net/* // @match *://edu.csdn.net/* // @match *://*.csdn.net/ // @grant none // @icon https://csdnimg.cn/public/favicon.ico // @run-at document-end // ==/UserScript== // 根据网速自己设置时间间隔 var interval = 3000; var sideInterval = 4000; var bbsInterval = 3000; // 在ADBlock之后运行 var iteyeInterval = 100; (function () { 'use strict'; var currentURL = window.location.href; var blog = /article/; var blog2 = /article\/detail/; var bbs = /topics/; var iteye = /iteye/; var index = /www.csdn.net/; var index2 = "https://blog.csdn.net/"; var profile = /uc/; var search = /search/; var edu = /edu.csdn.net/; var setting = /i.csdn.net/; //论坛问题页面 var bbs2 = /bbs.csdn.net\/topics\// //个人中心页面 if(setting.test(currentURL)) { setTimeout(function() { $(".right_c .warn_tip").remove(); },2000); } // 论然详情页去除广告 if(bbs2.test(currentURL)){ $(".right-box>.flex-box").css("overflow", "hidden"); $(".post_recommend").remove(); $(".topic_r>.post_body>div").remove(); $(".reply").css("padding-bottom","20px"); $(".reply>.pub_list").remove(); $("#answer_btn").remove(); $(".title ").css("font-weight", "bold"); $("dl[class='bbs_feed bbs_feed_ad_box']").remove(); } if(currentURL == "https://ask.csdn.net/"){ $(".persion_article>.mod_about_teacher").remove(); } //去论坛广告、公告、注意事项 - 默认收起论坛分类 if(currentURL == "https://bbs.csdn.net/"){ $(".left_menu_box>.btn_toggle_hide").click(); $(".bbs_left_wrap>.ad_top").remove(); $(".ad_1").remove(); $(".bbs_notice").remove(); $(".advice").remove(); $(".fixed_dl").remove(); } console.log("==========" + currentURL) //文章布局恢复原版 - 去背景、部分广告、文章在右边,作者信息在左边 - if(blog2.test(currentURL)) { $(".blog_container_aside #footerRightAds").remove(); $(".blog_container_aside aside").css("float", "left !important"); //博客 $(".main_father>.container>main").css({"position":"absolute", "left":"50%", "top":"0px", "transform":"translate(-32%)"}) $(document).scroll(function() { $(".blog_container_aside aside").css("float", "left !important"); //博客 $(".main_father>.container>main").css({"position":"absolute", "left":"50%", "top":"0px", "transform":"translate(-32%)"}) }) $("body").css("background-image","none"); $("main>.template-box").remove(); } //若为CSDN论坛,则: //alert(currentURL); $(".blog_container_aside").unbind("scroll"); $("#mainBox").css("position", "relative"); $(".blog_container_aside").css({ "position":"absolute", "left":"0" }) $("#feedlist_id>li").eq(0).remove(); $(".right_box").css("display", "none"); $(".enterprise_blog").css("display", "none"); //优化搜索框 $(".search_bar").css("width", "290px"); $(".search_bar .input_search").css("width", "80%"); //去csdn学院推文、csdn推文 if(index.test(currentURL) || index2 == currentURL){ console.log("ture"); $(".fixed_content>aside").remove(); //添加阴影事件 $("#feedlist_id>li").css({"box-shadow":"0 0 2px grey", "transition":"box-shadow 1s", "border-radius": "20px"}); $(document).on("mouseover", "#feedlist_id>li",function() { $(this).css("box-shadow","0 0 20px 2px rgba(0,0,0,0.3)"); }) $(document).on("mouseout", "#feedlist_id>li",function() { $(this).css("box-shadow","0 0 2px grey"); }) $("#feedlist_id>li").css("margin-bottom", "20px"); var filterObj = $("li").filter(function(index){ var str = /CSDN学院/ var str2 = /csdn/ var currentStr = $(".name>a", this).text(); if(str.test(currentStr) || str2.test(currentStr)){ return true; } }) //console.log(filterObj) filterObj.remove(); //轮播图背景透明 $(".carousel").css("background","transparent"); $(".carousel>.carousel-right").remove(); } //$("#app").remove(); $(".csdn-side-toolbar").remove(); //去首页博客的广告 $("li").filter(function(index) { return $(this).attr("data-type") == "ad"; }).remove(); $(".banner-ad-box").remove(); $("#blogColumnPayAdvert").remove(); $(".bottom-pub-footer").remove(); $(document).scroll(function() { //优化搜索框 - https://edu.csdn.net/ if(edu.test(currentURL)){ $(".nav_box .search_bar").css("width", "290px"); $(".nav_box .search_bar .input_search").css("width", "80%"); } //去csdn学院、csdn推文 if(index.test(currentURL) || index2 == currentURL){ //去除右侧边栏 $("#feedlist_id>.list_con").remove(); $("#feedlist_id>script").remove(); $("#feedlist_id>img").remove(); //添加阴影事件 - li样式元素失效,需要重新上样式 - 纳闷 $("#feedlist_id>li").css({"box-shadow":"0 0 2px grey", "transition":"box-shadow 1s", "border-radius": "20px"}); $("#feedlist_id>li").css("margin-bottom", "20px"); //$("#feedlist_id").listview("refresh"); --不起作用 //$.parser.parse(); - 不起作用 var filterObj = $("li").filter(function(index){ var str = /CSDN学院/ var str2 = /csdn/ var currentStr = $(".name>a", this).text(); //return str.test(currentStr); if(str.test(currentStr) || str2.test(currentStr)){ return true; } }) //console.log(filterObj) filterObj.remove(); } $(".recommend").parents("li").css("display", "none"); $(".tip_box").css("display", "none"); $(".txt-refrash-new").css("display", "none"); $(".blog-expert-recommend-box").css("display", "none"); $(".recommend-recommend-box").css("display", "none"); $(".right_box").css("display", "none"); $(".enterprise_blog").css("display", "none"); //$("#app").remove(); //去首页博客的广告 $("li").filter(function(index) { if($(this).attr("data-type") == "ad") { return true; } }).remove(); //博客右边 $(".csdn-side-toolbar").remove(); }) //$("#csdn-toolbar>.center-block").css("padding-left", "0 !important"); $(".navL_listBox>.upgrade").nextAll().remove(); $(".navL_listBox>.upgrade").remove(); $(".J_nav_top").css("position", "relative"); $(".nav_l").css({"position":"absolute", "left":"50%"}); var nav_1_width = $(".nav_l").innerWidth()/2 + "px"; $(".nav_l").css("margin-left","-" + nav_1_width); $("#cooperative_partner").remove(); $(".fouce_img_box").remove(); $(".markes").remove(); $(".appControl").remove(); $(".userControl>.bord").eq(1).children().eq(1).nextAll().remove(); $(".userControl>.bord").eq(2).remove(); $(".pull-left>li").eq(7).nextAll("li").remove(); $(".pull-left").css({"position":"absolute", "left":"50%"}); var wPull = $(".pull-left").outerWidth()/2 + "px"; $(".pull-left").css("margin-left", "-" + wPull ); setInterval(function(){ if(profile.test(currentURL)) { $(".pull-left>li").eq(7).nextAll("li").remove(); $(".pull-left").css({"position":"absolute", "left":"50%"}); var wPull = $(".pull-left").outerWidth()/2 + "px"; $(".pull-left").css("margin-left", "-" + wPull ); // $("head").append("<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>"); //$(".userControl>.bord").eq(1).children().eq(1).nextall().remove(); } },2000); if(search.test(currentURL)) { $(".main-container").css("position","relative"); var length = $(".con-l").width() / 2; var left = "calc(50% - " + length + "px)"; $(".con-l").css( {"left":left, "position":"absolute"} ); $(".search-type>li:last-child").remove(); } if(index.test(currentURL) || index2 == currentURL) { // 自己新增 $(".container").eq(1).css("margin-left", "230px"); $(".pull-left>li").eq(7).nextAll("li").remove(); $(".pull-left").css({"position":"absolute", "left":"50%"}); var wPull = $(".pull-left").outerWidth()/2 + "px"; $(".pull-left").css("margin-left", "-" + wPull ); $("aside").remove(); } if(bbs.test(currentURL)){ setTimeout(function () { $(".js_show_topic").click(); document.getElementsByClassName("pulllog-box")[0].remove(); // 底部广告 $(".mediav_ad").remove(); // 帖子尾部广告 $(".post_recommend").remove(); // 帖子内[CSDN推荐] $(".ad_item").remove(); // 右侧广告 }, bbsInterval); }else if (blog.test(currentURL)){ $(".pull-left>li").eq(7).nextAll("li").remove(); $(".pull-left").css({"position":"absolute", "left":"50%"}); var wPull = $(".pull-left").outerWidth()/2 + "px"; $(".pull-left").css("margin-left", "-" + wPull ); $(".recommend-right").remove(); $(".tool-box").remove(); $("body").css("background-image","none"); $(".custom-box").remove(); $(window).unbind("scroll"); $("blog-content-box").css("float","right"); $("aside").css("float","right"); $("aside").css("margin-right", "10px"); csdn.copyright.init("", "", ""); //去除剪贴板劫持 localStorage.setItem("anonymousUserLimit", ""); // 免登陆 if (document.getElementsByClassName("btn-readmore")[0]){ document.getElementsByClassName("btn-readmore")[0].click(); } //自动展开 if (document.getElementsByClassName("comment-list-box")[0]){ document.getElementsByClassName("comment-list-box")[0].removeAttribute("style"); } //自动展开 $("#content_views").unbind("click");//移除url拦截 setTimeout(function () { if (document.getElementsByClassName("csdn-tracking-statistics mb8 box-shadow")[0]) { document.getElementsByClassName("csdn-tracking-statistics mb8 box-shadow")[0].remove(); //左上广告 } document.getElementById("asideFooter").remove(); if (document.getElementById("adContent")) { document.getElementById("adContent").remove(); } if (document.getElementsByClassName("p4course_target")[0]) { document.getElementsByClassName("p4course_target")[0].remove(); //左上广告 } document.getElementsByClassName("bdsharebuttonbox")[0].remove(); document.getElementsByClassName("vip-caise")[0].remove(); if (document.getElementsByClassName("fourth_column")[0]) { document.getElementsByClassName("fourth_column")[0].remove(); //左上广告 } }, interval); setTimeout(function () { if ($("div[id^='dmp_ad']")[0]) { $("div[id^='dmp_ad']")[0].remove(); } if (document.getElementsByClassName("fourth_column")[0]) { document.getElementsByClassName("fourth_column")[0].remove(); } }, sideInterval); setTimeout(function () { if (document.getElementsByClassName("pulllog-box")[0]) { document.getElementsByClassName("pulllog-box")[0].remove(); // 底部广告 } if (document.getElementsByClassName("p4course_target")[0]) { document.getElementsByClassName("p4course_target")[0].remove(); } }, sideInterval); setTimeout(function () { var hot = document.getElementsByClassName("type_hot_word"); var recommend = document.getElementsByClassName("recommend-ad-box"); for (var i = (hot.length - 1); i >= 0; i--) { hot[i].remove(); } for (var j = (recommend.length - 1); j >= 0; j--) { recommend[j].remove(); } if (document.getElementsByClassName("fourth_column")[0]) { document.getElementsByClassName("fourth_column")[0].remove(); } }, sideInterval); setTimeout(function () { for(var x=470; x<490; x++){ var kp_box = document.getElementById("kp_box_"+x); //右侧广告 if(kp_box) { kp_box.remove(); } } }, 5000); } else if (iteye.test(currentURL)) { setInterval(function(){ document.getElementById('btn-readmore').click(); }, iteyeInterval); setTimeout(function () { document.getElementsByClassName("blog-sidebar")[0].remove(); document.getElementById('main').style.width = '1000px'; }, sideInterval); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址