feiszw_remove_advs

Remove divs of advertisements at https://m.feiszw.com

当前为 2022-09-21 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         feiszw_remove_advs
// @namespace    http://netoday.cn
// @version      0.1.4
// @description  Remove divs of advertisements at https://m.feiszw.com
// @author       crazy_pig
// @match        https://m.feiszw.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// @require      https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);

(function() {
    'use strict';

    // get url user visited
    var _url = (window.location + "").toLowerCase();

    // if need active script
    if (_url.indexOf("feiszw.com") > 0){
        // edit last theme to green
        _change_style();

        setInterval(function (){
            _recursion_set_style(document.body.children);
        }, 300);

        //setInterval(function(){
        //    var test = $('#crumb').innerText;
        //}, 3000);
    }
})();

function _change_style(){
    document.body.style = "font-family: \"Microsoft YaHei\"; background-color: #016974; padding-bottom: 130px;";
    $("#crumb").css({"background-color":"#016974","color":"#E4DD40"});
    $("#header").css({"background-color":"#181C1F","color":"#EAF2F7"});
    $("#tools").css({"background-color":"#181C1F","color":"#EAF2F7"});
    $("#maintool").css({"background-color":"#181C1F","color":"#EAF2F7"});
    $("#moretool").css({"background-color":"#181C1F","color":"#EAF2F7"});
    $("#nr1").css("color","#E4DD40");
    $("#nr_title").css("color","#FFFFFF");
}

/**
 * set font \ background-color \ font-family
 */
function _recursion_set_style(childrenNodes){
    if (typeof(childrenNodes) !== 'undefined'){
        var i;
        // set visibility hidden
        var startFlag = false;
        for (i =0; i < childrenNodes.length ; i++){
            if (startFlag &&
               'SCRIPT' !== childrenNodes[i].tagName.trim().toUpperCase() &&
               'SPAN' !== childrenNodes[i].tagName.trim().toUpperCase()){
                    childrenNodes[i].style.visibility = "hidden";
            }
            if ('SCRIPT' === childrenNodes[i].tagName.trim().toUpperCase() &&
                childrenNodes[i].getAttribute("src") === "/js/show.min.js"){
                childrenNodes[i].removeAttribute("src");
            }
            if('AUDIO' === childrenNodes[i].tagName.trim().toUpperCase()){
                startFlag = true;
            }
            if(childrenNodes[i].innerText.indexOf("飞速中文") >= 0){
                childrenNodes[i].style = "color:#fff;text-align:center;margin-bottom:24px;font-size:.8rem";
            }
        }
    }
}