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.

当前为 2014-08-06 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 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         1.1.3
// @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==

/*
 *  https://gist.github.com/adelabs/2a9441a504f47707fdcf/raw/weibo_lite.user.js
 */

var speed = 500;

// Find elements on the page
var left = $('div.W_main_l');
var right = $('div.W_main_r#Box_right');
var center = $('div.W_main_c#Box_center');
var bottom = $('div.global_footer');
// Add a toggle button
var toggle = $('<button></button>').text('show/hide');
center.before(toggle.hide());
toggle.click(function(){left.toggle(speed);
                        right.toggle(speed);
                        bottom.toggle(speed);});

// First toggle!
toggle.click();
setTimeout(function(){toggle.toggle(speed);}, speed);

// Hide ads.
function hide_ads() {
    // Header ads
    $('div.pl_content_biztips').hide();
    $('div.tips_wrapper').hide();
    $('div.tips_player').hide();
    // Side ads
    $('div.W_rightModule').hide();
    $('div.M_activities').hide();
    $('div.M_abverArea').hide();
    $('div.adver_contB').hide();
    $('div.lbs_map').hide();
    $('div.pl_rightmod_ads36').hide();
    $('div.trustPagelet_recom_memberv5').hide();
    // Footer ads
    $('div.footer_adv').hide();
    $('div.footer_advbg').hide();
    $('div.adv_w980').hide();
    $('div.layer_tips').hide();
    $('div.layer_tips_version').hide();
    $('div.layer_tips_intro').hide();
    $('div.layer_tips_bg').hide();
    $('div.layer_tips_cont').hide();
    // Mid ads
    $('fieldset.up_line_ad').parent().hide();
    $('div.W_no_border').hide();
    // Bottom ads
    $('div.W_tips').hide();
    $('div.tips_error').hide();
}
// Try 10 times in 10 seconds.
for (var i=0; i<10; ++i) {
    setTimeout(function(){hide_ads()}, 1000 * i);
}
// Try once per minute.
//  setInterval(function(){hide_ads()}, 60000);