// ==UserScript== // @name 贴吧手机版 // @namespace http://tampermonkey.net/ // @version 1.1 // @description try to take over the world! // @author You // @match https://tieba.baidu.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=baidu.com // @grant GM_addStyle // @downloadURL none // ==/UserScript== function viewport() { if (document.querySelector('meta[name="viewport"]')) { return; } const el = document.createElement("meta"); el.name = "viewport"; el.content = "width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"; document.head.append(el); } (function() { 'use strict'; // Your code here... viewport(); var mycss2 = ` .dialogJmodal,.tbshare_popup_wrapper,.ui_bubble_wrap,.footer,.homeworks_guide,.tbui_aside_smiley,.ip-location,.p_mtail,.lzl_more,.replace_tip,.poster_head,.d_badge_title,.d_badge_lv,.tail-info,.threadlist_detail>.threadlist_author,.head_content,.share_btn_wrapper,.icon-jubao,.user-hide-post-down,.right_section,.suggestion_list,.search_top,#fixed_bar,.aside,.nav_wrap,.userbar,.card_banner,.card_top_wrap{display:none!important;} ul,li{list-style-type:none;padding:0px;margin:0;} .aaaa{padding:0px!important;margin:0!important;width:auto!important;margin:0!important;} .search_ipt{width:200px!important;} #thread_list{padding:0px;} .threadlist_author{float:right;font-size:14px;color:#777!important;} .threadlist_author a{font-size:14px;color:#777!important;} .threadlist_media li,.col2_left{float:left;} .threadlist_rep_num{background:#ffe1a9;padding:0 5px;margin-right:5px;font-size:14px;} .j_thread_list{background:#fff;overflow:hidden;margin:0 0 10px 0;} .j_thread_list a{text-decoration:none;color:#222;} .threadlist_text{font-size:14px;color:#999; height: 50px; overflow: hidden;} .d_post_content_main{display:block;} .d_post_content img{max-width:300px;height:auto;} .core_reply_content{background:#eee;margin-left:20px;padding:5px 10px;font-size:14px!important;} .core_reply_content .j_user_card img{display:none;} .p_author img{width:50px;height:auto;} .lzl_jb{width:0;height:0;} .p_author{float:left;} .l_post{background:#fff;overflow:hidden;border-bottom: 1px solid #aaa;margin: 10px 0;} .post-tail-wrap,.post-tail-wrap a{font-size:14px;color:#aaa;} #ueditor_replace,.edui-container{width:300px!important;border:1px solid;} /* 插入图片相关 */ .edui-popup{display:block;background:#fff;} .edui-btn-image{display:block;width:20px;height:20px;background:#aaa;} .next_step{display:block;width:100px;height:20px;background:#aaa;} .slide_item{float:left;} .j_ok { position: fixed; /* 设置为固定定位 */ left: 0; /* 距离左边 0 像素 */ bottom: 0; /* 距离底部 0 像素 */ background-color: rgba(0, 0, 0, 0.7); /* 背景颜色 */ color: white; /* 字体颜色 */ padding: 10px; /* 内边距 */ } .i_item_bg{width:60px;height:60px;} .flash_editor_container,.error{display:none;} /* reply 回复楼中楼 */ .core_reply_content ul { height:100px; /* 鼠标悬停时显示内容 */ } .core_reply_content:hover ul { height:auto; /* 鼠标悬停时显示内容 */ } .core_reply_tail{clear:both; display: block; overflow: hidden;} .post-tail-wrap span{float:left;} video{display:none;} .l_post{ display: flex; flex-direction: row; } .BDE_Image{width:auto!important;} .l_post .d_author{display:block;width:60px;font-size:14px;} .test{background:#0f0;} `; $('link[rel="stylesheet"], style').remove(); GM_addStyle(mycss2); // 每 2 秒执行一次 setInterval(function() { // 插入图片相关 $('html').css({ 'overflow': '', // 清除 overflow 样式 'padding-right': '' // 清除 padding-right 样式 }); $('.dialogJfix').css({ 'position': 'fixed', // 清除 overflow 样式 'background': '#fff' // 清除 padding-right 样式 }); // 查找内容为 "广告" 的 span $('span').filter(function() { return $(this).text().trim() === '广告'; }).each(function() { $(this).parent().html('ad1'); }); $('video').remove(); $('#thread_list>div').remove(); $('.p_postlist').children().not('.l_post, .p_postlist').html('ad2'); }, 2000); })();