JUST TESTING CODE

try to take over the world!

// ==UserScript==
// @name         JUST TESTING CODE
// @namespace    http://tampermonkey.net/
// @version      20
// @description  try to take over the world!
// @author       You
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_download
// @grant        GM_openInTab
// @grant        GM_addElement
// @grant        GM_registerMenuCommand
// @grant        GM_addValueChangeListener
// @noframes
// ==/UserScript==
const scriptId = '431691';
const blogURL = 'bloggerpemula.pythonanywhere.com';

const cfg = {
    'Auto-Download on Supported Sites': false,
    'Allow Context Menu': false,
    'Disable Prompts & Notifications': false,
    BlockFC: false,
    Flickr: false,
    'Disable Adblock Detections': false,
};

function buildTabContent() {
    let html = `
    <!DOCTYPE html>
    <html>
    <head>
        <title>Config</title>
        <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            color: #333;
        }
        button {
            margin-top: 10px;
            padding: 5px 10px;
            cursor: pointer;
        }
        .highlight {
            font-weight: bold;
            color: #d9534f;
            margin-top: 20px;
        }
        header { font-weight: bold; margin-bottom: 15px; }
        a { color: #007BFF; text-decoration: none; }
        a:hover { text-decoration: underline; }
        label { display: block; margin: 10px 0; }
        footer { margin-top: 20px; font-size: 0.9em; }
        footer ul { padding-left: 0; list-style: none; }
        </style>
    </head>
    <body>
        <header>Support Me Via <a href="https://saweria.co/Bloggerpemula" target="_blank">https://saweria.co/Bloggerpemula</a> or Crypto</header>`
    for (const key in cfg) {
        const value = cfg[key];
        const k = key.replace(/ |&/g, '');
        html += `
        <div>
            <label for='${k}'>${key}: 
                <input type='checkbox' onchange='updateSetting(this)' id='${k}' ${value ? 'checked' : ''}>
            </label>
        </div>`;
    }
    html += `
    <button onclick='window.close()'>Close</button>

    <p class="highlight">Please respect if my scripts are useful for you:</p>
    <ul>
        <li>Don't try to copy-paste my scripts and share as your own.</li>
        <li>Please don't remove or change my blog.</li>
        <li>Disable your AdBlock on my blog. Thanks for your support!</li>
    </ul>

    <footer>
        <h3>Credits & Contributors</h3>
        <ul>`;
    ['Konf', 'hacker09', 'juansi', 'NotYou', 'cunaqr', 'Rust1667', 'varram|provided great bypass sites'].forEach(c => {
        const cc = c.split('|')
        const n = cc.length > 1;
        html += `<li><a href="https://greatest.deepsurf.us/en/users/${n ? cc[0] : c}" target="_blank">@${n ? cc[0] : c}</a>${n ? ' - ' + cc[1] : ''}</li>`
    })
    html += `
        </ul>
        Also, thank you to everyone who has contributed with good feedback and to all donors who supported the project.
    </footer>
    <!-- <iframe src="https://bloggerpemula.pythonanywhere.com/"></iframe> -->
    </body>
    </html>`;

    return 'data:text/html;charset=utf-8,' + encodeURIComponent(html);
}

GM_registerMenuCommand('Settings', function() {
    GM_openInTab(buildTabContent(), { active: true, insert: true });
}, {
  accessKey: 'S',
  autoClose: true
});

GM_registerMenuCommand('stats', async function() {
    const url = `https://api.greatest.deepsurf.us/scripts/${scriptId}/stats.json`;
    const data = await fetch(url).then(response => response.json());
    let totalInstalls = 0,
        totalUpdateChecks = 0,
        daysCount = 0;

    for (const date in data) {
        const stats = data[date];
        totalInstalls += stats.installs;
        totalUpdateChecks += stats.update_checks;
        daysCount++;
    }
    const averageInstalls = (totalInstalls / daysCount).toFixed(2);
    const averageUpdateChecks = (totalUpdateChecks / daysCount).toFixed(2);

    alert(
        'Total Days: ' + daysCount + '\n' +
        'Total Installs: ' + totalInstalls + '\n' +
        'Total Update Checks: ' + totalUpdateChecks + '\n' +
        'Average Installs per Day: ' + averageInstalls + '\n' +
        'Average Update Checks per Day: ' + averageUpdateChecks
    );
}, {
  autoClose: true
})

let hostRunCounter = 0;
function GM_onMessage(label, callback = () => {}) {
    logger.log('GM_onMessage is on');
    GM_addValueChangeListener('postMessage-' + label, function(_, _, newValue, remote) {
        logger.log('inside postMessage')
        if (remote) {
            logger.log('inside postMessage value', {
                newValue
            })
            GM_deleteValue('postMessage-' + label);
            callback(newValue);
        }
    });
}

function GM_sendMessage(label, value) {
    GM_setValue('postMessage-' + label, value);
}

function strBetween(str, start, end) {
    const regex = new RegExp(`(?<=${start}).*(?=${end})`, 'g');
    const matches = str.match(regex);
    return matches ? matches[0] : '';
};

function Checkvisibility(elem) {
    if (!elem.offsetHeight && !elem.offsetWidth) {
        return false;
    }
    if (getComputedStyle(elem).visibility === 'hidden') {
        return false;
    }
    return true;
}


function RSCookie(name, value = undefined, days = null) {
    if (!name) return null;

    // --- SET MODE ---
    if (value !== undefined) {
        let expires = '';
        if (typeof days === 'number') {
            const date = new Date();
            date.setTime(date.getTime() + (days * 86400000));
            expires = `; expires=${date.toUTCString()}`;
        }

        document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}${expires}; path=/`;
        return true;
    }

    // --- READ MODE ---
    const cookies = document.cookie.split(';').map(c => c.trim());
    const cookie = cookies.find(c => c.startsWith(encodeURIComponent(name) + '='));
    return cookie ? decodeURIComponent(cookie.split('=')[1]) : null;
}

function setActiveElement(selector) {
    waitForElement(selector)
        .then(element => {
            const temp = element.tabIndex;
            element.tabIndex = 0;
            element.focus();
            element.tabIndex = temp;
        });
}

function captchaSolved(callback, onWait = () => {}) {
    let intervalId;
    const stopChecking = () => clearInterval(intervalId);

    waitForElement('//div[contains(@class, \'iconcaptcha-modal__body-title\') and normalize-space(text())=\'Verification complete.\'] | //*[@id=\'captcha-result\' and normalize-space()=\'Verified!\']')
        .then(function() {
            stopChecking();
            callback();
        })
    const checkCaptcha = () => {
        try {
            const captcha = unsafeWindow.turnstile || unsafeWindow.hcaptcha || unsafeWindow.grecaptcha;
            const response = captcha.getResponse();

            if (response) {
                stopChecking();
                callback();
            }
        } catch (error) {
            onWait(stopChecking);
        }
    };

    checkCaptcha();
    intervalId = setInterval(checkCaptcha, 1000);
}

function httpListener(callback) {
    const originalOpen = XMLHttpRequest.prototype.open;
    XMLHttpRequest.prototype.open = function(method, url) {
        this.addEventListener('load', () => {
            this.method = method;
            this.url = url;
            callback(this);
        });
        originalOpen.apply(this, arguments);
    };
}

function waitForElement(selector, timeout = 0) {
    const findElement = () => {
        if (selector.startsWith('//')) {
            return document.evaluate(selector, document, null, 9).singleNodeValue;
        }
        return document.querySelector(selector);
    };

    return new Promise(async (resolve, reject) => {
        let element = findElement();
        if (document.contains(element)) {
            return resolve(element);
        }
        const observer = new MutationObserver(() => {
            element = findElement();
            if (document.contains(element)) {
                observer.disconnect();
                resolve(element);
            }
        });
        observer.observe(document.documentElement, {
            // attributes: true,
            childList: true,
            subtree: true,
        });
        if (timeout > 0) {
            await waitSec(timeout)
            observer.disconnect();
            reject(new Error(`Element '${selector}' not found in time.`));
        }
    })
}

function openWithReferrerPolicy(href) {
    GM_addElement(document.head, 'meta', {
            name: 'referrer',
            content: 'origin'
        })
        (GM_addElement('a', {
            href
        })).click();
}

function waitSec(s) {
    return new Promise(r => setTimeout(r, s * 1000));
}

function imporveRegex(pattern) {
    //TODO: Convert everything into an array and detect patterns in order to minimize the regex as much as possible.
}
function expandRegex(str) {
  // If no group, return as-is
  if (!str.includes('(')) return [str];

  // Find first (...) group
  const m = str.match(/\(([^)]+)\)/);
  if (!m) return [str];

  const [full, options] = m;
  const parts = options.split('|');

  // Replace the group with each option and recurse (for multiple groups)
  return parts.flatMap(opt =>
    expandRegex(str.replace(full, opt))
  );
}

function runIfHost(pattern, fn, ...args) {
    const includes = GM_info?.script?.includes;
    const debugging = false;

    if (includes && debugging) { //TODO: Improve
        const all = includes.flatMap(expandRegex);
        const curr = expandRegex(pattern);
        const missing = curr.filter(h => !all.includes(h));

        if (missing.length) {
            logger.warn('⚠️ Host matched pattern but not in @include list!', {
                host: location.host,
                missing,
                includes,
            });
            alert('Found new host(s) not in @include: ' + missing.join(', '));
        }
    }

    // const res = imporveRegex()
    // if (res.length < pattern.length) alert('found new regex '+res);
    const isMatch = new RegExp(pattern).test(location.host);
    if (!isMatch) return; //RegExp.escape

    hostRunCounter += 1;

    logger.info('Function triggered', {
        count: hostRunCounter,
        pattern,
        fn: fn.name || fn.toString(),
        args
    });

    fn(...args);
}

function goTo(url, useBlog = false) {
    const target = useBlog ? `${blogURL}?BypassResults=${url}` : url;
    logger.info('goTo', {
        target
    })
    location = target
}

function createGMLogger(options = {}) {
    const logs = [];
    const maxLogs = options.maxLogs || 200;
    const gmKey = options.gmKey || 'tm_logs';

    function _saveLog(entry) {
        logs.push(entry);
        if (logs.length > maxLogs) logs.shift();
        GM_setValue(gmKey, logs);
    }

    function formatAndStoreLog(level, ...args) {
        const time = new Date().toLocaleTimeString();
        const message = args.map(arg =>
            (typeof arg === 'object' && arg !== null) ? JSON.stringify(arg) : String(arg)
        ).join(' ');
        const entry = `${location.host}: [${time}] [${level.toUpperCase()}] ${message}`;
        // Uncomment to log to console as well:
        console[level]?.(entry);
        _saveLog(entry);
    }

    return {
        log: (...args) => formatAndStoreLog('log', ...args),
        info: (...args) => formatAndStoreLog('info', ...args),
        warn: (...args) => formatAndStoreLog('warn', ...args),
        error: (...args) => formatAndStoreLog('error', ...args),
        getLogs: () => [...(GM_getValue(gmKey, []))],
        clearLogs: () => {
            logs.length = 0;
            GM_deleteValue(gmKey);
            console.log('Logs cleared');
        }
    };
}

const logger = new createGMLogger();

async function elementRedirect(selector, attribute = 'href') {
    logger.info('elementRedirect triggered', {
        selector
    });
    const selectors = selector.split(', ');

    if (selectors.length > 1) {
        for (const sel of selectors) elementRedirect(sel, attribute);
        return;
    }

    const element = await waitForElement(selector);
    const target = element.getAttribute(attribute);
    logger.info('Redirecting to element attribute', {
        selector,
        target,
        attribute
    });
    goTo(target);
}

function parameterRedirect(url, parameters) {
    // parameters = parameters.split(','); 
    // if (parameters.every(parameter => searchParams.has(parameter)))
    if (parameters !== undefined && !queryParams.has(parameters)) return;

    const link = url.replace(/\$(.*)/, (_, p) => {
        const [paramName, queryString] = p.split(/\?/);
        const paramValue = searchParams.get(paramName);

        if (!paramValue) return _;

        return /([A-Za-z0-9]+=)$/.test(paramValue) ?
            atob(paramValue) :
            paramValue + (queryString ? '?' + queryString : '');
    });

    if (link !== url) goTo(link);
}

const referrerPolicy = (key) => queryParams.has(key) && openWithReferrerPolicy(atob(queryParams.get(key)));

async function clickSel(selector, delay = 0) {
    const selectors = selector.split(', ');

    if (selectors.length > 1) {
        for (const sel of selectors) clickSel(sel, delay);
        return;
    }

    const element = await waitForElement(selector);
    if (delay > 0) {
        logger.info('wait before clicking on element', {
            delay
        });
        await waitSec(delay);
    }

    element.removeAttribute('disabled');
    element.removeAttribute('target');
    //TODO REMOVE ONCLICK
    if (element.tagName === 'FORM') {
        element.submit();
        logger.info('Form submitted', {
            selector
        });
    } else {
        /*
        ['mouseover', 'mousedown', 'mouseup', 'click'].forEach(name => {
            element.dispatchEvent(new MouseEvent(name, {
                bubbles: true, cancelable: true
            }));
        });*/
        logger.info('Clicked on element ', {
            selector
        });
        element.click();
    }
}
const queryParams = new URLSearchParams(location.search);
const currentUrl = location.href;
// Any code repeated over 50 times should be moved into a separate function, or replaced with a more general function that handles most cases with minimal changes.
// Documentation should also be added, making it easier for other developers to contribute code and enabling AI to utilize both the code and the documentation to ensure proper integration with the system.
const redirectIfHost = (pattern, selector, attribute) => runIfHost(pattern, elementRedirect, selector, attribute);
const clickIfHost = (pattern, selector) => runIfHost(pattern, clickSel, selector);
const autoDownloadIfHost = (pattern, fn, ...args) => cfg['Auto-Download on Supported Sites'] && runIfHost(pattern, fn, ...args);
const clickAfterCaptcha = (selector) => captchaSolved(() => clickSel(selector));

function openBugReport() {
    goTo(`https://greatest.deepsurf.us/en/scripts/${scriptId}/feedback?attachLogs=1#new-script-discussion`)
}
//openBugRepeort();
runIfHost('greatest.deepsurf.us', async function() {
    const currentId = currentUrl.match(/\d+/);

    if (currentId != scriptId || !queryParams.has('attachLogs')) {
        return;
    }

    const comment = await waitForElement('.comment-entry');
    comment.value += 'Hey, these are my logs.\n' + logger.getLogs().join('\n')
})

