├── README.md ├── archived ├── Glgoo学术优化.user.js ├── 快资讯去广告.user.js └── 网址导航去广告.user.js └── scripts ├── 360搜索去广告.user.js ├── bimi动漫优化.user.js ├── 百度系网站去广告.user.js └── 问卷星允许选中复制.user.js /README.md: -------------------------------------------------------------------------------- 1 | # tampermonkey-scripts 2 | 3 | ## 仓库简介 4 | 5 | tampermonkey-scripts中包含多个有关改进网页浏览体验的脚本。 6 | 7 | 这些脚本都基于Tampermonkey设计和实现,在使用这些脚本前请确保您的浏览器安装了Tampermonkey或其他同类型插件。 8 | 9 | GreasyFork主页:https://greasyfork.org/users/388246 10 | 11 | ## 路径说明 12 | 13 | - scripts:已发布脚本 14 | 15 | - archived:已归档,包含旧的和不支持的脚本,有可能已失效且不再进行维护 16 | 17 | ## 脚本列表 18 | 19 | - bimi动漫优化 20 | 21 | 脚本简介:bimi动漫(M站)去广告以及其他一系列优化 22 | 23 | 安装链接:https://greasyfork.org/scripts/391325 24 | 25 | 26 | - 百度系网站去广告 27 | 28 | 脚本简介:去除百度搜索结果和页面中的绝大多数广告 29 | 30 | 安装链接:https://greasyfork.org/scripts/394099 31 | 32 | 33 | - 问卷星允许选中复制 34 | 35 | 脚本简介:解除问卷星对选中和右键的限制 36 | 37 | 安装链接:https://greasyfork.org/scripts/416535 38 | 39 | 40 | - 360搜索去广告 41 | 42 | 脚本简介:去除360搜索结果和页面中的绝大多数广告 43 | 44 | 安装链接:https://greasyfork.org/scripts/416595 45 | 46 | ## 联系方式 47 | 48 | - 📧:codelumos@163.com 49 | -------------------------------------------------------------------------------- /archived/Glgoo学术优化.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Glgoo学术优化 3 | // @namespace http://tampermonkey.net/ 4 | // @version 0.2.1 5 | // @icon https://xs.xiayige.org/favicon.ico 6 | // @description Glgoo学术搜索去广告和其他一系列优化 7 | // @author CodeLumos 8 | // @homepageURL https://github.com/codelumos/tampermonkey-scripts 9 | // @match *://xs.xiayige.org/* 10 | // @match *://scholar.123admin.com/* 11 | // @match *://xueshu.123admin.com/* 12 | // @match *://www.gugexueshu.com/ 13 | // @grant none 14 | // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js 15 | // ==/UserScript== 16 | 17 | (function () { 18 | 'use strict'; 19 | 20 | // 去广告 21 | $(".adsbygoogle").remove(); 22 | $("#gs_hdr_act").remove(); 23 | 24 | // 搜索栏增加logo 25 | $("#gs_hdr_lgo").append(''); 26 | $("#logo").css({"margin": "15px 0px 0px 15px"}); 27 | 28 | })(); 29 | -------------------------------------------------------------------------------- /archived/快资讯去广告.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 快资讯去广告 3 | // @namespace http://tampermonkey.net/ 4 | // @version 1.0.1 5 | // @icon https://p5.ssl.qhimg.com/t013ed96d9c4cf74064.png 6 | // @description 删除快资讯中的广告 7 | // @author CodeLumos 8 | // @homepageURL https://github.com/codelumos/tampermonkey-scripts 9 | // @match *://www.360kuai.com/* 10 | // @grant none 11 | // ==/UserScript== 12 | 13 | (function () { 14 | 'use strict'; 15 | 16 | const cycle = 1000; // 广告检测周期 17 | 18 | setInterval(function () { 19 | $("#as_shop_gg").remove(); // 主页购物广告 20 | $(".popupgg").remove(); // 详情页右下角广告 21 | $(".top-part").remove(); // 顶栏广告 22 | $("[data-ggclick='ad']").remove(); // 主页广告条目 23 | $(".g4").remove(); // 横幅广告 24 | $("[data-ggsrc]").remove(); // 详情页广告条目 25 | $(".guessgg").remove(); // 详情页购物广告 26 | $(".bkg-block").remove(); // 背景广告 27 | $(".bkg-close").remove(); // 背景广告 28 | }, cycle); 29 | })(); 30 | -------------------------------------------------------------------------------- /archived/网址导航去广告.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 网址导航去广告 3 | // @namespace http://tampermonkey.net/ 4 | // @version 2.0.2 5 | // @icon http://www.hao123.com/favicon.ico 6 | // @description 去除网址导航页面中的绝大多数广告,包括:hao123、2345网址导航、360导航、搜狗网址导航、QQ导航、UC导航、毒霸网址大全等 7 | // @author CodeLumos 8 | // @homepageURL https://github.com/codelumos/tampermonkey-scripts 9 | // @match *://www.hao123.com/* 10 | // @match *://www.2345.com/* 11 | // @match *://hao.360.com/* 12 | // @match *://123.sogou.com/* 13 | // @match *://hao.qq.com/* 14 | // @match *://daohang.qq.com/* 15 | // @match *://www.uc123.com/* 16 | // @match *://www.duba.com/* 17 | // @match *://www.newduba.cn/* 18 | // @grant none 19 | // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js 20 | // ==/UserScript== 21 | 22 | jQuery.noConflict(); 23 | (function ($) { 24 | 'use strict'; 25 | 26 | const cycle = 500; // 广告检测周期 27 | 28 | // hao123 29 | if (location.href.indexOf('hao123.com') > 0) { 30 | setInterval(function () { 31 | $("#topbeWrapper").remove(); // 顶栏广告 32 | $("#lefttip").remove(); // 左侧悬浮广告 33 | $(".rightTip").remove(); // 右下角广告 34 | $("#box-famous-resource").remove(); // 横幅广告 35 | $(".bottom-banner-link-wrapper").remove(); // 底部广告 36 | $(".wm").remove(); // 推荐栏广告 37 | }, cycle); 38 | } 39 | 40 | // 2345网址导航 41 | if (location.href.indexOf('2345.com') > 0) { 42 | setInterval(function () { 43 | $(".tip_stopXP").remove(); // 顶部浏览器推广广告 44 | $("#corner_a").remove(); // 右上角广告 45 | $("#mzBrowserWrap").remove(); // 左侧悬浮浏览器推广广告 46 | $("#J_s11_logowall_left").remove(); // 左侧背景广告 47 | $("#J_s11_logowall_right").remove(); // 右侧背景广告 48 | $("#J_gul_yg").remove(); // 中部文字广告 49 | $("h3:contains('发现你喜欢')").parent().parent().parent().remove(); // 发现你喜欢广告 50 | $("#map_shop").remove(); // 实惠购物广告 51 | $(".ad-wrap").remove(); // 内容条目广告 52 | $(".adTag").parents(".slide-item").remove(); // 右侧轮播广告 53 | $("#J_hot_event").remove(); // 右侧轮播广告 54 | $("#rightXieCheng").remove(); // 右侧悬浮广告 55 | $("#J_right_bottom_ad").remove(); // 右下角广告 56 | }, cycle); 57 | } 58 | 59 | // 360导航 60 | if (location.href.indexOf('hao.360') > 0) { 61 | setInterval(function () { 62 | $("#corner-flash").remove(); // 右上角广告 63 | $("li[notice-ad = 'true']").remove(); // 消息广告 64 | $(".notice-panel-count").text("(2)"); // 修改顶部消息数量 65 | $("#daily-hotwords").remove(); // 搜索框右侧搜索热词广告 66 | 67 | $("#hotsite-view-front").remove(); // 名站推荐广告 68 | 69 | $("#activity").remove(); // 左侧广告 70 | $(".pubble-shape-wrap").remove(); // 360游戏广告 71 | 72 | $("h3:contains('发现你喜欢')").parent().parent().remove(); // 发现你喜欢广告 73 | 74 | $("#large2small").remove(); // 右下角广告 75 | 76 | $(".js-mv-infoflow-item").remove(); // 右侧推荐条目广告 77 | $(".ad").parent().remove(); // 右侧图片条目广告 78 | $(".textlink_ad_icon").parent().remove(); //右侧文字条目广告 79 | $("a[class*='mediav-ads']").remove(); // 左侧热门视频等条目广告 80 | 81 | $(".adMark").parents(".cube-mod").remove(); // 魔方广告 82 | $(".ads-img").parents(".right-content").remove(); // 魔方内文字条目广告 83 | }, cycle); 84 | 85 | } 86 | 87 | // 搜狗网址导航、QQ导航(上网导航) 88 | if (location.href.indexOf('123.sogou.com') > 0 || location.href.indexOf('hao.qq.com') > 0 || location.href.indexOf('daohang.qq.com') > 0) { 89 | setInterval(function () { 90 | $("#sdtom").parent().remove(); // 悬浮广告 91 | $("div[id*='AD']").remove(); 92 | $(".hd-slider").remove(); // 邮箱右侧广告 93 | $(".cs_right_hw").remove(); // 搜索栏右侧广告 94 | $(".ads").remove(); // 导航栏广告 95 | $(".banner-ad").remove(); // 导航栏广告 96 | $("ul[pbflag='top3ad'] li:eq(0)").remove(); // 邮箱上方广告 97 | $("div[pbflag='guess']").remove(); // 猜你喜欢广告 98 | $("div[pbflag='rec_shop']").remove(); // 左侧购物广告 99 | $(".adword").remove(); // 文字栏广告 100 | $("div[pbflag='bt_baike']").parent().remove(); // 生活百科广告 101 | $("div[pbflag='bt_mai']").parent().remove(); // 实惠购物广告 102 | $(".tmallskin").remove(); // 网站背景广告 103 | $("div[pbflag='coolsitefeed_ad']").remove(); // 焦点条目广告 104 | $("div[pbflag='bt_newsb_ad']").remove(); // 信息流条目广告 105 | $("#wrap").remove(); // 右下角广告 106 | }, cycle); 107 | } 108 | 109 | // UC导航 110 | if (location.href.indexOf('uc123.com') > 0) { 111 | setInterval(function () { 112 | $(".header-push-container").remove(); // 顶栏广告 113 | $(".s-push-box").remove(); // 搜索栏广告 114 | $(".m-links").remove(); // 文字栏广告 115 | $(".side-hot").remove(); // 左侧广告 116 | $(".cool").remove(); // 左侧空位 117 | $("#J_shopping").remove(); // 阿里妈妈推广 118 | $("#J_shopping").remove(); // 阿里妈妈推广 119 | }, cycle); 120 | } 121 | 122 | // 毒霸网址大全 123 | if (location.href.indexOf('duba.com') > 0 || location.href.indexOf('newduba.cn') > 0) { 124 | setInterval(function () { 125 | $("#top_ad_tmall_ul").parent().remove(); // 顶部广告 126 | $("#__lawnImageContainer").remove(); // 底部广告 127 | $(".skin_bg").remove(); // 背景广告 128 | $(".m_site_ad_wrap").remove(); // 左侧栏广告 129 | $(".adTag").parents(".swiper-slide").remove(); // 右侧滚动广告 130 | $(".m_elevator.elevator_hidden").remove(); // 右侧悬浮广告 131 | $(".m_rec_game").remove(); // 右侧游戏广告 132 | // 资讯版 133 | $("#js-ysjpp").remove(); // 右上角广告 134 | $("#J_sideFooter").remove(); // 右下角广告 135 | $("div[opname='w_search_right_ad']").remove(); // 搜索栏右侧广告 136 | $(".rtcenter_game.jq_rtcenter_game").remove(); // 文字栏广告 137 | $(".fav_box_wrap").remove(); // 猜你喜欢广告 138 | $(".side_game").remove(); // 左侧游戏广告 139 | $(".side_taobao").remove(); // 左侧购物广告 140 | $(".left_ad_collection").remove(); // 左侧热点排行广告 141 | $(".jqrp_infoflow_ad").remove(); // 信息流条目广告 142 | // 标准版 143 | $(".top_func_ad").remove(); // 右上角广告 144 | $(".fav_box").remove(); // 猜你喜欢广告 145 | $(".taobao_search").remove(); // 购物广告 146 | $(".sort_wm").remove(); // 猜你感兴趣广告 147 | $(".sort_line").remove(); 148 | $(".box_shopping").remove(); // 热门购物广告 149 | $(".box_happy").remove(); // 休闲娱乐广告 150 | $(".tj_ul").remove(); // 邮箱上方广告 151 | $(".ads-tag").parent().parent().parent().remove(); // 热点新闻广告 152 | $(".newslist > div").remove(); // 信息流条目广告 153 | // 精简版 154 | $(".mediavAd").remove(); // 信息流条目广告 155 | }, cycle); 156 | } 157 | 158 | })(jQuery); -------------------------------------------------------------------------------- /scripts/360搜索去广告.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 360搜索去广告 3 | // @namespace http://tampermonkey.net/ 4 | // @version 2.2.1 5 | // @icon https://www.so.com/favicon.ico 6 | // @description 去除360搜索结果和页面中的绝大多数广告,包括:360搜索、360资讯、360问答、360百科、360导航等 7 | // @author CodeLumos 8 | // @homepageURL https://github.com/codelumos/tampermonkey-scripts 9 | // @match *://*.so.com/* 10 | // @match *://*.360kan.com/* 11 | // @match *://*.360kuai.com/* 12 | // @match *://*.66health.net/* 13 | // @match *://hao.360.com/* 14 | // @match *://*.hao.360.cn/* 15 | // @grant GM_addStyle 16 | // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js 17 | // ==/UserScript== 18 | 19 | const dom = {}; 20 | dom.query = jQuery.noConflict(true); 21 | dom.query(document).ready(function ($) { 22 | 'use strict'; 23 | 24 | const detection_cycle = 500; 25 | const cycle_callbacks = []; 26 | const {hostname, pathname} = location; 27 | 28 | function no_display(item) { 29 | const no_display_css = item + " {display: none;}"; 30 | GM_addStyle(no_display_css); 31 | } 32 | 33 | switch (hostname.split(".")[0]) { 34 | case "www": 35 | switch (hostname.split(".")[1]) { 36 | // 360搜索 37 | case "so": 38 | no_display("#so_bd-ad"); // 右侧栏广告 39 | no_display(".res-mediav-right"); // 右侧栏广告 40 | no_display("#lm-rightbottom"); // 猜你想搜 41 | no_display(".e-buss"); // 条目广告 42 | no_display("div[id*='--normal']"); // 文字广告 43 | no_display("[class*='business']"); // 魔盒条目广告 44 | no_display("#mohe-webgame"); // 360爱玩魔盒 45 | no_display(".mh-sdk-sad"); // 相关消息广告 46 | cycle_callbacks.push(function () { 47 | $(".sad").remove(); // 热点条目广告 48 | $(".lawnfooter-image__panel").remove(); // 底部遮罩广告 49 | 50 | $("[class*='res-mediav']").remove(); // 条目广告 51 | }); 52 | break; 53 | 54 | // 快资讯 55 | case "360kuai": 56 | no_display("[data-ggclick='ad']"); // 条目广告 57 | no_display("#as_shop_gg"); // 右侧栏广告 58 | no_display(".flowcardtype--onepicbig"); // 条目广告 59 | 60 | no_display(".footer-wrapper"); // 右下角广告 61 | no_display(".g4"); // 横幅广告 62 | no_display(".detail--v3"); // 右侧推荐广告 63 | no_display(".recommend-article__wrapper"); // 推荐文章 64 | no_display(".article__content__textgg"); // 文章中文字广告 65 | 66 | no_display(".video__gg"); // 右侧推荐广告 67 | no_display(".videogg--card"); // 大块广告 68 | cycle_callbacks.push(function () { 69 | $(".detail--v3").remove(); // 右侧推荐广告 70 | $(".cc-pause-gg").remove(); // 视频暂停广告 71 | }); 72 | break; 73 | 74 | // 360影视 75 | case "360kan": 76 | no_display(".rt-btm-popup_ad"); // 右下角广告 77 | no_display(".info-flow__ad"); // 横幅广告 78 | no_display("#detail-ad"); // 右侧栏广告 79 | break; 80 | } 81 | break; 82 | 83 | // 360资讯 84 | case "news": 85 | no_display("[data-from='ad']"); // 条目广告 86 | no_display("[data-from='mediav']"); // 条目广告 87 | no_display(".info-stream"); // 智能推荐 88 | 89 | cycle_callbacks.push(function () { 90 | $("#sd-lm").remove(); // 右侧栏猜你想搜 91 | }); 92 | break; 93 | 94 | // 360问答 95 | case "wenda": { 96 | no_display("#js-mod-fixed-float"); // 右下角广告 97 | no_display("#e_idea_wenda_leftBox"); // 条目广告 98 | no_display(".js-busi-item"); // 条目广告 99 | no_display("#mediaV"); // 右侧栏广告 100 | no_display(".js-right-busi"); // 右侧栏广告 101 | 102 | no_display(".js-left-flow-busi"); // 左侧栏广告 103 | no_display(".js-left-rec-busi"); // 左侧栏广告 104 | no_display(".js-answer-adv-part"); // 伪回答广告 105 | no_display("#attention"); // 猜你关注 106 | no_display("#detail-guess-wrap"); // 您可能感兴趣的内容 107 | $(".js-mod-flow").remove(); // 今日热点 108 | // 将问答主体移动至左侧 109 | let wenda_main = $(".js-detail-main"); 110 | wenda_main.removeClass("fr"); 111 | wenda_main.addClass("fl"); 112 | wenda_main.css("padding-left", "40px"); 113 | wenda_main.css("padding-right", "40px"); 114 | break; 115 | } 116 | 117 | // 360视频(360kan) 118 | case "tv": 119 | case "video": 120 | no_display("[data-so-mod='list-ad']"); // 条目广告 121 | no_display(".p-searchad-wrap"); // 文字广告 122 | break; 123 | 124 | // 360图片 125 | case "image": 126 | no_display(".starlist"); // 横幅广告 127 | no_display(".item_cm"); // 条目广告 128 | cycle_callbacks.push(function () { 129 | $("[data-id*='cm_extended_init']").remove(); // 条目广告 130 | $("[data-id*='cm_display_init']").remove(); // 条目广告 131 | $("[data-id*='JumpAds']").remove(); // 条目广告 132 | }); 133 | break; 134 | 135 | // 360良医 136 | case "ly": 137 | $("#news-card").remove(); // 热门资讯推荐 138 | $(".so-biz-ad-title").remove(); // 猜你想搜 139 | $("#lm-rightbottom").remove(); // 猜你想搜 140 | break; 141 | 142 | // 360地图 143 | case "ditu": 144 | no_display("[data-list-business-item='true']"); // 条目广告 145 | no_display("[class*='index-bottomBsCon']"); // 条目广告 146 | no_display("[class*='Ad']"); // 疫情广告 147 | break; 148 | 149 | // 360百科 150 | case "baike": 151 | no_display(".mod-side-busi"); // 右侧栏广告 152 | 153 | $("[id*='J-mod-right-ad']").remove(); // 右侧栏广告 154 | $("#J-mod-right-recommend").remove(); // 为您推荐 155 | no_display("#rightbanner"); // 右侧栏广告 156 | no_display(".entry-belong"); // 搜索发现 157 | no_display(".entry-plus"); // 热点资讯 158 | // 自动展开 159 | $(".entry-detail-fold-part").removeAttr("style"); 160 | no_display(".entry-detail-fold-switch"); 161 | break; 162 | 163 | // 360国学 164 | case "guoxue": 165 | $(".rtInterest").remove(); // 猜你感兴趣 166 | $(".rtAttention").remove(); // 猜你关注 167 | no_display(".js-fixed-rt"); // 右侧栏广告 168 | $("#interest-wrap").remove(); // 您可能感兴趣的内容 169 | no_display(".lm-bottom-container"); // 底部广告 170 | // 自动展开 171 | $("#content-area").removeClass("folded"); 172 | break; 173 | 174 | // 360文库 175 | case "wenku": 176 | no_display("#e_idea_wenda_leftBox"); // 条目广告 177 | no_display("#js-fixed-rt"); // 右侧栏广告 178 | 179 | no_display(".fixed-rtbot"); // 右下角广告 180 | no_display(".page-busi"); // 页面间广告 181 | $("#interest").remove(); // 您可能感兴趣的内容 182 | $(".side-mod").remove(); // 今日热点 183 | $(".infoFlow").remove(); // 今日热点 184 | break; 185 | 186 | // 360翻译 187 | case "fanyi": 188 | no_display("#card_container"); // 热点推荐 189 | break; 190 | } 191 | 192 | // 放心健康 193 | if (location.href.indexOf("66health.net") > 0) { 194 | no_display(".hot-recom"); // 右侧栏广告 195 | no_display("._sab5d05j0v"); // 右侧栏广告 196 | $("._qjos0wqy38").remove(); // 搜索推荐广告 197 | } 198 | 199 | // 360导航 200 | if (location.href.indexOf("hao.360.com") > 0) { 201 | $("#daily-hotwords").remove(); // 顶栏广告 202 | $("#activity").remove(); // 左侧栏广告 203 | $(".plane-priming").remove(); // 右侧栏广告 204 | no_display("#large2small"); // 右下角广告 205 | $(".qihoobannerslider").remove(); // 横幅广告 206 | cycle_callbacks.push(function () { 207 | $("[class*='festival']").remove(); // 遮罩广告 208 | $("._CUBE_A_D_CLK_").remove(); // cube广告 209 | // 删除cube广告占位 210 | $(".ad-text").parents(".bottom-line-wrap").remove(); // cube文字广告 211 | $("img[src='https://hao1.qhimg.com/dmfd/50_20_/t0196473cd73c354bfb.png']").parents(".item").remove(); // cube文字广告 212 | $(".ad-flag").parents(".cube-mod").remove(); // cube广告 213 | $("img[src='https://hao3.qhimg.com/t0135fb514cb52505c4.png']").parents(".cube-mod").remove(); // cube广告 214 | $("#cube-mod-haocube-QVd9iAfg4N0").remove(); // 旋转视界 215 | $(".feed-atlas").remove(); // 热点广告 216 | $(".feed-mv").remove(); // 热点广告 217 | }); 218 | } 219 | if (location.href.indexOf("hao.360.cn") > 0) { 220 | no_display(".ads-goods"); // 右侧栏广告 221 | no_display(".feed-ads"); // 右侧栏广告 222 | no_display(".js-sticky"); // 右侧栏广告 223 | } 224 | 225 | if (!cycle_callbacks.length) { 226 | return; 227 | } 228 | 229 | cycle_callbacks.forEach(f => f()); 230 | setInterval(() => cycle_callbacks.forEach(f => f()), detection_cycle); 231 | }); -------------------------------------------------------------------------------- /scripts/bimi动漫优化.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name bimi动漫优化 3 | // @namespace http://tampermonkey.net/ 4 | // @version 2.3 5 | // @icon https://www.bimiacg5.net/favicon.ico 6 | // @description bimi动漫(M站)去广告以及一些其他优化 7 | // @author CodeLumos 8 | // @homepageURL https://github.com/codelumos/tampermonkey-scripts 9 | // @match *://*.dodoge.me/* 10 | // @match *://*.bimiacg.net/* 11 | // @match *://*.bimiacg4.net/* 12 | // @match *://*.bimiacg5.net/* 13 | // @grant GM_addStyle 14 | // ==/UserScript== 15 | 16 | (function () { 17 | 'use strict'; 18 | 19 | // 去广告 20 | GM_addStyle("#HMcoupletDivleft {display: none;}"); // 左侧悬浮广告 21 | GM_addStyle("#HMcoupletDivright {display: none;}"); // 右侧悬浮广告 22 | GM_addStyle(".tuiguang {display: none;}"); // 横幅广告 23 | setInterval(function () { 24 | $("#HMRichBox").remove(); // 右下角广告 25 | $("iframe").contents().find("#adv_wrap_hh").remove(); // 播放器暂停广告 26 | }, 500); 27 | 28 | // 允许选中和右键 29 | document.oncontextmenu = function () { 30 | return true; 31 | }; 32 | document.onselectstart = function () { 33 | return true; 34 | }; 35 | 36 | // 还原鼠标样式 37 | document.body.style.cursor = "default"; 38 | $("a").hover(function () { 39 | $("a").css("cursor", "pointer"); 40 | }) 41 | 42 | // 删除伪搜索历史框 43 | $(".search-history").remove(); 44 | 45 | // 调整导航栏二级菜单的层级和宽度,避免被关灯按钮遮挡并变为竖排 46 | $(".wrapper > ul > li > ul").css({"z-index": "999", "width": "130"}); 47 | 48 | // 对齐提示条 49 | $("div[style]").each(function () { 50 | if ($(this).css("width") === "1155px") { 51 | $(this).css({"width": "1190px", "margin-left": "", "margin-right": ""}); 52 | } 53 | }) 54 | 55 | // 删除APP推荐遮罩层 56 | $("#bkcl").remove(); 57 | 58 | })(); -------------------------------------------------------------------------------- /scripts/百度系网站去广告.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 百度系网站去广告 3 | // @namespace http://tampermonkey.net/ 4 | // @version 5.4 5 | // @icon https://www.baidu.com/favicon.ico 6 | // @description 去除百度搜索结果和页面中的绝大多数广告,包括:百度搜索、百度百科、百度知道、百度文库、百度贴吧等 7 | // @author CodeLumos 8 | // @homepageURL https://github.com/codelumos/tampermonkey-scripts 9 | // @match *://*.baidu.com/* 10 | // @run-at document-start 11 | // @grant GM_addStyle 12 | // @grant GM_getValue 13 | // @grant GM_setValue 14 | // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js 15 | // ==/UserScript== 16 | 17 | const dom = {}; 18 | dom.query = jQuery.noConflict(true); 19 | dom.query(document).ready(function ($) { 20 | 'use strict'; 21 | 22 | const detection_cycle = 500; 23 | const cycle_callbacks = []; 24 | const {hostname, pathname} = location; 25 | 26 | function no_display(item) { 27 | const no_display_css = item + " {display: none;}"; 28 | GM_addStyle(no_display_css); 29 | } 30 | 31 | function add_sidebar_switcher(item) { 32 | if (!document.querySelector(item) || document.querySelector("#sidebar_switcher")) { 33 | return; 34 | } 35 | $(item).before(""); 36 | $("#sidebar_switcher").append(""); 37 | let show_sidebar = GM_getValue("show_sidebar", false); 38 | if (show_sidebar) { 39 | $("#sidebar-btn").html("隐藏"); 40 | } else { 41 | $(item).css("display", "none"); 42 | } 43 | document.querySelector("#sidebar-btn").addEventListener("click", function () { 44 | return change_sidebar_status(item); 45 | }, true); 46 | } 47 | 48 | function change_sidebar_status(item) { 49 | let show_sidebar = GM_getValue("show_sidebar", false); 50 | if (show_sidebar) { 51 | GM_setValue("show_sidebar", false); 52 | $(item).css("display", "none"); 53 | $("#sidebar-btn").html("显示"); 54 | } else { 55 | GM_setValue("show_sidebar", true); 56 | $(item).css("display", ""); 57 | $("#sidebar-btn").html("隐藏"); 58 | } 59 | } 60 | 61 | function anti_ad_baidu() { 62 | add_sidebar_switcher("#content_right"); 63 | // 百度视频搜索 64 | if (pathname.startsWith("/sf/vsearch")) { 65 | no_display(".ecom_pingzhuan"); // 品牌广告 66 | no_display("div[id*='_canvas']"); // 品牌广告 67 | } else { 68 | // 百度搜索 69 | no_display("[tpl='feed-ad']"); // 资讯条目广告 70 | 71 | no_display("#top-ad"); // 超级品牌 72 | no_display(".ec-pc_comp_banner_cc_float_video-fwc"); // 品牌视频广告 73 | no_display("[tpl='sp_hot_sale']"); // 全网热卖 74 | no_display("[tpl='short_video']"); // 视频大全 75 | no_display("[tpl='sp_rank']"); // 单品榜 76 | no_display("[tpl*='game-page']"); // 百度游戏 77 | no_display("[tpl*='b2b_prod']"); // 百度爱采购 78 | no_display(".pc-btn-des"); // 安全下载提示文字 79 | // 右侧栏广告 80 | $("#content_right > div").each(function () { 81 | if ($(this).attr("id") === undefined) { 82 | $(this).css("display", "none"); 83 | } 84 | }); 85 | // 条目广告 86 | $("#content_left > div").each(function () { 87 | if ($(this).attr("id") === undefined && $(this).attr("class") === undefined) { 88 | $(this).css("display", "none"); 89 | } 90 | }); 91 | 92 | $("span").each(function () { 93 | // 将官网移动为第一条搜索结果 94 | if ($(this).hasClass("c-text-blue")) { 95 | $("#content_left").prepend($(this).parents(".result")); 96 | } 97 | // 去除“安全下载”按钮 98 | else if ($(this)[0].innerHTML === "安全下载") { 99 | $(this).parent().css("display", "none"); 100 | } else if ($(this)[0].innerHTML === " 普通下载 ") { 101 | $(this).html("下载"); 102 | $(this).addClass("c-btn-primary"); 103 | $(this).css("margin-left", "0px"); 104 | } 105 | }); 106 | 107 | // 百度资讯搜索 108 | no_display(".ecom_pingzhuan"); // 品牌广告 109 | // 延迟出现条目广告 110 | $("a").each(function () { 111 | if ($(this)[0].innerHTML === "广告") { 112 | $(this).parents(".result").remove(); 113 | } 114 | }); 115 | } 116 | } 117 | 118 | switch (hostname.split(".")[0]) { 119 | // 百度搜索 120 | case "www": 121 | anti_ad_baidu(); 122 | cycle_callbacks.push(function () { 123 | anti_ad_baidu(); 124 | }); 125 | break; 126 | 127 | // 百度百科 128 | case "baike": 129 | no_display(".J-search-ad"); // 条目广告 130 | 131 | $("#side_box_unionAd").remove(); // 品牌广告 132 | no_display(".bottom-recommend-wrapper"); // 猜你喜欢 133 | break; 134 | 135 | // 百度知道 136 | case "zhidao": 137 | no_display("div[id*='_canvas']"); // 右侧栏广告 138 | no_display(".leftup"); // 品牌广告 139 | no_display(".bannerdown"); // 条目广告 140 | 141 | no_display("#qb-side"); // 右侧栏 142 | no_display(".task-list-button"); // 右侧任务 143 | $("#answer-bar").removeClass("exp-answerbtn-yh"); // 有奖图标 144 | $(".new-icon").remove(); // 商城new图标 145 | $(".phone-icon").remove(); // 手机答题图标 146 | no_display(".question-number-text-chain"); // 话题广告 147 | no_display("#knowledge-answer"); // 回答广告 148 | no_display(".wgt-ads"); // 回答广告 149 | no_display(".businessvip-wrapper"); // 官方服务 150 | no_display("#qbleftdown-container"); // 可能关注的内容 151 | no_display(".wgt-bottom-union"); // 为你推荐 152 | cycle_callbacks.push(function () { 153 | // 回答自动展开 154 | $("div[id*='target-content']").removeAttr("style"); 155 | $(".wgt-target-mask").css("display", "none"); 156 | $("div[id*='best-content']").removeAttr("style"); 157 | $(".wgt-best-mask").css("display", "none"); 158 | $("div[id*='answer-content']").removeAttr("style"); 159 | $(".wgt-answers-mask").css("display", "none"); 160 | }); 161 | break; 162 | 163 | // 百度文库 164 | case "wenku": 165 | add_sidebar_switcher(".base-layout-content-wrap"); 166 | no_display(".adlist-wrap"); // 右侧栏广告 167 | no_display(".fc-product-result-wrap"); // 品牌广告 168 | no_display(".fc-first-result-wrap"); // 条目广告 169 | no_display(".vip-guide-test"); // 末尾VIP广告 170 | no_display(".fc-result-container"); // 条目广告 171 | 172 | no_display(".vip-activity-wrap-new"); // 顶栏VIP广告 173 | no_display(".vip-privilege-card-wrap"); // 右侧栏VIP广告 174 | no_display(".vip-pay-pop-v2-wrap"); // 末尾VIP广告 175 | no_display(".inner-vip"); // 下载按钮VIP广告 176 | no_display(".vip-layer-inner"); // 下载按钮VIP广告 177 | no_display(".fold-page-tip"); // 下载按钮VIP广告 178 | no_display(".hx-right-wrapper"); // 相关资源广告 179 | no_display(".vip-member-pop-content"); // 底部遮罩VIP广告 180 | cycle_callbacks.push(function () { 181 | $(".user-vip").remove(); // 顶栏VIP广告 182 | $(".xpage-special-card-wrap").remove(); // 条目广告 183 | 184 | $(".hx-warp").remove(); // 页面间广告 185 | $(".hx-recom-wrapper").remove(); // 末尾广告 186 | $(".content-wrap").remove(); // 末尾广告 187 | $(".hx-bottom-wrapper").remove(); // 你可能关注的内容 188 | }); 189 | break; 190 | 191 | // 百度图片 192 | case "image": 193 | no_display("#pnlBeforeContent"); // 品牌广告 194 | no_display(".newfcImgli"); // 条目广告 195 | break; 196 | 197 | // 百度贴吧 198 | case "tieba": 199 | no_display("div[id*='aside_ad']"); // 右侧栏广告 200 | no_display("div[id*='aside-ad']"); // 右侧栏广告 201 | no_display("div[id*='mediago-tb']"); // 条目广告 202 | no_display(".fengchao-wrap-feed"); // 条目广告 203 | no_display(".bus-top-activity-wrap"); 204 | no_display("div[.thread_item_box]"); // 条目广告 205 | if ($("#plat_recom_carousel").length > 0) { 206 | no_display("#plat_recom_carousel"); 207 | GM_addStyle(".head_main {margin-top:2cm;}"); 208 | } 209 | cycle_callbacks.push(function () { 210 | $(".tb_poster_placeholder").remove(); // 文本框超级会员广告 211 | }); 212 | break; 213 | 214 | // 百度地图 215 | case "map": 216 | cycle_callbacks.push(function () { 217 | $(".damoce-search-item-nopoi").remove(); // 条目广告 218 | $(".leadDownloadCard").remove(); // 百度地图APP广告 219 | $("#activity-banner-panel").remove(); // 百度地图APP广告 220 | }); 221 | break; 222 | 223 | // 百度经验 224 | case "jingyan": 225 | no_display(".ec_ad"); // 条目广告 226 | 227 | no_display(".right-fixed-related-wrap"); // 右侧栏广告 228 | no_display("#bottom-ads-container"); // 底部广告 229 | no_display("#bottom-pic-ads-wrap"); // 底部广告 230 | break; 231 | 232 | // 百度翻译 233 | case "fanyi": 234 | no_display(".vip-btn"); // 顶栏VIP广告 235 | no_display("#transOtherRight"); // 右侧广告 236 | no_display("#app-read"); // 百度翻译APP广告 237 | break; 238 | 239 | // 百度网盘 240 | case "pan": 241 | $("[node-type=header-union]").remove(); // 顶栏广告 242 | no_display(".phone-banner"); // 资源链接底部广告 243 | no_display("#web-single-bottom"); // 资源下载底部广告 244 | no_display("#web-multi-bottom"); // 资源下载底部广告 245 | no_display("#web-right-view"); // 资源下载右侧广告 246 | break; 247 | 248 | // 一刻相册 249 | case "photo": 250 | no_display(".yk-header__link"); // 顶栏广告 251 | $(".yk-side__footer").remove(); // 左侧栏广告 252 | break; 253 | 254 | // 百度游戏 255 | case "wan": 256 | no_display(".game-home-accover-box"); // 全屏遮罩广告 257 | no_display(".extra"); // 侧边广告 258 | break; 259 | 260 | // 百度爱采购 261 | case "b2b": 262 | no_display(".gg-content"); // 右侧广告 263 | break; 264 | 265 | // 百度宝宝知道 266 | case "baobao": 267 | no_display(".bottom_back"); // 底部遮罩广告 268 | no_display(".wgt-ads"); // 右侧栏广告 269 | no_display(".gold-plan"); // 顶栏广告 270 | 271 | no_display(".circle-right-word"); // 社区右侧栏广告 272 | break; 273 | 274 | // 好看视频 275 | case "haokan": 276 | no_display(".landrightbanner"); // 右侧栏广告 277 | no_display(".land-recommend-ad"); // 播放列表广告 278 | no_display(".player-pause-code"); // 暂停广告 279 | break; 280 | 281 | // 百度视频 282 | case "v": 283 | case "vedio": 284 | no_display("#sidebarADRightWrap"); // 两侧悬浮广告 285 | $("#qzfcadid").remove(); // 两侧悬浮广告 286 | no_display("[id*='adframe_wrap']"); // 横幅广告 287 | no_display(".section-ad"); // 横幅广告 288 | no_display("[id*='FeedAdSys']"); // 热门推荐广告 289 | 290 | no_display("#pallcommoncolumnad"); // 顶栏广告 291 | no_display("#playerRightInnerList"); // 相关视频广告 292 | cycle_callbacks.push(function () { 293 | // 条目广告 294 | $("div[id*='pc']").remove(); 295 | $("div[id*='PC']").remove(); 296 | }); 297 | break; 298 | } 299 | 300 | if (!cycle_callbacks.length) { 301 | return; 302 | } 303 | 304 | cycle_callbacks.forEach(f => f()); 305 | setInterval(() => cycle_callbacks.forEach(f => f()), detection_cycle); 306 | }); -------------------------------------------------------------------------------- /scripts/问卷星允许选中复制.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 问卷星允许选中复制 3 | // @namespace http://tampermonkey.net/ 4 | // @version 0.2.1 5 | // @icon https://www.wjx.cn/favicon.ico 6 | // @description 解除问卷星对选中和右键的限制 7 | // @author CodeLumos 8 | // @homepageURL https://github.com/codelumos/tampermonkey-scripts 9 | // @match *://*.wjx.cn/* 10 | // @match *://*.wjx.top/* 11 | // @grant none 12 | // ==/UserScript== 13 | 14 | (function () { 15 | 'use strict'; 16 | 17 | document.oncontextmenu = function () { 18 | return true; 19 | }; 20 | document.onselectstart = function () { 21 | return true; 22 | }; 23 | $("body").css("user-select", "text"); 24 | 25 | })(); 26 | --------------------------------------------------------------------------------