Greasy Fork

Greasy Fork is available in English.

Weibo Lite (无干扰新浪微博)

Clear the ads and add a toggle button to hide/show bottom bar and side bars.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            Weibo Lite (无干扰新浪微博)
// @namespace       https://github.com/adelabs
// @description     Clear the ads and add a toggle button to hide/show bottom bar and side bars.
// @version         2.1.1
// @license         GPL version 3
// @include         *://weibo.com/*
// @require         http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @grant           none
// @run-at          document-end
// ==/UserScript==

// Add a button.
var button = $('<button></button>');
$('div.W_main_a').before(button.hide());
// Function the button.
var speed = 250;
button.text('hide').click(function(){
    var bars = $('div.W_main_l, div.W_main_r, div.global_footer');
    if (button.text() == 'hide') {
       bars.hide(speed, function(){button.text('show');});
    } else {
       bars.fadeIn(speed, function(){button.text('hide');});
    }
});
// Show the button and then toggle.
button.show(speed, function(){button.click();});

// Hide ads.
function hide_ads() {
    console.log('hide_ads');
    var ads = $([
        // Tips
        'div.layer_tips_version',
        // Header ads
        'div.pl_content_biztips',
        'div.tips_wrapper',
        'div.tips_player',
        'div.title_area',
        // Left side ads
        // Right side ads
        'div.adver_contB',
        'div#pl_rightmod_ads36',
        'div.M_activities',
        'div.M_abverArea',
        // Mid ads
        'div.W_no_border',
        'div.WB_feed_type[feedtype="ad"]',
        // Footer ads
        'div.footer_adv',
    ].join());
    ads.each(function(){
        if ($(this).css('display') == 'none') { return; }
        console.log('Hide', this);
        $(this).remove();
    });
}
// Observe and repeat
$([
   'body',
   'div.W_miniblog',
   'div.WB_feed',
].join()).each(function(i, o){
    var observer = new MutationObserver(function(mutations) {
        hide_ads();
    });
    observer.observe(o, {childList: true});
});