您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
去除广告,隐藏帖子,移除悬浮图标
当前为
// ==UserScript== // @name 贴吧触屏版改进 // @description 去除广告,隐藏帖子,移除悬浮图标 // @include http://tieba.baidu.com/* // @author yechenyin // @version 0.31 // @namespace https://gf.qytechs.cn/users/3586-yechenyin // ==/UserScript== /****************************************************/ //默认刷新后“显示隐藏帖子”开关恢复关闭状态,保持不显示隐藏帖子 //如果想保存“显示隐藏帖子”开关的设置,请将true改为false var keep_hiding = true; //广告 var ads = [ "a.client_ghost_icon", "div#cproIframe1Wrap", "ul.threads_list>div.tl_gap", "a.light_see_index", "div.forum_recommend_w", "div.first_floor_ad_wrapper", "div#cproIframe2Wrap", "div.client_ad_top", "ul.threads_list>li.tl_spread", "li.special"]; /****************************************************/ if (location.href.search("http://tieba.baidu.com/f?") == 0 && $("ul.threads_list>li.tl_spread")[0] !== undefined) { for (i=0; i<ads.length; i++) if ($(ads[i])[0] !== undefined) $(ads[i]).remove(); $("ul.threads_list>div.tl_gap").hide(); if (localStorage.display_hidden_threads === undefined || localStorage.display_hidden_threads == "false") { $("li.tl_shadow>a").map(function() { if (localStorage.hidden_threads && localStorage.hidden_threads.search($(this).attr("tid")) >= 0) $(this).parent().hide(); }); } $("div.ti_author_time").map(function () { var zan_btn = $(this).next().children().eq(0).children().eq(0); zan_btn.css({left:"auto", float:"right", display:"inline", position:"relative", marginRight:-1, marginTop:-1}); var zan_num = $(this).next().children().eq(0).children().eq(1); zan_num.addClass("ti_func_btn"); zan_num.css({left:"auto", float:"right", width:"auto", marginTop:-1, marginRight:12, display:"inline"}); var reply = $(this).next().children().eq(2); reply.css({left:"auto", float:"right", width:"auto", marginTop:-1, marginRight:8, display:"inline"}); var hide = $("<a>", {class:"ti_func_btn", text:"隐藏"}); hide.css({float:"right", width:30, marginTop:-1, marginRight:2, display:"inline"}); hide.click(toggle_thread); $(this).append(hide, reply, zan_num, zan_btn); $(this).next().remove(); $(this).insertAfter($(this).parent()); }); $("div.light_post_entrance").addClass("icon_btn blue_kit_icon new_frs_sprite_icons blue_kit_icon_post"); $("div.light_post_entrance").css({left:"auto", right:90, bottom:"auto", top:1, "z-index":1000}); var my_message = $("<a>", {class:"mode_setup_message_title", text:"我的消息", href:"http://tieba.baidu.com/mo/q/msg"}); $(".mode_setup_message_title").replaceWith(my_message); var bawu = $("div.blue_kit_right>a[href*='bawuindex']").removeClass().addClass("mode_setup_message_title"); bawu.css({position:"absolute", right:9}); bawu.insertBefore($(".person_info_content")); //$("span.info_look").css({marginRight:15}); var display_hidden_threads = $("ul.mode_setup_list>li:nth-child(2)").clone(); display_hidden_threads.contents().filter(function() { return this.nodeType == 3; }).replaceWith("显示隐藏帖子"); if (localStorage.display_hidden_threads === undefined || localStorage.display_hidden_threads == "false") { display_hidden_threads.children().eq(1).removeClass().addClass("mode_setup_switch switch_off"); } else { display_hidden_threads.children().eq(1).removeClass().addClass("mode_setup_switch switch_on"); } display_hidden_threads.children().eq(1).click(display_hidden_switch); $("ul.mode_setup_list").append(display_hidden_threads); } if (location.href.search("http://tieba.baidu.com/p/") == 0 && $("#pblist li.tl_spread")[0] !== undefined) { for (i=0; i<ads.length; i++) if ($(ads[i])[0] !== undefined) $(ads[i]).remove(); $("div.zan_reply").css({position: "relative", border:"none", zIndex:1}).appendTo($("#pblist>li:first-child")); $("#j_ghost_tool_share").removeClass().addClass("spinner_item pb_icon").css("background-position", "6px -562px").wrap("<li></li>").appendTo($("ul.more_spinner")); //$("#j_ghost_tool_refresh").removeClass().addClass("spinner_item pb_icon").css("background-position", "6px -682px").wrap("<li></li>").appendTo($("ul.more_spinner")); $("div#j_ghost").hide(); } function toggle_thread() { if($(this).text() == "隐藏") { $(this).parent().parent().hide(); $(this).text("显示"); this.parentNode.parentNode.style.display = "none"; if (localStorage.hidden_threads === undefined) localStorage.hidden_threads = ""; localStorage.hidden_threads += $(this).parent().prev().attr("tid") + " "; } else if($(this).text() == "显示") { $(this).text("隐藏"); $(this).parent().parent().show(); var hidden_threads = localStorage.hidden_threads; localStorage.hidden_threads = hidden_threads.replace($(this).parent().prev().attr("tid")+" ", ""); } } function display_hidden_switch() { if (this.className.match("switch_off")) { $("li.tl_shadow>a").map(function() { if (localStorage.hidden_threads.search($(this).attr("tid")) >= 0) { $(this).next().children().eq(2).text("显示"); $(this).parent().show(); } }); if (!keep_hiding) { localStorage.display_hidden_threads = "true"; } $(this).removeClass("switch_on").removeClass("switch_off").addClass("switch_on"); } else { $("li.tl_shadow>a").map(function() { if (localStorage.hidden_threads.search($(this).attr("tid")) >= 0) { $(this).next().children().eq(2).text("显示"); $(this).parent().hide(); } }); localStorage.display_hidden_threads = "false"; $(this).removeClass("switch_on").removeClass("switch_off").addClass("switch_off"); } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址