Greasy Fork

Greasy Fork is available in English.

网页净化

去除常用站点无用信息,目前支持Google 翻译、国内版 Bing。全局背景色(看情况)、超链接打开在新标签

当前为 2021-04-09 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         网页净化
// @namespace    http://tampermonkey.net/
// @version      0.0.1
// @description  去除常用站点无用信息,目前支持Google 翻译、国内版 Bing。全局背景色(看情况)、超链接打开在新标签
// @author       来世一笑
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @match        https://*/*
// @match        http://*/*
// ==/UserScript==

(function() {
    //全局
    document.body.style.backgroundColor="#fffff7"
    if(document.getElementsByTagName("a").length!==0)for (let temp=0;temp<document.getElementsByTagName("a").length;temp++)document.getElementsByTagName("a")[temp].setAttribute("target","_blank")
    //Google 翻译
    if(document.getElementsByClassName("gb_Kd gb_4d gb_Td gb_Sd").length!==0)document.getElementsByClassName("gb_Kd gb_4d gb_Td gb_Sd")[0].remove()
    if(document.getElementsByClassName("VjFXz").length!==0)document.getElementsByClassName("VjFXz")[0].remove()
    if(document.getElementsByClassName("a88hkc").length!==0)document.getElementsByClassName("a88hkc")[0].remove()
    if(document.getElementsByClassName("rQKk7 zJmlgc").length!==0)document.getElementsByClassName("rQKk7 zJmlgc")[0].remove()
    if(document.getElementsByClassName("zQTmif SSPGKf RvYhPd BIdYQ aL9XFd").length!==0)document.getElementsByClassName("zQTmif SSPGKf RvYhPd BIdYQ aL9XFd")[0].style.backgroundColor="#fffff7"
    if(document.getElementsByClassName("WFnNle").length!==0)document.getElementsByClassName("WFnNle")[0].style.backgroundColor="#fffff7"
    //国内版 Bing
    if(document.getElementById("est_switch")!=null)document.getElementById("est_switch").remove()
    if(document.getElementById("ev_talkbox_wrapper")!=null)document.getElementById("ev_talkbox_wrapper").remove()
    if(document.getElementById("sb_form")!=null)document.getElementById("sb_form").style.display="none"
    if(document.getElementById("id_h")!=null)document.getElementById("id_h").remove()
    if(document.getElementById("b_footer")!=null)document.getElementById("b_footer").remove()
    if(document.getElementById("mfa_srch")!=null)document.getElementById("mfa_srch").remove()
    if(document.getElementById("epf")!=null)document.getElementById("epf").parentElement.parentElement.remove()
    if(document.getElementsByClassName("b_rs").length!==0)document.getElementsByClassName("b_rs")[0].parentElement.remove()
    while(document.getElementsByClassName("sb_add sb_adTA").length!==0)document.getElementsByClassName("sb_add sb_adTA")[0].parentElement.remove()
    if(document.getElementsByClassName("b_msg b_canvas").length!==0)document.getElementsByClassName("b_msg b_canvas")[0].remove()
    if(document.getElementById("fbmoplk")!=null)document.getElementById("fbmoplk").remove()
    if(document.getElementsByClassName("b_footnote").length!==0)document.getElementsByClassName("b_footnote")[0].remove()
    if(document.getElementById("b_header")!=null)document.getElementById("b_header").style.backgroundColor="transparent"
    if(document.getElementsByClassName("tipContainer b_cards").length!==0)document.getElementsByClassName("tipContainer b_cards")[0].remove()
    if(document.getElementById("b_tween")!=null)document.getElementById("b_tween").setAttribute("class","")
    if(document.getElementById("b_content")!=null)document.getElementById("b_content").setAttribute("style","padding-top: 41px;")
    if (document.getElementsByClassName("scope_chevdown").length!==0)document.getElementsByClassName("scope_chevdown")[0].setAttribute("class","scope_chevdown b_hide")
    if (document.getElementsByClassName("scope_chevup b_hide").length!==0)document.getElementsByClassName("scope_chevup b_hide")[0].setAttribute("class","scope_chevup")
    if (document.getElementById("bza_AutoZoom") != null) document.getElementById("bza_AutoZoom").setAttribute("aria-pressed", "true")
    if (document.getElementById("bza_AutoZoom_ctrl") != null) document.getElementById("bza_AutoZoom_ctrl").setAttribute("class", "bza_img toggle_img toggle_on")
    if(document.getElementsByTagName("li").length!==0)for(let temp=0;temp<document.getElementsByTagName("li").length;temp++)document.getElementsByTagName("li")[temp].style.backgroundColor="transparent"
    if(document.getElementsByClassName("b_ans").length!==0)for (let temp=0;temp<document.getElementsByClassName("b_ans").length;temp++)if(document.getElementsByClassName("b_ans")[temp].innerHTML==="")document.getElementsByClassName("b_ans")[temp].remove()
})()