Turn off ADS POPUP in site xamvl.com

enter something useful

// ==UserScript==
// @name         Turn off ADS POPUP in site xamvl.com
// @version      0.1
// @description  enter something useful
// @author       TienNH
// @include      http://xamvl.com/*
// @grant        none
// @run-at      document-start
// @namespace https://gf.qytechs.cn/users/16893
// ==/UserScript==

function removeElementsByClass(className){
    var elements = document.getElementsByClassName(className);
    while(elements.length > 0){
        elements[0].parentNode.removeChild(elements[0]);
    }
}

function createElement( str ) {
    var elem = document.createElement('div');
    elem.innerHTML = str;
    return elem;
}

function addNewStyle(newStyle) {
    var styleElement = document.getElementById('styles_js');
    if (!styleElement) {
        styleElement = document.createElement('style');
        styleElement.type = 'text/css';
        styleElement.id = 'styles_js';
        document.getElementsByTagName('head')[0].appendChild(styleElement);
    }
    styleElement.appendChild(document.createTextNode(newStyle));
}

addNewStyle('.afs_ads {display:block !important;height:1px;width:1px;}');

removeElementsByClass('afs_ads');
var elemDiv = createElement('<p>fake ads</p>');
elemDiv.className  = 'afs_ads';
document.body.appendChild(elemDiv);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址