AUTOCLICK "Continue" OF "Please disable your ad-block." or Ads Support Popup

X:

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name    AUTOCLICK "Continue" OF "Please disable your ad-block." or Ads Support Popup
// @namespace    
// @version 2024-10-24
// @description X:
// @author  Beginner[2023]
// @match   https://idol.sankakucomplex.com/*
// @match   https://chan.sankakucomplex.com/*
// @icon    https://www.google.com/s2/favicons?sz=64&domain=sankakucomplex.com
// @grant   none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    var a = document.getElementById('content');
    var adpop_main = null;

    function check_adpop_vis() {
        if (adpop_main != null && adpop_main.getStyle('display') == 'none') {
            return false
        } else if (adpop_main == null) {
            for (let i = 0; i < a.children.length; i++) {
                /* checking the next element have to continue */
                if(a.children[i].nextElementSibling == null) {
                    // console.log('no more next element')
                    break
                }
                if(a.children[i].nextElementSibling.tagName.toLowerCase() == 'script' && a.children[i].nextElementSibling.getAttribute('type') == null){
                    adpop_main = a.children[i];
                    // console.log('pop!!')
                    return true
                }
            }
        }
    }

    function autoclick_c() {
        if(adpop_main != null) {
            try {
                let name_func = adpop_main.lastElementChild.childNodes[0].textContent.trim().slice('async function '.length,'async function '.length+7);
                window[name_func]()
            } catch (error) {
                console.log(error)
            }
        }
    }


    let running = setInterval(function() {
        let sta = check_adpop_vis()
        if (sta == true) {
            // console.log(sta)
            autoclick_c();
        } else {
            // console.log(sta)
            clearInterval(running);
        }
    },300)


})();