净化2345主页

净化2345主页广告

当前为 2022-05-17 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         净化2345主页
// @namespace    http://tampermonkey.net/
// @version      0.3.2
// @description  净化2345主页广告
// @match        https://www.2345.com/*
// @match        https://www.hao123.com/*
// @grant        2022.05.17
// @require      http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
// @license      GPL-3.0

// ==/UserScript==

(function() {
    'use strict';
    var nodeIdArray = new Array("content-left","middle-info-flow","J_newsChannel","J_gameChannel","J_lifeChannel","J_anecdoteChannel","J_yqcChannel","J_gul_yg","l1hick","map_news","map_webgame2","map_minigame","map_shop","business-bottom-wrap","map_topNews","searchXiala","search-right-mess","search-hot-word","J_broadcast","top_left","feed_pagelet","J_micro_zhuanti-002");
    var nodeClassArray = new Array("content-left","left-cnli-003","g-ib layout-left","content-right","search-hot-word","search-right-swiper-news","search-xiala","search-tip","news-box","classify-nav","top-left");
    for(var i=0;i<nodeIdArray.length;i++){
        var node = document.getElementById(nodeIdArray[i]);
        if(node!==null){
            node.parentNode.removeChild(node);
        }
    }
    for(var k=0;k<nodeClassArray.length;k++){
        var nodes = document.getElementsByClassName(nodeClassArray[k]);
        for(var j=0;j<nodes.length;j++){
            var Cnode = nodes[j];
            if(Cnode!==null){
                Cnode.parentNode.removeChild(Cnode);
            }
        }
    }
    document.getElementById("layout-content").setAttribute("class", "page-width");
    //仅保留登陆信息
    $(".header__inner").children().each(function(){
        if($(this).attr("class")!=="header__item--fr login-pan-mobile header--r1"){
            $(this).hide();
        }
    });
    $(".login__pop").css("height","35px");
    $(".hao123-search").css("padding-top",0);
})();