No Tiexue Post2

铁血跳转链接替换'post2'为‘post’,不用再为满屏广告烦恼

目前為 2016-12-13 提交的版本,檢視 最新版本

// ==UserScript==
// @name               No Tiexue Post2
// @name:zh-CN         替换铁血post2
// @namespace          daizp
// @version            0.2
// @description        铁血跳转链接替换'post2'为‘post’,不用再为满屏广告烦恼
// @author             hoothin
// @include            http://www.tiexue.net/*
// @include            http://bbs.tiexue.net/*
// @grant              none
// ==/UserScript==

(function aaa() {
    'use strict';
    switch (location.host) {
    case "www.tiexue.net":
            no_post2();
        break;
    case "bbs.tiexue.net":
            no_ad();
        break;
    }
    //替换post2为post
    function no_post2(){
        var i=0;
        var pic_obj = document.getElementById("pics"+i.toString());
        while(pic_obj){
            pic_obj.innerHTML = pic_obj.innerHTML.replace(/post2/g,"post");
            pic_obj = document.getElementById("pics"+(i++).toString());
        }
    }
    //删除bbs广告
    function no_ad(){
        //删除左边广告
        var left_ad = document.getElementById("Baidu_BBSPostNormalV3ContentLeftAD1");
        if(left_ad){
            left_ad.remove();
        }
    }
})();