Written by Houyou to remove the ads in the lower left corner of the Feijisu website

Written by Houyou to remove the ads in the lower left corner of the Feijisu website

Purpose: Record the script on the monkey oil script you use.

// ==UserScript==
// @name         清除飞极速的弹出框
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  清除飞极速的弹出框
// @author       deck
// @match        http://feijisu7.com/*
// @grant        none
// ==/UserScript==
(function () {
    'use strict';
    // Your code here...
    function cleanHtml() {

        let parent = document.body;
        console.log("parent:" + parent);
        let childs = parent.children;
        console.log("childs:" + childs);
        let removeChild1 = childs[childs.length-1];
        let removeChild2 = childs[childs.length-2];
        let removeChild3 = childs[childs.length-3];
        if (childs!=null) {
            parent.removeChild(removeChild1);
            parent.removeChild(removeChild2);
            parent.removeChild(removeChild3);
            clearInterval(success);
        }
    }

    let success = setInterval(cleanHtml, 10);
    console.log("success:"+success);


})();

Summary: This is relatively simple. It mainly uses the relevant knowledge of the DOM node in js to realize that every web page of it can be refreshed or the reason why this web page search is reloaded every time. I tried Baidu without success, it should It is the difference between filling in the original page after searching, not reloading.

Guess you like

Origin blog.csdn.net/weixin_44767679/article/details/110748739