// ==UserScript== // @name 百度贴吧-宽版 // @namespace http://tampermonkey.net/ // @version 0.6.4 // @description 隐藏侧边栏,拓宽贴子的显示宽度,图片变得更清晰,贴吧链接不跳转直接打开,移动版页面自动跳转为PC版 // @author AN drew // @match *://tieba.baidu.com/* // @require https://lib.baomitu.com/jquery/3.5.0/jquery.min.js // @grant GM_addStyle // @run-at document-start // @downloadURL none // ==/UserScript== (function() { 'use strict'; GM_addStyle(` .tb_rich_poster .poster_success{left:349px!important} /*发表成功提示居中*/ .af_display_mask{ background: #009eff38} /*图片缩略图聚焦框显示为淡蓝色*/ .p_content img.BDE_Image.origin{ max-width: 810px!important;} /*图片变大*/ #ueditor_replace img.BDE_Image{width:auto!important; height:auto!important;}/*编辑区删除图片长宽限制*/ .core_title_theme_bright .core_title_txt{ width: 700px!important;} /*标题变长*/ .post_bubble_top, .post_bubble_middle, .post_bubble_bottom{ width:auto!important } /*拉宽回复气泡*/ /*帖子内容变宽*/ .replace_div{ width: 810px!important; height: auto!important;} .replace_tip{display:none!important} .right_section{display:none!important} /*吧内首页变宽*/ #aside{display:none!important} #content_leftList{background:white!important} .enter_pb_wrapper{left:850px!important;margin-top:-32px!important}/*进入帖子按钮靠右*/ .tbui_aside_fbar_button.tbui_fbar_down{display:none!important}/*隐藏下载按钮*/ /*个人主页变宽*/ .right_aside{display:none!important} .ihome_body{border:1px solid #87BED9} .ihome_nav_wrap{margin:0px} .left_aside{background:white} .n_right{background:white} .new_list .n_post_time{margin-right:20px} .n_right:hover{background-color: #f7f9fc;} /*隐藏广告*/ #error_404_iframe{display:none!important} .fengchao-wrap-feed{display:none!important} .banner_theme{display:none!important} .bus-top-activity-wrap{display:none!important} #mediago-tb-first-floor{display:none!important} [id*="mediago-tb-"]{display:none!important} [class*="mediago-ad-"]{display:none!important} .gift-goin{display:none!important} .tb_poster_placeholder{display:none!important}/*隐藏回复框会员特权提示*/ `); //移动版页面自动跳转为PC版 if(window.location.pathname.indexOf('/mo') > -1) { var reg = new RegExp('(^|&)' + 'tid' + '=([^&]*)(&|$)', 'i'); var r = window.location.search.substr(1).match(reg); if (r != null) { window.location.href='https://tieba.baidu.com/p/'+r[2]; } } if(window.location.href.indexOf('/photo/')>-1) { let right_fold=setInterval(function(){ if($('.af_right_fold.right_close').length>0) { $('.af_right_fold').get(0).click(); clearInterval(right_fold); } },100); } setInterval(()=>{ if(window.location.href.indexOf('/p/')!= -1) //帖子 { //帖子内容变宽 if(!$('.left_section').hasClass('wide')) { $('.left_section').width($('.pb_content').width()); $('#j_core_title_wrap').width($('.pb_content').width()); //标题栏 $('#j_p_postlist').width($('.pb_content').width()); //内容列表 $('.left_section').addClass('wide'); } $('.l_post_bright').each(function(){ if(!$(this).hasClass('wide')) { $(this).width($('.pb_content').width()); $(this).find('.d_post_content_main').width($('.pb_content').width() - 153); $(this).find('.d_post_content_main .p_content').width($('.pb_content').width() - 173); $(this).find('.core_reply_tail').width($('.pb_content').width() - 168); $(this).find('.core_reply_wrapper').width($('.pb_content').width() - 168); $(this).find('.core_reply_wrapper').width($('.pb_content').width() - 168); $(this).find('.lzl_editor_container_s').width($('.pb_content').width() - 173); if( $(this).find('.core_reply_wrapper').css('width')!=undefined && parseInt( $(this).find('.core_reply_wrapper').css('width')) >= 800) { $(this).addClass('wide'); } } //楼中楼回复框 $(this).find('.edui-container').width($('.pb_content').width() - 203); $(this).find('.p_content .edui-editor-body').width($('.pb_content').width() - 203); $(this).find('.editor_for_container.editor_lzl_container').width($('.pb_content').width() - 203); $(this).find('.lzl_simple_wrapper').width($('.pb_content').width() - 203); $(this).find('.lzl_panel_wrapper').width($('.pb_content').width() - 203); }) //图片变清晰 $('.p_content img.BDE_Image').each(function(){ if(!$(this).hasClass('origin')) { let imglink = $(this).attr('src').substring($(this).attr('src').lastIndexOf('/')); $(this).attr('src','http://tiebapic.baidu.com/forum/pic/item'+imglink); $(this).css('max-width', '810px;') $(this).removeAttr('width'); $(this).removeAttr('height'); $(this).addClass('origin'); $(this).wrap('