Greasy Fork

Greasy Fork is available in English.

屏蔽163邮箱界面广告

屏蔽163邮箱登录界面和邮件页面的广告标签和广告图片!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         屏蔽163邮箱界面广告
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  屏蔽163邮箱登录界面和邮件页面的广告标签和广告图片!
// @author       meihonglou
// @match        https://mail.163.com/*
// @icon         https://www.google.com/s2/favicons?domain=163.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    if (document.location.href.indexOf("?sid=") > -1) {
        // 登陆后
        var js_component_component_CLASS = document.querySelectorAll('.js-component-component');
        for (let i = 0; i < js_component_component_CLASS.length;i++) {
            if (js_component_component_CLASS[i].textContent === "官方App") js_component_component_CLASS[i].parentNode.removeChild(js_component_component_CLASS[i]);
            if (js_component_component_CLASS[i].textContent === "开通邮箱会员") js_component_component_CLASS[i].parentNode.removeChild(js_component_component_CLASS[i]);
        }
        var js_component_tabitem_CLASS = document.querySelectorAll('.js-component-tabitem');
        for (let i = 0; i < js_component_tabitem_CLASS.length;i++) {
            if (js_component_tabitem_CLASS[i].title === "网易严选") js_component_tabitem_CLASS[i].parentNode.removeChild(js_component_tabitem_CLASS[i]);
            //if (js_component_tabitem_CLASS[i].textContent === "开通邮箱会员") js_component_tabitem_CLASS[i].parentNode.removeChild(js_component_tabitem_CLASS[i]);
        }
    } else {
        // 登陆页面
        var B_G_Picture_ID = document.getElementById('mainCnt');
        var B_G_Picture_CLASS = document.getElementsByClassName('main-inner');
        if (B_G_Picture_ID != null) {
            B_G_Picture_ID.style.backgroundImage = "";
        } else {
          if (B_G_Picture_CLASS != null) B_G_Picture_CLASS.style.backgroundImage = "";
        }
        var theme_ID = document.getElementById('theme');
        if (theme_ID != null) theme_ID.parentNode.removeChild(theme_ID);
        var themeCtrl_CLASS = document.querySelector('.themeCtrl');
        if (themeCtrl_CLASS != null) themeCtrl_CLASS.parentNode.removeChild(themeCtrl_CLASS);
        //
        var login_block_Child_CLASS = document.querySelector('.mailApp');
        if (login_block_Child_CLASS != null) login_block_Child_CLASS.parentNode.removeChild(login_block_Child_CLASS);
        var login_block_ID = document.getElementById('loginBlock');
        if (login_block_ID != null) login_block_ID.style.height = "auto";
        var m_footer_CLASS = document.querySelector('.m-footer');
        if (m_footer_CLASS != null) m_footer_CLASS.style.paddingTop = "15px";
        var footer_nav_CLASS = document.querySelector('.footer-nav');
        if (footer_nav_CLASS != null) footer_nav_CLASS.parentNode.removeChild(footer_nav_CLASS);
        //
        var headerNav_Child_CLASS = document.querySelector('.headerNav');
        if (headerNav_Child_CLASS != null) headerNav_Child_CLASS.parentNode.removeChild(headerNav_Child_CLASS);
    }

    // Your code here...
})();