runIfHost('.*', function() {
    if (!cfg['Allow Context Menu']) return;
    logger.info('RightFCL is Enabled');
    const events = [
        'contextmenu', 'copy', 'cut', 'paste',
        'select', 'selectstart', 'dragstart', 'drop'
    ];
    for (const eventName of events) {
        document.addEventListener(eventName, e => e.preventDefault(), true);
    }
});
runIfHost('.*', async function() {
    if (!cfg['Disable Prompts & Notifications']) return;
    logger.info('Prompt handling enabled');

    window.alert = () => {};
    window.confirm = () => true;
    window.prompt = () => null;
    if (window.Notification) {
        Notification.requestPermission = () => Promise.resolve('denied');
        Object.defineProperty(window, 'Notification', {
            value: null,
            writable: false
        });
    }
    const selectors = [];

    function helper(type, list) {
        const items = list.split(', ').map(item => `[${type}*='${item}']`);
        selectors.push(...items)
    }
    helper('class', 'cookie, gdpr, notice, privacy, banner, consent');
    helper('id', 'cookie, gdpr, notice, privacy, banner, consent');
    helper('role', 'dialog');
    helper('aria-label', 'cookie, consent, privacy')

    // Currently waiting for a single element; might need to change this later
    const element = await waitForElement(selectors.join(', '));
    const isBanner = element.textContent.match(/cookie|consent|tracking|gdpr|privacy|accept|agree|decline|manage|preferences/i)
    isBanner && element.remove();
})
runIfHost('.*', function() {
    if (!cfg.BlockFC) return;
    logger.info('focus handling enabled');

    // window.mouseleave = true;
    // window.onmouseover = true;
    // document.hasFocus = () => true;

    Object.defineProperty(document, 'webkitVisibilityState', {
        get: () => 'visible',
        configurable: true
    });
    Object.defineProperty(document, 'visibilityState', {
        get: () => 'visible',
        configurable: true
    });
    Object.defineProperty(document, 'hidden', {
        get: () => false,
        configurable: true
    });

    const eventOptions = {
        capture: true,
        passive: true
    };
    window.addEventListener('focus', e => e.stopImmediatePropagation(), eventOptions);
    window.addEventListener('blur', e => e.stopImmediatePropagation(), eventOptions);
})
runIfHost('.*', function() {
    if (!cfg['Disable Adblock Detections']) return;
    logger.info('noAdb');
    const blockPattern = /(adblock(reg)?|adb(model)?|checkadblock|detect(anyadb|adblock)|justdetectadb|fuckadblock|testadblock|disable(devtools)?|devtools)/i;
    const re = new RegExp(blockPattern);
    const observer = new MutationObserver(mutations => {
        mutations.forEach(mutation => {
            mutation.addedNodes.forEach(node => {
                if (node.nodeType === 1 && /SCRIPT|IFRAME/.test(node.tagName)) {
                    const source = node.src || node.textContent || '';
                    re.test(source) && node.remove();
                }
            });
        });
    });
    observer.observe(document, {
        childList: true,
        subtree: true
    });
    document.querySelectorAll('script, iframe').forEach(element => {
        const source = element.src || element.textContent || '';
        re.test(source) && element.remove();
    })
})


// A temporary solution for now, until I have the time to write code that doesn’t require all of this.
runIfHost('.*', () => {
    // let List = ['lopteapi.com', '3link.co', 'web1s.com', 'vuotlink.vip'],
    // if (elementExists('form[id=go-link]') && List.includes(location.host)) {
    //     ReadytoClick('a.btn.btn-success.btn-lg.get-link:not([disabled])', 3);
    //         } else 
    if (!document.querySelector('form[id=go-link]')) return;
    const $ = unsafeWindow.jQuery;

    $('form[id=go-link]').off('submit').on('submit', function(e) {
        e.preventDefault();
        let form = $(this),
            url = form.attr('action');
        $.ajax({
            type: 'POST',
            url: url,
            data: form.serialize(),
            dataType: 'json',
            success: function(result, status, xhr) {
                let finalUrl = result.url;
                if (finalUrl.includes('swiftcut.xyz')) {
                    finalUrl = finalUrl.replace(/[?&]i=[^&]/g, '').replace(/[?]&/, '?').replace(/&&/, '&').replace(/[?&]$/, '');
                    location.href = finalUrl;
                } else {
                    goTo(finalUrl);
                }
            },
            error: function(xhr, status, error) {
                // BpNote(`AJAX request failed: ${status} - ${error}`, 'error');
            }
        });
    });
})

