Greasy Fork

Greasy Fork is available in English.

贴吧手机版

try to take over the world!

当前为 2024-10-23 提交的版本,查看 最新版本

// ==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

// ==/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 = `

.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;}

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:#8cdec5;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;}
.threadlist_text{font-size:14px;color:#777;    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-btn-image,.next_step{display:block;width:20px;height:20px;background:#aaa;}

.l_post{
    display: flex;
    flex-direction: row;
}
.BDE_Image{width:auto!important;}
.l_post .d_author{display:block;width:60px;font-size:14px;}

`;

$('link[rel="stylesheet"], style').remove();
GM_addStyle(mycss2);







// 每 2 秒执行一次
setInterval(function() {
    // 查找内容为 "广告" 的 span
    $('span').filter(function() {
        return $(this).text().trim() === '广告'; // 过滤出内容为 "广告" 的 span
    }).each(function() {
        // 隐藏其父级的父级
        $(this).parent().parent().remove();
    });

$('video[autoplay]').each(function() {
    $(this).removeAttr('autoplay'); // 移除 autoplay 属性
});

}, 2000); // 2000 毫秒 = 2 秒

})();