其他分享
首页 > 其他分享> > tampermonkey,某学习网站的净化脚本

tampermonkey,某学习网站的净化脚本

作者:互联网

// ==UserScript==
// @name         删除多余元素
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match       你看不见我!!!
// @grant        none
// @noframes

// ==/UserScript==

(function(){
    'use strict';

    var del=function(){
        var list=["iframe",".layout-header",".layout-footer",".xuexi",".WNiH6aSBS23IzewzHGi4v",'audio',".redflag-2"];
        for (var i=0; i<list.length;i++){
            var s=document.querySelectorAll(list[i]);
            for (var ii=0;ii<s.length;ii++){
                if(s[ii].id=="ddlogin-iframe"){
                    break;
                }
                 console.log("删除:",list[i])
                s[ii].parentNode.removeChild(s[ii]);
            }
        }
    }
    window.setTimeout(del,2000);

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

标签:脚本,layout,list,ii,净化,UserScript,var,tampermonkey
来源: https://blog.csdn.net/pal97/article/details/116426237