/*
Some of the click scripts may not work because they rely on outdated selectors referencing other elements. Each such script will need to be reviewed and updated.
*/
clickIfHost('the2.link', '#get-link-btn');
clickIfHost('keeplinks.org', '#btnchange');
clickIfHost('forex-22.com', '#continuebutton');
clickIfHost('1shortlink.com', '#redirect-link');
clickIfHost('1ink.cc|cuturl.cc', '#countingbtn');
clickIfHost('1short.io', '#countDownForm');
clickIfHost('disheye.com', '#redirectForm');
clickIfHost('aysodamag.com', '#link1s-form');
clickIfHost('cryptonewssite.rf.gd', '#dynamic-button a');
clickIfHost('1bitspace.com', '.button-element-verification');
clickIfHost('cshort.org', '.timer.redirect');
clickIfHost('ac.totsugeki.com', '.btn-lg.btn-success.btn');
clickIfHost('revlink.pro', '#main-content-wrapper > button');
clickIfHost('panyhealth.com', 'form[method=\'get\']');
clickIfHost('minhapostagem.top', '#alf_continue.alf_button');
clickIfHost('karyawan.co.id', 'button#btn.bg-blue-100.text-blue-600');
clickIfHost('yoshare.net|olhonagrana.com', '#yuidea, #btn6');
clickIfHost('slink.bid', '.btn-success.btn, #btn-generate');
clickIfHost('blog.yurasu.xyz', '#wcGetLink, #gotolink');
clickIfHost('zegtrends.com', '#cln, #bt1, #go');
clickIfHost('creditsgoal.com', '#tp-snp2, //button[normalize-space(text())=\'Continue\']');
clickIfHost('(howifx|vocalley|financerites|yogablogfit|healthfirstweb|junkyponk|mythvista|blog-myst).com|ss7.info|sololevelingmanga.pics', '#getlink')
clickIfHost(
    '(marketrook|governmentjobvacancies|swachataparnibandh|goodmorningimg|odiadance|newkhabar24|aiperceiver|kaomojihub|arkarinaukrinetwork|topgeninsurance).com|(winezones|kabilnews|myscheme.org|mpsarkarihelp|dvjobs|techawaaz).in|(biharhelp|biharkhabar).co|wastenews.xyz|biharkhabar.net',
    'a#btn7, #open-link > .pro_btn, form[name=\'dsb\'], //button[normalize-space(text())=\'Continue\']'
);
clickIfHost('ouo.(io|press)', 'button#btn-main.btn.btn-main');
clickIfHost('(keedabankingnews|aceforce2apk).com|themezon.net|healthvainsure.site|rokni.xyz|bloggingwow.store|dsmusic.in|vi-music.app', 'form[name=\'tp\'], #tp-snp2');
//It’s probably not working because the element loads later, but this can be fixed by creating a function that uses shorter text.
clickIfHost('teknoasian.com', '//button[contains(normalize-space(text()), \'Link\') or normalize-space(text())=\'Continue\' or normalize-space(text())=\'Click To Verify\']')
clickIfHost('(fourlinez|newsonnline|phonesparrow|creditcarred|stockmarg).com|(alljntuworld|updatewallah|vyaapaarguru|viralmp3.com|sarkarins).in', '#continue-show');
clickIfHost('knowiz0.blogspot.com', 'button#nextBtn');
clickIfHost('(jobmatric|carjankaari).com|techsl.online', 'form[name=\'rtg\'], #btn6');
clickIfHost('(viralxns|uploadsoon).com', '#tp-snp2.tp-blue.tp-btn, .tp-white.tp-btn');
clickIfHost('(blogsward|coinjest).com', '#continueBtn');
clickIfHost('dogefury.com|thanks.tinygo.co', '#form-continue');
clickIfHost('almontsf.com', '#nextBtn, a.btn-moobiedat');
clickIfHost('short.croclix.me|adz7short.space', '#link, input#continue, continue.button, #btn-main');
clickIfHost('techkhulasha.com|itijobalert.in', '#waiting > div > .bt-success, //button[normalize-space(text())=\'Open-Continue\']')
runIfHost('offerwall.me|ewall.biz', clickAfterCaptcha, '#submitBtn')
runIfHost('shortlinks2btc.somee.com', clickAfterCaptcha, '#btLogin');
runIfHost('playpaste.com', clickAfterCaptcha, 'button.btn');
runIfHost('jioupload.icu', clickAfterCaptcha, '#continueBtn');
runIfHost('(bnbfree|freeth|freebitco).in', clickAfterCaptcha, '#free_play_form_button');
runIfHost('revly.click|(clikern|kiddyshort|adsssy).com|mitly.us|link.whf.bz|shortex.in|(easyshort|shorturlearn).xyz', () => {
    //The initial implementation wasn’t good, so I changed it to work in mitly, but it might not work in other.
    clickAfterCaptcha('#link-view:has(#captchaShortlink)');
    clickSel('.col-md-12 form:not(:has(#captchaShortlink))'); //:has(.get-link:not(.disabled)) #go-link
});
runIfHost('(lakhisarainews|vahanmitra24).in', () => {
    clickSel('form[name=\'dsb\']');
    elementRedirect('a#btn7');
});
runIfHost('tutwuri.id|(besargaji|link2unlock).com', () => {
    clickSel('#submit-button, #btn-2, #verify > a, #verify > button');
    clickAfterCaptcha('#btn-3');
});
runIfHost('wp.thunder-appz.eu.org|blog.adscryp.com', () => {
    clickSel('form[name=\'dsb\']');
    elementRedirect('#button3 > a');
});
runIfHost('(fitnesswifi|earnmoneyyt|thardekho|dinoogaming|pokoarcade|hnablog|orbitlo|finquizy|indids|redfea|financenuz|pagalworldsong).com|(ddieta|lmktec).net|(bankshiksha|odiadjremix).in|vbnmx.online', () => {
    elementRedirect('div[id^=\'rtg-\'] > a:nth-child(1)');
    clickSel('#rtg, #rtg-snp21 .rtg_btn, #rtg-snp2, #rtg-snp21 > button');
});
runIfHost('solidcoins.net|fishingbreeze.com', () => {
    clickAfterCaptcha('form[action]');
    clickSel('mdn');
});
runIfHost('(lyricsbaazaar|ezeviral).com', () => {
    clickAfterCaptcha('#btn6');
    elementRedirect('div.modal-content a');
});
runIfHost('financemonk.net', () => {
    clickAfterCaptcha('#downloadBtnClick');
    clickSel('#dllink');
});
runIfHost('rotizer.net', clickAfterCaptcha, '//button[normalize-space(text())=\'Confirm\']');
runIfHost('lksfy.com', clickAfterCaptcha, '.get-link.btn-primary.btn');
runIfHost('(ez4mods|game5s|sharedp|fastcars1|carbikenation).com|tech5s.co|a4a.site|rcccn.in', () => {
    clickSel('div.text-center form, #go_d');
    elementRedirect('a#go_d.submitBtn.btn.btn-primary, a#go_d2.submitBtn.btn.btn-primary');
});
runIfHost('cryptorotator.website', () => {
    clickSel('#alf_continue:not([disabled]), //div[contains(@class,\'btn\') and contains(normalize-space(.),\'Click here to unlock\']');
    clickAfterCaptcha('#invisibleCaptchaShortlink');
});
runIfHost('filedm.com', async () => {
    const element = await waitForElement('#dlbutton');
    goTo(`http://cdn.directfiledl.com/getfile?id=${element.href.split('_')[1]}`);
});
runIfHost('4hi.in|(10short|animerigel|encurt4|encurtacash).com|finish.wlink.us|passivecryptos.xyz|fbol.top|kut.li|shortie.sbs|zippynest.online|faucetsatoshi.site|tfly.link|oii.si', () => {
    clickSel('#form-continue');
    clickAfterCaptcha('#link-view');
});
runIfHost('(forexrw7|forex-articles|3rabsports|fx-22|watchtheeye).com|(offeergames|todogame).online|whatgame.xyz|gold-24.net', () => {
    clickSel('.oto > a:nth-child(1)');
    elementRedirect('.oto > a');
});

autoDownloadIfHost('upload.ee', clickSel, '#d_l');
autoDownloadIfHost('f2h.io', clickSel, '.btn-success');
autoDownloadIfHost('send.now', clickSel, '#downloadbtn');
autoDownloadIfHost('dayuploads.com', clickSel, '#ad-link2');
autoDownloadIfHost('workupload.com', clickSel, '.btn-prio.btn');
autoDownloadIfHost('docs.google.com', clickSel, '#downloadForm');
autoDownloadIfHost('gofile.io', clickSel, 'button.item_download');
autoDownloadIfHost('dddrive.me', clickSel, '.btn-outline-primary');
autoDownloadIfHost('ify.ac|go.linkify.ru', unsafeWindow?.open_href);
autoDownloadIfHost('easyupload.io', clickSel, '.start-download.div');
autoDownloadIfHost('karanpc.com', clickSel, '#downloadButton > form');
autoDownloadIfHost('krakenfiles.com', clickSel, '.download-now-text');
autoDownloadIfHost('file-upload.net', clickSel, '#downbild.g-recaptcha');
autoDownloadIfHost('dbree.me', clickSel, '.center-block.btn-default.btn');
autoDownloadIfHost('rapidgator.net', clickSel, '.btn-free.act-link.link');
autoDownloadIfHost('mp4upload.com', clickSel, '#todl, form[name=\'F1\']');
autoDownloadIfHost('freepreset.net', elementRedirect, 'a#button_download');
autoDownloadIfHost('filemoon.sx', elementRedirect, 'div.download2 a.button');
autoDownloadIfHost('dropgalaxy.com', clickSel, 'button[id^=\'method_fre\']');
autoDownloadIfHost('apkadmin.com', elementRedirect, 'div.text.text-center a');
autoDownloadIfHost('drop.download', clickSel, '#method_free, .btn-download');
autoDownloadIfHost('fileresources.net', elementRedirect, 'a.btn.btn-default');
autoDownloadIfHost('megaupto.com', clickSel, '#direct_link > a:nth-child(1)');
autoDownloadIfHost('1fichier.com', clickSel, '.btn-orange.btn-general.ok, .alc');
autoDownloadIfHost('douploads.net', clickSel, '.btn-primary.btn-lg.btn-block.btn');
autoDownloadIfHost('anonymfile.com|sharefile.co|gofile.to', elementRedirect, 'a.btn-info');
autoDownloadIfHost('uploadhaven.com', clickSel, '.alert > a:nth-child(1), #form-download');
autoDownloadIfHost('takefile.link', clickSel, 'div.no-gutter:nth-child(2) > form:nth-child(1)');
autoDownloadIfHost('files.fm', clickSel, '#head_download__all-files > div > div > a:nth-child(1)');
autoDownloadIfHost('hxfile.co|ex-load.com|megadb.net', clickSel, '.btn-dow.btn, form[name=\'F1\']');
autoDownloadIfHost('turbobit.net', () => {
    elementRedirect('#nopay-btn, #free-download-file-link')
    clickAfterCaptcha('#submit');
});
autoDownloadIfHost('uploady.io', () => {
    clickAfterCaptcha('#downloadbtn');
    clickSel('#free_dwn, .rounded.btn-primary.btn', 2);
});
autoDownloadIfHost('mega4upload.net', () => {
    clickSel('input[name=mega_free]');
    clickAfterCaptcha('#downloadbtn');
});
autoDownloadIfHost('ilespayouts.com', () => {
    clickSel('input[name=\'method_free\']');
    clickAfterCaptcha('#downloadbtn');
});
autoDownloadIfHost('hitfile.net', () => {
    clickAfterCaptcha('#submit');
    clickSel('.nopay-btn.btn-grey');
    elementRedirect('#popunder2');
});
autoDownloadIfHost('up-4ever.net', () => {
    clickSel('input[name=\'method_free\'], #downLoadLinkButton');
    clickAfterCaptcha('#downloadbtn');
});
autoDownloadIfHost('up-load.io|downloadani.me', () => {
    clickSel('input[name=\'method_free\'], .btn-dow.btn', 2);
    clickAfterCaptcha('#downloadbtn');
});
autoDownloadIfHost('file-upload.org', () => {
    clickSel('button[name=\'method_free\'], .download-btn', 2);
    clickAfterCaptcha('#downloadbtn');
});
autoDownloadIfHost('mexa.sh', () => {
    clickSel('#Downloadfre, #direct_link');
    clickAfterCaptcha('#downloadbtn');
});
autoDownloadIfHost('qiwi.gg', () => {
    clickSel('button[class^=\'DownloadButton_ButtonSoScraperCanTakeThisName\']');
    elementRedirect('a[class^=\'DownloadButton_DownloadButton\']');
});
autoDownloadIfHost('sharemods.com', () => {
    clickSel('#dForm');
    elementRedirect('a#downloadbtn.btn.btn-primary');
});
autoDownloadIfHost('dailyuploads.net', () => {
    clickAfterCaptcha('#downloadbtn');
    clickSel('#fbtn1', 2);
});
autoDownloadIfHost('udrop.com', async () => {
    const element = await waitForElement('.responsiveMobileMargin > button:nth-child(1)');
    const link = /openUrl('(.*)')/.match(element.getAttribute('onclick'));
    logger.log('match result', {
        link
    });
    goTo(link);
});
autoDownloadIfHost('k2s.cc', () => {
    clickSel('.button-download-slow');
    elementRedirect('a.link-to-file');
});
autoDownloadIfHost('desiupload.co', () => {
    clickSel('.downloadbtn.btn-block.btn-primary.btn');
    elementRedirect('a.btn.btn-primary.btn-block.mb-4');
});

/*
It should work without any issues.
*/
runIfHost('(fc-lc|thotpacks).xyz', async function() {
    clickSel('#invisibleCaptchaShortlink:not([disabled])');
    const element = await waitForElement('script');
    const target = element.textContent.match(/https?:\/\/[^\s'"]+/g);
    target && goTo(target)
})
redirectIfHost('adfoc.us', '.skip');
redirectIfHost('lanza.me', 'a#botonGo');
redirectIfHost('lolinez.com', 'p#url a');
redirectIfHost('coincroco.com|surflink.tech|cointox.net', '.mb-sm-0.mt-3.btnBgRed');
redirectIfHost('8tm.net', 'a.btn.btn-secondary.btn-block.redirect');
redirectIfHost('bestfonts.pro', '.download-font-button > a:nth-child(1)');
redirectIfHost('cpmlink.net', 'a#btn-main.btn.btn-warning.btn-lg');
redirectIfHost('noodlemagazine.com', 'a#downloadLink.downloadBtn');
redirectIfHost('mirrored.to', 'div.col-sm.centered.extra-top a, div.centerd > a');
redirectIfHost('mohtawaa.com', 'a.btn.btn-success.btn-lg.get-link.enabled');
redirectIfHost('(techleets|bonloan).xyz|sharphindi.in|nyushuemu.com', 'a#tp-snp2');
redirectIfHost('linksly.co', 'div.col-md-12 a');
redirectIfHost('surl.li|surl.gd', '#redirect-button');
runIfHost('linkbox.to', () => {
    httpListener(function(xhr) {
        if (!xhr.url.includes('api/file/detail?itemId')) {
            return;
        }
        const {
            data: {
                itemInfo
            }
        } = JSON.parse(xhr.responseText);
        goTo(itemInfo.url);
    });
});
//

clickIfHost('imagereviser.com', '.bottom_btn');
redirectIfHost('amanguides.com', '#wpsafe-link > .bt-success');
clickIfHost('stockmarg.com', '#codexa, #open-continue-btn');
redirectIfHost('(michaelemad|7misr4day).com', 'a.s-btn-f');
clickIfHost('(dramaticqueen|emubliss).com', '#notarobot.button, #btn7');
runIfHost('tempatwisata.pro', () => {
    const buttons = ['Generate Link', 'Continue', 'Get Link', 'Next'].map(text => `//button[normalize-space(text())='${text}']`);
    clickSel(buttons.join(', '));
});

runIfHost('tii.la|oei.la|iir.la|tvi.la|oii.la|tpi.li', clickAfterCaptcha, '#continue');
runIfHost('askpaccosi.com|cryptomonitor.in', clickAfterCaptcha, 'form[name=\'dsb\']')
clickIfHost('largestpanel.in|(djremixganna|financebolo|emubliss).com|(earnme|usanewstoday).club|earningtime.in', '#tp-snp2');
runIfHost('adoc.pub', () => {
    clickSel('.btn-block.btn-success.btn', 2);
    clickAfterCaptcha('.mt-15.btn-block.btn-success.btn-lg.btn');
});
runIfHost('usersdrive.com|ddownload.com', () => {
    clickAfterCaptcha('#downloadbtn');
    clickSel('.btn-download.btn', 1);
});
runIfHost('pdfcoffee.com', () => {
    clickSel('.btn-block.btn-success.btn');
    clickAfterCaptcha('.my-2.btn-block.btn-primary.btn-lg.btn');
});
clickIfHost('(zygina|jansamparks).com|(loanifyt|getknldgg).site|topshare.in|btcon.online', 'form[name=\'tp\'], #btn6');
clickIfHost('(financewada|utkarshonlinetest).com|financenova.online', '.get_btn.step_box > .btn, .get_btn a[href]');
runIfHost('(blogmado|kredilerim|insuranceleadsinfo).com', () => {
    clickAfterCaptcha('button.btn');
    elementRedirect('a.get-link.disabled a');
});
runIfHost('litecoin.host|cekip.site', () => {
    clickAfterCaptcha('#ibtn');
    clickSel('.btn-primary.btn');
});

redirectIfHost('linkforearn.com', '#shortLinkSection a');
clickIfHost('downfile.site', 'button.h-captcha, #megaurl-submit', 2);
runIfHost('shortfaster.net', () => {
    const twoMinutesAgo = Date.now() - 2 * 60 * 1000;
    localStorage.setItem('lastRedirectTime_site1', twoMinutesAgo.toString());
});
autoDownloadIfHost('doodrive.com', () => {
    clickSel('.tm-button-download.uk-button-primary.uk-button', 3);
    elementRedirect('.uk-container > div > .uk-button-primary.uk-button');
});
clickIfHost('(uploadrar|fingau|getpczone|wokaz).com|uptomega.me', '.mngez-free-download, #direct_link > a:nth-child(1), #downloadbtn');
clickIfHost('jobinmeghalaya.in', '#bottomButton, a#btn7, #wpsafelink-landing, #open-link > .pro_btn, #wpsafe-link > .bt-success');
clickIfHost('playnano.online', '#watch-link, .watch-next-btn.btn-primary.button, button.button.btn-primary.watch-next-btn');
runIfHost('aylink.co|cpmlink.pro', async () => {
    clickIfHost('.btn.btn-go, .btn-go');
    const element = await waitForElement('#main');
    const link = /window.open\('(.*)'\)/.match(element.getAttribute('onclick'));
    goTo(link);
});
redirectIfHost('sub2get.com', '#butunlock > a:nth-child(1)')
redirectIfHost('o-pro.online', '#newbutton, a.btn.btn-default.btn-sm');
// redirectIfHost('oxy\.', '.ocdsf233', 'data-source_url'); // need a more specific pattern

autoDownloadIfHost('buzzheavier.com', clickSel, '#download-link');
autoDownloadIfHost('bowfile.com', clickSel, '.download-timer > .btn--primary.btn > .btn__text');
autoDownloadIfHost('uploadev.org', () => {
    clickAfterCaptcha('#downloadbtn');
    clickSel('#direct_link > a', 2);
});
autoDownloadIfHost('megaup.net', clickSel, 'a.btn.btn-default, #btndownload');
autoDownloadIfHost('gdflix.dad', clickSel, 'a.btn.btn-outline-success');
redirectIfHost('linkspy.cc', '.skipButton');
clickIfHost('(superheromaniac|spatsify|mastkhabre|ukrupdate).com', '#tp98, #btn6, form[name=\'tp\']');
clickIfHost('(bestloansoffers|worldzc).com|earningtime.in', '#rtg, #rtg-form, .rtg-blue.rtg-btn, #rtg-snp21 > button');
clickIfHost('(exeo|exego).app|(falpus|exe-urls|exnion).com|4ace.online', '#invisibleCaptchaShortlink, #before-captcha');
runIfHost('dinheiromoney.com', () => {
    clickSel('div[id^=\'button\'] form');
    elementRedirect('div[id^=\'button\'] center a');
});
runIfHost('writedroid.eu.org|modmania.eu.org|writedroid.in', () => {
    clickSel('#shortPostLink');
    elementRedirect('#shortGoToLink');
});
autoDownloadIfHost('katfile.com', () => {
    clickAfterCaptcha('#downloadbtn');
    clickSel('#fbtn1');
    elementRedirect('#dlink');
});
clickIfHost('setroom.biz.id|travelinian.com', 'form[name=\'dsb\'], a:nth-child(1) > button');
redirectIfHost('(g34new|dlgamingvn|v34down|phimsubmoi|almontsf).com|(nashib|timbertales).xyz', '#wpsafegenerate > #wpsafe-link > a[href]');
runIfHost('earnbee.xyz|zippynest.online|getunic.info', () => {
    localStorage.setItem('earnbee_visit_data', JSON.stringify({
        firstUrl: currentUrl,
        timestamp: Date.now() - 180000
    }));
});
runIfHost('2linkes.com', () => {
    clickAfterCaptcha('#link-view');
    clickSel('.box-body > form:nth-child(2)');
});
runIfHost('(importantclass|hamroguide).com', () => {
    clickSel('#pro-continue, #pro-link a');
    elementRedirect('#my-btn.pro_btn');
});
runIfHost('nishankhatri.xyz|(bebkub|owoanime|hyperkhabar).com', () => {
    clickSel('#pro-continue, #my-btn');
    elementRedirect('a#pro-btn');
});
clickIfHost('gocmod.com', '.download-line-title');
runIfHost('(travelironguide|businesssoftwarehere|softwaresolutionshere|freevpshere|masrawytrend).com', () => {
    clickAfterCaptcha('#lview > form', 'submit');
    elementRedirect('.get-link > a');
});
runIfHost('gocmod.com', parameterRedirect, '$urls');
runIfHost('api.gplinks.com', parameterRedirect, '$url');
runIfHost('rfaucet.com', parameterRedirect, '$linkAlias');
runIfHost('maloma3arbi.blogspot.com', parameterRedirect, '$link');
runIfHost('financenuz.com', parameterRedirect, 'https://financenuz.com/?web=$url');
runIfHost('thepragatishilclasses.com', parameterRedirect, 'https://thepragatishilclasses.com/?adlinkfly=$url');
runIfHost('coinilium.net', parameterRedirect, '$id');
/* not sure what the +2 is
BypassedByBloggerPemula('(inshort|youlinks|adrinolinks).in|(linkcents|nitro-link).com|clk.sh', null, 'url+2', '');
*/
runIfHost('blog.klublog.com', parameterRedirect, '$safe');
runIfHost('t.me', parameterRedirect, '$url');
runIfHost('dutchycorp.space', parameterRedirect, '$code?verif=0');
runIfHost('tiktok.com', parameterRedirect, '$target');
runIfHost('(facebook|instagram).com', parameterRedirect, '$u');
runIfHost('financedoze.com', parameterRedirect, 'https://www.google.com/url?q=https://financedoze.com', 'id');
// runIfHost('financedoze.com', () => parameterRedirect('https://www.google.com/url?q=https://financedoze.com', 'id'));
clickIfHost('forex-trnd.com', '#exfoary-form');
clickIfHost('cutnet.net|(cutyion|cutynow).com|(exego|cety).app|(jixo|gamco).online', '#submit-button:not([disabled])');
clickIfHost('alorra.com', '.single-layout-1.ast-post-format- > button');
runIfHost('socialwolvez.com', async () => {
    const url = `https://us-central1-social-infra-prod.cloudfunctions.net/linksService/link/guid/${location.pathname.substr(7)}`;
    const data = await fetch(url).then(response => response.json());
    goTo(data.link.url);
});
runIfHost('onlinetechsolution.link', async () => {
    const element = await waitForElement('input[name=newwpsafelink]');
    const data = JSON.parse(atob(element.value));
    goTo(data.linkr);
});
runIfHost('crypto-fi.net|claimcrypto.cc|xtrabits.click|(web9academy|bioinflu|bico8).com|(ourcoincash|studyis).xyz', async () => {
    const element = await waitForElement('#landing [name=\'go\']');
    const target = atob(`aH${element.value.split('aH').slice(1).join('aH')}`);
    goTo(target);
});
runIfHost('rekonise.com', async () => {
    const url = `https://api.rekonise.com/social-unlocks${location.pathname}`;
    const data = await fetch(url).then(response => response.json());
    goTo(data.url);
});
runIfHost('boost.ink', async () => {
    const html = await fetch(currentUrl).then(response => response.text());
    goTo(atob(html.split('bufpsvdhmjybvgfncqfa=\'\')[1].split(\'\'')[0]));
});

runIfHost('flickr.com', async () => {
    if (!cfg.Flickr) return;

    const photoId = currentUrl.match(/\d+/)
    if (!photoId) return;

    const flickrSizes = {
        sq: 'Square 75',
        q: 'Square 150',
        t: 'Thumbnail',
        s: 'Small 240',
        n: 'Small 320',
        w: 'Small 400',
        m: 'Medium 500',
        z: 'Medium 640',
        c: 'Medium 800',
        l: 'Large 1024',
        h: 'Large 1600',
        k: 'Large 2048',
        '3k': 'X-Large 3K',
        '4k': 'X-Large 4K'
    };
    const sizesContainer = await waitForElement('.sizes');

    Object.entries(flickrSizes).forEach(([key, label]) => {
        const element = GM_addElement(sizesContainer, 'li', {
            class: 'download-size-item',
            // textContent: label
        });
        const a = GM_addElement(element, 'a', {
            href: 'javascript:void(0)',
            class: 'download-image-size'
        })
        GM_addElement(a, 'span', {
            class: 'label',
            textContent: label
        })
        element.addEventListener('click', async function() {
            const url = `https://www.flickr.com/photos/zedzap/${photoId}/sizes/${key}/`;
            const html = await fetch(url).then(response => response.text());
            const res = html.match(/<img src="https:\/\/live.staticflickr.com\/(.*)">/);
            GM_download('https://live.staticflickr.com/' + res[1], `BloggerP_${photoId}_${label}.jpeg`);
        });
    });
});

runIfHost('adtival.network', referrerPolicy, 'shortid');
runIfHost('sfl.gl|kisalt.digital', referrerPolicy, 'u');
runIfHost('(kongutoday|proappapk|hipsonyc).com', referrerPolicy, 'safe');
runIfHost('sharetext.me', () => currentUrl.includes('/redirect') && referrerPolicy('url'));
runIfHost('comohoy.com', () => currentUrl.includes('/view/out.html') && referrerPolicy('url'));
runIfHost('(ecryptly|equickle).com', async () => {
    referrerPolicy('id');
    waitForElement('#open-continue-form > input:nth-child(3)').then(e => goTo(atob(e.value)));
    clickSel('#rtg-snp2');
    const element = await waitForElement('#open-continue-btn');
    //TODO: remove the strBetween
    goTo(strBetween(element.getAttribute('onclick'), 'window.location.href=\'', '\';'));
});

runIfHost('(wellness4live|akash.classicoder).com|2the.space|inicerita.online', async () => {
    const element = await waitForElement('#landing');
    const data = JSON.parse(atob(element.newwpsafelink.value));
    goTo(data.linkr);
});
runIfHost('bigbtc.win', () => {
    clickAfterCaptcha('#claimbutn');
    if (currentUrl.includes('/bonus')) {
        clickSel('#clickhere');
    }
});
clickIfHost('vosan.co', '.elementor-size-lg, .wpdm-download-link');

runIfHost('enlacito.com', async () => {
    await waitSec(2);
    goTo(unsafeWindow.DYykkzwP, false);
});
runIfHost('paycut.pro', () => {
    if (currentUrl.includes('/ad/')) {
        goTo(currentUrl.replace('ad/', ''));
    }
});
// TODO: make better regex
runIfHost('bewbin.com', async () => {
    const element = await waitForElement('.wpsafe-top > script:nth-child(4)');
    goTo('https://bewbin.com?safelink_redirect=' + element.textContent.match(/window\.open\('https:\/\/bewbin\.com\?safelink_redirect=([^']+)'/));
});
runIfHost('lajangspot.web.id', async () => {
    const element = await waitForElement('#wpsafe-link > script:nth-child(2)');
    goTo('https://lajangspot.web.id?safelink_redirect=' + element.textContent.match(/window\.open\('https:\/\/lajangspot\.web\.id\?safelink_redirect=([^']+)'/));
});
//

redirectIfHost('xonnews.net|toilaquantri.com|share4u.men|camnangvay.com', 'div#traffic_result a');
runIfHost('easylink.gamingwithtr.com', () => {
    clickSel('#countdown');
    elementRedirect('a#pagelinkhref.btn.btn-lg.btn-success.my-4.px-3.text-center');
})

autoDownloadIfHost('modsbase.com', () => {
    clickSel('.download-file-btn');
    elementRedirect('#downloadbtn > a');
});

autoDownloadIfHost('mediafire.com', () => currentUrl.includes('file/') && elementRedirect('.download_link .input'));
runIfHost('ouo.io', parameterRedirect, '$s');

runIfHost('pixeldrain.com', () => currentUrl.includes('/u/') && goTo(`${currentUrl.replace('u/', '/api/file/')}?download`));
clickIfHost('exblog.jp', '//a[normalize-space(text())=\'Continue To\'], //a[normalize-space(text())=\'NEST ARTICLE\']')

runIfHost('modcombo.com', () => {
    if (currentUrl.includes('download/')) {
        elementRedirect('div.item.item-apk a');
        clickSel('a.btn.btn-submit');
    } else {
        clickSel('a.btn.btn-red.btn-icon.btn-download.br-50');
    }
});
function fakeHidden() {
    Object.defineProperty(document, 'hidden', {
        get: () => true,
        configurable: true
    });
}

// working but still can be improved
runIfHost('coinclix.co|coinhub.wiki|(vitalityvista|geekgrove).net|(instagram|youtube|google|facebook).com', async () => {
    document?.referrer == '' && clickSel('.-cx-PRIVATE-Linkshim__followLink__, #invalid-token-redirect-goto-site-button, .selected');
    /vitalityvista|geekgrove|coinhub/.test(document?.referrer) && queryParams.has('url') && goTo(queryParams.get('url'));

    if (currentUrl.includes('go/')) {
        let tab;
        const code = await waitForElement('.mb-2 code');
        try {
            const link = await waitForElement('strong > a', 1);
            GM_setValue('geek_code', code.innerText);
            tab = GM_openInTab(link.href, {
                active: true
            });
        } catch (e) {
            tab = GM_openInTab(`https://www.google.com/url?q=${document.querySelector('.user-select-none').textContent}`, {
                active: true
            });
        }

        GM_onMessage('finalcode', function(newValue) {
            tab?.close();
            console.log(newValue);

            document.querySelector('#verification_code').value = newValue;
            // clickSel('#btn_link, .btn-primary[href]');
        })
    }

    //TODO REMOVE #btn_link_start:not([disabled])
    clickSel('a.btn:has(.mdi-check), #btn_link_start:not([disabled]), #link_result_footer_btn > #btn_link_continue:not([disabled]), #link_result_header > #btn_lpcont');
    clickAfterCaptcha('#btn_link_continue');
    Checkvisibility('#btn_link_continue', () => {
        clickSel('#btn_link_continue:not(:has(.iconcaptcha-modal)), .iconcaptcha-modal__body');
    });
    Checkvisibility('.alert-success.alert-inline.alert', () => {
        clickSel('#btn_lpcont');
    });
    waitForElement('#link_input.form-control').then((input) => {
        input.value = GM_getValue('geek_code', '');
        clickSel('#btn_link', 1);
    })

    const codeEl = await waitForElement('code.link_code');

    console.log(codeEl.innerText);
    GM_sendMessage('finalcode', codeEl.innerText)
});

runIfHost('shortit.pw', () => {
    clickSel('.pulse.btn-primary.btn');
    clickAfterCaptcha('#btn2');
});

runIfHost('autodime.com|cryptorex.net', () => {
    clickAfterCaptcha('#button1');
    clickSel('.mb-sm-0.mt-3.btnBgRed');
});

clickIfHost('(tmail|labgame).io|(gamezizo|fitdynamos).com', '#surl, form.text-center, #next, #glink');
autoDownloadIfHost('dataupload.net', clickSel, '.downloadbtn');
function clickWithTrusted() {
    const sandbox = new Proxy(window, {
        get(target, key) {
            if (key === 'Object') {
                return new Proxy(Object, {
                    get(objTarget, objKey) {
                        if (objKey === 'freeze') {
                            return function(obj) {
                                console.warn('Object.freeze disabled in sandbox.');
                                return obj;
                            };
                        }
                        return Reflect.get(objTarget, objKey);
                    }
                });
            }
            return Reflect.get(target, key);
        }
    });
 
    const originalAddEventListener = EventTarget.prototype.addEventListener;
    EventTarget.prototype.addEventListener = function(type, listener, options) {
        const wrappedListener = function(event) {
            const clonedEvent = Object.create(event);
            Object.defineProperty(clonedEvent, 'isTrusted', {
                value: true,
                writable: false
            });
            return listener.call(this, clonedEvent);
        };
        return originalAddEventListener.call(this, type, wrappedListener, options);
    };
 
    return sandbox;
}

runIfHost('(admediaflex|cdrab|financekita|jobydt|foodxor|mealcold|newsobjective|gkvstudy|mukhyamantriyojanadoot|thepragatishilclasses|indobo|pdfvale|templeshelp).com|(ecq|cooklike).info|(wpcheap|bitwidgets|newsamp|coinilium).net|atomicatlas.xyz|gadifeed.in|thecryptoworld.site|skyfreecoins.top|petly.lat|techreviewhub.store|mbantul.my.id', async () => {
    const element = await waitForElement('#wpsafe-link a[onclick*=\'window.open\']');
    const onclick = element.getAttribute('onclick');
    goTo(onclick.match(/window.open\('(.*)'\)/));
});
runIfHost('(cryptowidgets|melodyspot|carsmania|cookinguide|tvseriescentral|cinemascene|hobbymania|plantsguide|furtnitureplanet|petsguide|gputrends|gamestopia|ountriesguide|carstopia|makeupguide|gadgetbuzz|coinsvalue|coinstrend|coinsrise|webfreetools|wanderjourney|languagefluency|giftmagic|bitwidgets|virtuous-tech|retrocove|vaultfind|geotides|renovatehub|playallgames|countriesguide).net|(freeoseocheck|insurancexguide|funplayarcade|origamiarthub|fitbodygenius|illustrationmaster|selfcareinsights|constructorspro|ecofriendlyz|virtualrealitieshub|wiki-topia|techiephone|brewmasterly|teknoasian|lifeprovy|chownest|mythnest|homesteadfeast|gizmoera|tastywhiz|speakzyo).com|(bubblix|dailytech-news).eu|(biit|carfocus).site|coinscap.info|insurancegold.in|wii.si', clickWithTrusted);
runIfHost('(cryptowidgets|melodyspot|carsmania|cookinguide|tvseriescentral|cinemascene|hobbymania|plantsguide|furtnitureplanet|petsguide|gputrends|gamestopia|ountriesguide|carstopia|makeupguide|gadgetbuzz|coinsvalue|coinstrend|coinsrise|webfreetools|wanderjourney|languagefluency|giftmagic|bitwidgets|virtuous-tech).net|(freeoseocheck|insurancexguide|funplayarcade|origamiarthub|fitbodygenius|illustrationmaster|selfcareinsights|constructorspro|ecofriendlyz|virtualrealitieshub|wiki-topia|techiephone|brewmasterly).com|(bubblix|dailytech-news).eu|(biit|carfocus|blogfly).site|coinscap.info|insurancegold.in|wii.si', () => {
    clickSel('//button[normalize-space(text())=\'Verify\'], #loadingDiv[style*=\'display: block\'] button, #loadingDiv[style*=\'display: block\'] button');
   
    // if (['dailytech-news.eu', 'wii.si', 'bubblix.eu', 'bitwidgets.net', 'virtuous-tech.net', 'carfocus.site', 'biit.site'].some(tino => currentUrl.includes(tino))) {
    // } 
    // else {
    //     CheckVisibility('#loadingDiv[style^=\'display\'] > span', () => {
    //         const buttonText = strBetween(bp('#loadingDiv[style^=\'display\'] > span').textContent, 'Click', 'To Start', false);
    //         elementReady(`#loadingDiv[style^='display'] .btn.btn-primary:contains('${buttonText}')`).then(buttonElement => {
    //             const buttons = Array.from(bp('#loadingDiv[style^=\'display\'] .btn.btn-primary', true));
    //             const index = buttons.indexOf(buttonElement);
    //             if (index === -1) return;
    //             const selectorOptions = ['button.btn:nth-child(2)', 'button.btn:nth-child(3)', 'button.btn:nth-child(4)', 'button.btn:nth-child(5)', 'button.btn:nth-child(6)'];
    //             const chosenSelector = selectorOptions[index];
    //             if (chosenSelector) sleep(2000).then(() => ReadytoClick(`#loadingDiv[style^='display'] ${chosenSelector}`));
    //         });
    //     });
    // }
    waitForElement('#clickMessage[style*=\'display: block\'], clickMessage[style*=\'display: block\']').then(() => {
        setActiveElement('[data-placement-id=\'revbid - leaderboard\']');
        fakeHidden();
    });
});


runIfHost('programasvirtualespc.net', () => currentUrl.includes('out/') && goTo(atob(currentUrl.split('?')[1])));
runIfHost('(grtjobs|jksb).in', () => {
    Checkvisibility('.step', unsafeWindow.handleContinueClick);
});

//TODO: with the link, I can improve this further
runIfHost('autofaucet.dutchycorp.space', function() {
    let autoRoll = false;
    if (/(coin_roll|roll_game).php|/.test(currentUrl)) {
        window.scrollTo(0, 9999);
        if (!document.querySelector('#timer')) {
            captchaSolved(async () => {
                autoRoll === false && (await clickSel('.boost-btn.unlockbutton'), autoRoll = true)
                clickSel('#claim_boosted');
            });
        } else {
            const isRoll = currentUrl.includes('/coin_roll.php');
            goTo(`https://autofaucet.dutchycorp.space/${isRoll ? 'coin_roll.php' : 'ptc/wall.php'}`);
        }
    }
    if (currentUrl.includes('/ptc/wall.php')) {
        const ptcwall = document.querySelectorAll('.col.s10.m6.l4 a[name=\'claim\']');
        if (ptcwall.length >= 1) {
            ptcwall[0].style.backgroundColor = 'red';
            let match = ptcwall[0].onmousedown.toString().match(/'href', '(.+)'/);
            let hrefValue = match[1];
            goTo('https://autofaucet.dutchycorp.space' + hrefValue);
        } else {
            Checkvisibility('div.col.s12.m12.l8 center div p', () => {
                goTo('https://autofaucet.dutchycorp.space/ptc/');
            })
        }
        if (currentUrl.includes('.space/ptc/')) {
            if (document.querySelector('.fa-check-double')) {
                goTo('https://autofaucet.dutchycorp.space/dashboard.php');
            }
            clickAfterCaptcha('button[type=\'submit\']')
        }
    }
});


runIfHost('apkw.ru', () => currentUrl.includes('/away') && goTo(atob(currentUrl.split('/').slice(-1))));
clickIfHost('(devnote|formshelp|rcccn).in|djbassking.live', '#getlinks.btn');

runIfHost('4fnet.org', () => currentUrl.includes('/goto') && goTo(atob(currentUrl.split('/').slice(-1))));
runIfHost('anonym.ninja', () => currentUrl.includes('download/') && goTo(`https://anonym.ninja/download/file/request/${currentUrl.split('/').slice(-1)[0]}`));

runIfHost('vk.com', () => queryParams.has('to') && currentUrl.includes('/away.php') && goTo(decodeURIComponent(queryParams.get('to'))));


runIfHost('(tinybc|phimne).com|(mgame|sportweb|bitcrypto).info', async () => {
    const element = await waitForElement('#wpsafe-link a[onclick*=\'handleClick\']')
    const target = element.getAttribute('onclick').match(/handleClick\('([^']+)'\)/);
    target && goTo(target);
});

runIfHost('curto.win', () => {
    clickSel('#get-link');
    elementRedirect('#get-link');
});

runIfHost('(tejtime24|drinkspartner|sportswordz|newspute).com|(raftarsamachar|gadialert|jobinmeghalaya|raftarwords).in', () => {
    window.scrollTo(0, 9999);
    clickSel('#topButton.pro_btn, #bottomButton, #open-link > .pro_btn');
});

runIfHost('mazen-ve3.com', async () => {
    await waitForElement('//*[contains(concat(\' \', normalize-space(@class), \' \'), \' filler \') and normalize-space(text())=\'Wait 0 s\']');
    clickSel('#btn6, .btn-success.btn');
});

runIfHost('adbtc.top', async () => {
    clickAfterCaptcha('input[class^=btn]');
    const link = await waitForElement('div.col.s4 > a');
    if (!link.classList.contains('hide')) {
        link.click();
    }
    window.onbeforeunload = () => {
        unsafeWindow?.myWindow.close();
        unsafeWindow?.coinwin?.close();
        unsafeWindow.coinwin = {};
    };
});

runIfHost('yitarx.com', () => currentUrl.includes('enlace/') && goTo(atob(atob(atob(currentUrl.split('#!')[1])))));

autoDownloadIfHost('oydir.com', async () => {
    await waitForElement('.download-now');
    unsafeWindow.triggerFreeDownload();
    elementRedirect('.text-center.download-now > .w-100.btn-blue.btn');
});

runIfHost('triggeredplay.com', () => {
    if (currentUrl.includes('#')) {
        let usp = new URLSearchParams(location.hash.substring(1));
        usp.has('url') && goTo(atob(usp.get('url')));
    }
});

clickIfHost('pubghighdamage.com|anmolbetiyojana.in', '#robot, #notarobot.button, #gotolink.bt-success.btn');
/*
BypassedByBloggerPemula('headlinerpost.com|posterify.net', () => {
    let dataValue = '';
    for (let script of bp('script', true)) {
        if (script.textContent.includes('data:')) {
            dataValue = strBetween(script.textContent, 'data: '
                ', '
                '', true);
            break;
        }
    }
    let stepValue = '',
        planValue = '';
    try {
        const plan = JSON.parse(RSCookie('read', 'plan') || '{}');
        stepValue = plan.lid || '';
        planValue = plan.page || '';
    } catch {}
    if (!dataValue || !stepValue) return;
    const postData = {
        data: dataValue
    };
    const sid = RSCookie('read', 'sid');
    postData[sid ? 'step_2' : 'step_1'] = stepValue;
    if (sid) postData.id = sid;
    const isHeadliner = location.host === 'headlinerpost.com';
    const headers = {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Referer': isHeadliner ? 'https://headlinerpost.com/' : 'https://posterify.net/',
        'Origin': isHeadliner ? 'https://headlinerpost.com' : 'https://posterify.net'
    };
    GM_xmlhttpRequest({
        method: 'POST',
        url: 'https://shrinkforearn.in/link/new.php',
        headers,
        data: Object.keys(postData).map(k => `${encodeURIComponent(k)}=${encodeURIComponent(postData[k])}`).join('&'),
        withCredentials: true,
        onload: ({
            responseText
        }) => {
            try {
                const result = JSON.parse(responseText);
                if (result.inserted_data?.id) {
                    RSCookie('set', 'sid', result.inserted_data.id, 10 / (24 * 60));
                }
                if ((result.inserted_data?.id || result.updated_data) && (sid || result.inserted_data?.id)) {
                    const ShrinkUrl = isHeadliner ? `https://posterify.net/?id=${encodeURIComponent(stepValue)}&sid=${encodeURIComponent(result.inserted_data?.id || sid)}&plan=${encodeURIComponent(planValue)}` : `https://shrinkforearn.in/${encodeURIComponent(stepValue)}?sid=${encodeURIComponent(result.inserted_data?.id || sid)}`;
                    setTimeout(() => redirect(ShrinkUrl), 3000);
                }
            } catch {}
        }
    });
});
    // runIfHost('(cryptosparatodos|placementsmela|howtoconcepts|tuasy|skyrimer|yodharealty|mobcupring|aiimsopd|advupdates|camdigest|heygirlish|blog4nx|todayheadliners|jobqwe|cryptonews.faucetbin|mobileflashtools).com|(paidinsurance|djstar|sevayojana|bjp.org).in|(sastainsurance|nashib).xyz|(cialisstrong|loanforuniversity).online|(cegen|thunder-appz.eu).org|zaku.pro|veganab.co|skyfreecoins.top|manga4nx.site', () => 
//     waitForElm('#wpsafe-link a', bti => redirect(strBetween(bti.onclick.toString(), `window.open('`, `', '_self')`), false)));


const sl = (h => {
    switch (h.host) {
        case 'go.paylinks.cloud':
            if (/^\/([a-zA-Z0-9]{10,12})$/.test(h.pathname)) {
                return 'https://paylinks.cloud/' + RegExp.$1;
            }
            break;
        case 'multiup.io':
            if (h.href.includes('/download/')) return h.href.replace('download/', 'en/mirror/');
            break;
        case 'modsfire.com':
            if (/^\/([^\/]+)/.test(h.pathname)) {
                return 'https://modsfire.com/d/' + RegExp.$1;
            }
            break;
        case 'social-unlock.com':
            if (/^\/([^\/]+)/.test(h.pathname)) {
                return 'https://social-unlock.com/redirect/' + RegExp.$1;
            }
            break;
        case 'work.ink':
            if (/^\/([^\/]+)/.test(h.pathname)) {
                return 'https://adbypass.org/bypass?bypass=' + location.href.split('?')[0];
            }
            break;
    }
})(new URL(location.href));
if (sl) {
    location.href = sl;
}
const bas = (h => {
    const b = h.pathname === '/verify/' && /^\?([^&]+)/.test(h.search);
    const result = {
        isNotifyNeeded: false,
        redirectDelay: 0,
        link: undefined
    };
    switch (h.host) {
        case 'gamezigg.com':
            if (b) {
                meta('https://get.megafly.in/' + RegExp.$1);
            }
            break;
        case 'shrs.link':
        case 'shareus.io':
            if (/^\/old\/([^\/]+)/.test(h.pathname)) {
                return 'https://jobform.in/?link=' + RegExp.$1;
            }
            break;
        default:
            break;
    }
})(new URL(location.href));
if (bas) {
    const {
        isNotifyNeeded,
        redirectDelay,
        link
    } = bas;
    if (isNotifyNeeded) {
        notify(`Please Wait You Will be Redirected to Your Destination in @ Seconds , Thanks`);
    }
    setTimeout(() => {
        location.href = link;
    }, redirectDelay * 1000);
}
BypassedByBloggerPemula(/render-state.to/, () => {
    if (BpParams.has('link')) {
        unsafeWindow.goToLink();
    }
});

BypassedByBloggerPemula(/fansonlinehub.com/, async function() {
    setInterval(() => {
        window.scrollBy(0, 1);
        window.scrollTo(0, -1);
        ReadytoClick('.active.btn > span');
    }, 3 * 1000);
});
BypassedByBloggerPemula(/(financenube|mixrootmods|pastescript|trimorspacks).com/, () => {
    waitForElm('#wpsafe-link a', cdr => redirect(strBetween(cdr.onclick.toString(), `window.open('`, `', '_self')`), false));
});
BypassedByBloggerPemula(/mboost.me/, () => {
    if (elementExists('#firstsection')) {
        let mbo = bp('#__NEXT_DATA__');
        let mbm = JSON.parse(mbo.textContent).props.pageProps.data.targeturl;
        setTimeout(() => {
            redirect(mbm, false);
        }, 2 * 1000);
    }
});
BypassedByBloggerPemula(/(aduzz|tutorialsaya|baristakesehatan|merekrut).com|deltabtc.xyz|bit4me.info/, () => {
    waitForElm('div[id^=wpsafe] > a[rel=nofollow]', tiny => redirect(strBetween(tiny.onclick.toString(), `window.open('`, `', '_self')`), false));
});

BypassedByBloggerPemula(/flamebook.eu.org/, async () => {
    const flame = ['#button1', '#button2', '#button3'];
    for (const fbook of flame) {
        await sleep(3000);
        ReadytoClick(fbook);
    }
});
BypassedByBloggerPemula(/(bchlink|usdlink).xyz/, () => {
    AIORemover('removeAttr', '#antiBotBtnBeta', 'onclick');
    DoIfExists('#antiBotBtnBeta > strong', 2);
    CaptchaDone(() => {
        DoIfExists('#invisibleCaptchaShortlink');
    });
});
BypassedByBloggerPemula(/jobzhub.store/, () => {
    DoIfExists('#surl', 5);
    if (elementExists('#next')) {
        unsafeWindow.startCountdown();
        DoIfExists('form.text-center', 'submit', 15);
    }
});
BypassedByBloggerPemula(/infonerd.org/, () => {
    CheckVisibility('#redirectButton', '||', 'bp('
        #countdown ').innerText == '0 '', () => {
            unsafeWindow.redirectToUrl();
        });
});
BypassedByBloggerPemula(/videolyrics.in/, () => {
    ReadytoClick('a:contains('
        Continue ')', 3);
    CheckVisibility('button[class^='py - 2 px - 4 font - semibold ']', () => {
            DoIfExists('div[x-html='isTCompleted '] button');
        });
});
BypassedByBloggerPemula(/coinsrev.com/, () => {
    parent.open = BpBlock();
    CaptchaDone(() => {
        DoIfExists('#wpsafelinkhuman > input');
    });
    DoIfExists('#wpsafe-generate > a > img', 3);
    DoIfExists('input#image3', 13);
});
BypassedByBloggerPemula(/indobo.com/, () => {
    const scriptElement = bp('#wpsafegenerate > script:nth-child(4)');
    if (scriptElement) {
        const scriptContent = scriptElement.textContent;
        const url = strBetween(scriptContent, 'window.location.href = '
            ', '
            ';', true);
        if (url && url.startsWith('https://indobo.com?safelink_redirect=')) {
            setTimeout(() => redirect(url), 2000);
        }
    }
});
BypassedByBloggerPemula(/techxploitz.eu.org/, () => {
    CheckVisibility('#hmVrfy', () => {
        DoIfExists('.pstL.button', 2);
    });
    CheckVisibility('#aSlCnt', () => {
        DoIfExists('.pstL.button', 2);
        ReadytoClick('.safeGoL.button', 3);
    });
});

BypassedByBloggerPemula(/(financedoze|topjanakri|stockbhoomi).com|techhype.in|getpdf.net|cryptly.site/, () => {
    CheckVisibility('p:contains('
        Step ')', () => {
            DoIfExists('#rtg', 'submit', 3);
            DoIfExists('button:innerText('
                Open - Continue ')', 4);
        });
});

BypassedByBloggerPemula(/servicemassar.ma/, () => {
    CaptchaDone(() => {
        unsafeWindow.linromatic();
    });
    CheckVisibility('button:contains('
        Click here ')', () => {
            DoIfExists('button:innerText('Next ')', 2);
            DoIfExists('button:innerText('Redirect ')', 2);
        });
});
BypassedByBloggerPemula(/upfion.com/, () => {
    if (!cfg.get('AutoDL')) {
        BpNote('Auto Download Feature Not Yet Activated!');
        return;
    }
    if (elementExists('.file-main.form-main')) {
        DoIfExists('.my-2.text-center > .btn-primary.btn', 2);
        CaptchaDone(() => {
            DoIfExists('#link-button');
        });
    }
});
BypassedByBloggerPemula(/m.flyad.vip/, () => {
    waitForElm('#captchaDisplay', (display) => {
        const number = display.textContent.trim();
        waitForElm('#captchaInput', (input) => {
            input.value = number;
            waitForElm('button[onclick='
                validateCaptcha()
                ']', (button) => {
                    sleep(1000).then(() => button.click());
                }, 15, 1);
        }, 15, 1);
    }, 15, 1);
});
BypassedByBloggerPemula(/downloader.tips/, () => {
    CaptchaDone(() => {
        DoIfExists('button.btn.btn-primary');
    });
    let downloader = setInterval(() => {
        if (bp('#count').innerText == '0') {
            clearInterval(downloader);
            DoIfExists('.btn-primary.btn');
        }
    }, 1 * 1000);
});
BypassedByBloggerPemula(/trangchu.news|downfile.site|(techacode|expertvn|ziggame|gamezigg).com|azmath.info|aztravels.net|handydecor.com.vn/, () => {
    AIORemover('removeAttr', '#monetiza', 'onclick');
    CheckVisibility('#monetiza', () => {
        ReadytoClick('#monetiza.btn-primary.btn');
    });
    elementReady('#monetiza-generate').then(() => setTimeout(() => {
        unsafeWindow.monetizago();
    }, 3 * 1000));
});
BypassedByBloggerPemula(/(carbikesupdate|carbikenation).com/, () => {
    parent.open = BpBlock();
    CheckVisibility('#verifyBtn', () => {
        DoIfExists('#getLinkBtn', 2);
    });
    CheckVisibility('.top.step', () => {
        DoIfExists('#getlinks.btn', 2);
    });
});
BypassedByBloggerPemula(/firefaucet.win/, () => {
    ReadytoClick('button:innerText('
        Continue ')', 2);
    ReadytoClick('button:innerText('
        Go Home ')', 2);
    CaptchaDone(() => {
        waitForElm('button[type=submit]:not([disabled]):innerText('Get Reward ')', (element) => { ReadytoClick('button[type=submit]:not([disabled])', 1);
            }, 10, 1);
    });
});
BypassedByBloggerPemula(/drive.google.com/, () => {
    if (!cfg.get('AutoDL')) {
        BpNote('Auto Download Feature Not Yet Activated!');
        return;
    }
    var dg = window.location.href.split('/').slice(-2)[0];
    if (window.location.href.includes('drive.google.com/file/d/')) {
        redirect(`https://drive.usercontent.google.com/download?id=${dg}&export=download`, false).replace('<br />', '');
    } else if (window.location.href.includes('drive.google.com/u/0/uc?id')) {
        DoIfExists('#download-form', 'submit', 1);
    }
});

BypassedByBloggerPemula('(on-scroll|diudemy|maqal360).com', () => {
    if (elementExists('.alertAd')) {
        notify('BloggerPemula : Try to viewing another tab if the countdown does not work');
    }
    ReadytoClick('#append a', 2);
    ReadytoClick('#_append a', 3);
    elementReady('.alertAd').then(function() {
        setActiveElement('[data-placement-id='revbid - leaderboard ']');
        fakeHidden();
    });
});

BypassedByBloggerPemula(/(down.fast-down|down.mdiaload).com/, () => {
    if (!cfg.get('AutoDL')) {
        BpNote('Auto Download Feature Not Yet Activated!');
        return;
    }
    elementReady('input.btn-info.btn').then(() => DoIfExists('input[name='method_free ']', 2));
    elementReady('.lft.filepanel').then(() => ReadytoClick('a:innerText('Download ')', 2));
    const captchaCode = BpAnswer(null, 'captcha');
    if (captchaCode) {
        const captchaInput = bp('input.captcha_code');
        if (captchaInput) {
            captchaInput.value = captchaCode;
            ReadytoClick('button:innerText('Create Download ')', 30);
        }
    }
});
BypassedByBloggerPemula(/(horoscop|videoclip|newscrypto).info|article24.online|writeprofit.org|docadvice.eu|trendzilla.club|worldwallpaper.top/, () => {
    CaptchaDone(() => {
        unsafeWindow.wpsafehuman();
    });
    CheckVisibility('center > .wpsafelink-button', () => {
        DoIfExists('center > .wpsafelink-button', 1);
    });
    CheckVisibility('#wpsafe-generate > a', '||', 'bp('.base - timer ').innerText == '0: 00 '', () => {
            unsafeWindow.wpsafegenerate();
            if (location.href.includes('article24.online')) {
                DoIfExists('#wpsafelink-landing > .wpsafelink-button', 1);
            } else {
                DoIfExists('#wpsafelink-landing2 > .wpsafelink-button', 1);
            }
        });
});
BypassedByBloggerPemula(/(hosttbuzz|policiesreview|blogmystt|wp2hostt|advertisingcamps|healthylifez|insurancemyst).com|clk.kim|dekhe.click/, () => {
    DoIfExists('button.btn.btn-primary', 2);
    AIORemover('removeAttr', '.btn-captcha.btn-primary.btn', 'onclick');
    DoIfExists('#nextpage', 'submit', 2);
    DoIfExists('#getmylink', 'submit', 3);
    CaptchaDone(() => {
        DoIfExists('.btn-captcha.btn-primary.btn');
    });
});
BypassedByBloggerPemula(/exactpay.online|neverdims.com|sproutworkers.co/, () => {
    let $ = unsafeWindow.jQuery;
    window.onscroll = BpBlock();
    unsafeWindow.check2();
    if (elementExists('#verify')) {
        $('.blog-details').text('Please Answer the Maths Questions First ,Wait until Progress bar end, then Click the Red X Manually');
        elementReady('[name='answer ']').then(function(element) {
            element.addEventListener('change', unsafeWindow.check3);
        });
    }
});
BypassedByBloggerPemula(/inshortnote.com/, () => {
        let clickCount = 0;
        const maxClicks = 7;

        function clickElement() {
            if (clickCount >= maxClicks) return;
                let element = bp('#htag > [style='left: 0 px;
                    ']') || bp('#ftag > [style='
                    left: 0 px;
                    ']');
                if (element) {
                    element.click();
                    clickCount++;
                    return;
                }
                for (let el of bp('.gaama [style*='
                        left: ']', true)) {
                    if (/^[a-zA-Z0-9]{5,6}$/.test(el.textContent.trim())) {
                        el.click();
                        clickCount++;
                        return;
                    }
                }
            }
            const intervalId = setInterval(() => {
                clickElement();
                if (clickCount >= maxClicks) clearInterval(intervalId);
            }, 3000);
        });

    BypassedByBloggerPemula(/jioupload.com/, () => {
        function calculateAnswer(text) {
            const parts = text.replace('Solve:', '').replace(/[=?]/g, '').trim().split(/\s+/);
            const [num1, op, num2] = [parseInt(parts[0]), parts[1], parseInt(parts[2])];
            return op === '+' ? num1 + num2 : num1 - num2;
        }
        elementReady('.file-details').then(() => {
            DoIfExists('form button.btn-secondary', 'click', 2);
            waitForElm('a.btn.btn-secondary[href*=' / file / ']', (jiou) => redirect(jiou.href, false));
        });
        elementReady('#challenge').then((challenge) => {
            const answer = calculateAnswer(challenge.textContent);
            BpNote(`Solved captcha: ${challenge.textContent} Answer: ${answer}`);
            elementReady('#captcha').then((input) => {
                input.value = answer;
                elementReady('button[type='submit ']').then((button) => sleep(3000).then(() => button.click()));
            });
        });
    }); BypassedByBloggerPemula(/(mangareleasedate|sabkiyojana|teqwit|bulkpit|odiafm).com|(loopmyhub|thepopxp).shop|cryptoblast.online/, () => {
        const GPlinks = 2 / (24 * 60);
        RSCookie('set', 'adexp', '1', GPlinks);
        CheckVisibility('.VerifyBtn', () => {
            DoIfExists('#VerifyBtn', 2);
            ReadytoClick('#NextBtn', 3);
        });
        if (elementExists('#SmileyBanner')) {
            setActiveElement('[id='div - gpt - ad ']');
            fakeHidden();
        }
    }); BypassedByBloggerPemula(/bitcotasks.com/, () => {
        if (location.href.includes('/firewall')) {
            CheckVisibility('#captcha-container', '&&', 'bp('.mb - 2 ').innerText == 'Verified '', () => {
                    DoIfExists('button:contains('Validate ')');
                });
        }
        if (location.href.includes('/lead')) {
            CheckVisibility('#status .btn', () => {
                DoIfExists('button:contains('Start View ')');
            });
        }
        CheckVisibility('#captcha-container', '&&', 'bp('.mb - 2 ').innerText == '
            Verified '', () => {
                unsafeWindow.continueClicked();
            });
        CheckVisibility('.alert-success.alert', '||', 'bp('.alert - success ').innerText == '
            This offer was successfully '', () => {
                unsafeWindow.close();
            });
    }); BypassedByBloggerPemula(/(remixsounds|helpdeep|thinksrace).com|(techforu|studywithsanjeet).in|uprwssp.org|gkfun.xyz/, () => {
        DoIfExists('.m-2.btn-captcha.btn-outline-primary.btn', 2);
        DoIfExists('.tpdev-btn', 3);
        DoIfExists('#tp98 button[class^='
            bt ']', 3);
        DoIfExists('form[name='
            tp ']', 'submit', 3);
        DoIfExists('#btn6', 4);
        var wssp = bp('body > center:nth-child(6) > center:nth-child(4) > center:nth-child(2) > center:nth-child(4) > center:nth-child(3) > center:nth-child(4) > center:nth-child(2) > center:nth-child(4) > script:nth-child(5)');
        if (wssp) {
            var scriptContent = wssp.textContent;
            var Linkc = scriptContent.match(/var\s+currentLink\s*=\s*[''](.*?)['']/);
            if (Linkc && Linkc[1]) {
                var CLink = Linkc[1];
                redirect(CLink);
            } else {
                BpNote('currentLink Not Found.');
            }
        } else {
            BpNote('Element Not Found.');
        }
    }); BypassedByBloggerPemula(/adshnk.com|adshrink.it/, () => {
        const window = unsafeWindow;
        let adsh = setInterval(() => {
            if (typeof window._sharedData == 'object' && 0 in window._sharedData && 'destination' in window._sharedData[0]) {
                clearInterval(adsh);
                document.write(window._sharedData[0].destination);
                redirect(document.body.textContent);
            } else if (typeof window.___reactjsD != 'undefined' && typeof window[window.___reactjsD.o] == 'object' && typeof window[window.___reactjsD.o].dest == 'string') {
                clearInterval(adsh);
                redirect(window[window.___reactjsD.o].dest);
            }
        });
    }); BypassedByBloggerPemula(/newsminer.uno/, () => {
        const window = unsafeWindow;
        CheckVisibility('#clickMessage', '&&', 'bp('
            #clickMessage ').innerText == '
            Click any ad '', () => {
                setActiveElement('[data-placement-id='revbid - leaderboard ']');
                fakeHidden();
            });
        if (elementExists('input.form-control')) {
            notify('Please Answer the Maths Questions First ,Wait until Progress bar end, then Click the Red X Manually', false, true);
            window.onscroll = BpBlock();
            window.check2();
            elementReady('[name='answer ']').then(function(element) {
                element.addEventListener('change', window.check3);
            });
        }
    }); BypassedByBloggerPemula(/(suaurl|lixapk|reidoplacar|lapviral|minhamoto).com/, () => {
        waitForElm('button[type='submit ']:contains('
            FETCH LINK ')', Btn1 => Btn1.click(), 10, 2);
        waitForElm('button:contains('START ')', Btn2 => Btn2.click(), 10, 2);
        waitForElm('button:contains('PULAR CAPTCHA ')', Btn3 => Btn3.click(), 10, 3);
        waitForElm('button:contains('FINAL LINK ')', Btn4 => Btn4.click(), 10, 2);
        CheckVisibility('button:contains('CONTINUAR ')', () => {
                ReadytoClick('button:contains('CONTINUAR ')');
            });
        CheckVisibility('button:contains('DESBLOQUEAR ')', () => {ReadytoClick('button:contains('DESBLOQUEAR ')');});
        CheckVisibility('button[type='submit ']:contains('DESBLOQUEAR ')', () => {
                ReadytoClick('button[type='submit ']:contains('DESBLOQUEAR ')');
            });
    }); 
     BypassedByBloggerPemula(/stly.link|(snaplessons|atravan|airevue|carribo|amalot).net|(stfly|shrtlk).biz|veroan.com/, () => {
        CaptchaDone(() => {
            ReadytoClick('button[class^=mt-4]');
            DoIfExists('button.mt-4:nth-child(2)', 3);
        });
        CheckVisibility('button[class^=rounded]', () => {
            if (!bp('.g-recaptcha') || !bp('.cf-turnstile')) {
                DoIfExists('button[class^=rounded]', 2);
            }
        });
        CheckVisibility('button[class^=mt-4]', '&&', 'bp('.progress - done ').innerText == '100 '', () => {
                ReadytoClick('button[class^=mt-4]', 2);
                ReadytoClick('button.mt-4:nth-child(2)', 4);
            });
        CheckVisibility('button[class^=mt-4]', '&&', 'bp('#countdown - number ').innerText == '✓'', () => {
                DoIfExists('button[class^=mt-4]', 2);
                ReadytoClick('button.mt-4:nth-child(2)', 3);
            });
    }); BypassedByBloggerPemula(/(playonpc|yolasblog|playarcade).online|quins.us|(retrotechreborn|insurelean|ecosolardigest|finance240|2wheelslife|historyofyesterday).com|gally.shop|freeat30.org|ivnlnews.xyz/, () => {
        CaptchaDone(() => {
            DoIfExists('button#cbt.pfbutton-primary', 1);
            ReadytoClick('button#cbt.pfbutton-primary', 2);
        });
        let playonpc = setInterval(() => {
            if (!elementExists('.h-captcha') && !elementExists('.core-msg.spacer.spacer-top') && bp('#formButtomMessage').textContent == 'Well done! You're ready to
                continue !' && !bp('#cbt ').hasAttribute('disabled ')) {
                clearInterval(playonpc); DoIfExists('button#cbt.pfbutton-primary', 1); ReadytoClick('button#cbt.pfbutton-primary', 2);
            }
        }, 3 * 1000);
    }); BypassedByBloggerPemula(/(sekilastekno|miuiku|vebma|majalahhewan).com|tempatwisata.pro/, async function() {
        const window = unsafeWindow;
        const executor = async () => {
            let El = window?.livewire?.components?.components()[0];
            while (!El) {
                await sleep(100);
                BpNote(1);
                El = window?.livewire?.components?.components()[0];
            }
            const payload = {
                fingerprint: El.fingerprint,
                serverMemo: El.serverMemo,
                updates: [{
                    payload: {
                        event: 'getData',
                        id: 'whathappen',
                        params: [],
                    },
                    type: 'fireEvent',
                }, ],
            };
            const response = await fetch(location.origin + '/livewire/message/pages.show', {
                headers: {
                    'Content-Type': 'application/json',
                    'X-Livewire': 'true',
                    'X-CSRF-TOKEN': window.livewire_token,
                },
                method: 'POST',
                body: JSON.stringify(payload),
            });
            const json = await response.json();
            const url = new URL(json.effects.emits[0].params[0]);
            redirect(url.href);
        };
        if (location.host === 'wp.sekilastekno.com') {
            if (elementExists('form[method='post ']')) {
                const a = bp('form[method='post ']');
                BpNote('addRecord...');
                const input = document.createElement('input');
                input.value = window.livewire_token;
                input.name = '_token';
                input.hidden = true;
                a.appendChild(input);
                a.submit();
            }
            if (elementExists('button[x-text]')) {
                BpNote('getLink..');
                executor();
            }
            return;
        }
        if (elementExists('div[class='max - w - 5 xl mx - auto ']')) {
            BpNote('Executing..');
            executor();
        }
    }); BypassedByBloggerPemula(/(shrinke|shrinkme)\.\w+|(paid4link|linkbulks|linclik|up4cash|smoner|atglinks|minimonetize|encurtadorcashlinks|yeifly|themesilk|linkpayu).com|(wordcounter|shrink).icu|(dutchycorp|galaxy-link).space|dutchycorp.ovh|pahe.plus|(pwrpa|snipn).cc|paylinks.cloud|oke.io|tinygo.co|tlin.me|wordcount.im|link.freebtc.my.id|get.megafly.in|skyfreeshrt.top|learncrypto.blog|link4rev.site/, () => {
        CaptchaDone(() => {
            if (/^(shrinke|shrinkme)\.\w+/.test(window.location.host)) {
                DoIfExists('#invisibleCaptchaShortlink');
            } else {
                DoIfExists('#link-view', 'submit');
            }
        });
    }); 
}
*/