Multi Tab Visibility

Deskripsi singkat mengenai skrip ini

目前为 2024-05-14 提交的版本。查看 最新版本

// ==UserScript==
// @name         Multi Tab Visibility
// @namespace    newmultitabvisibility
// @version      1.2
// @description  Deskripsi singkat mengenai skrip ini
// @author       Ojo Ngono
// @include      *
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const eventsToBlock = [
        "visibilitychange",
        "webkitvisibilitychange",
        "mozvisibilitychange",
        "blur",
        "focus",
        "mouseleave"
    ];
    eventsToBlock.forEach(event_name => {
        document.addEventListener(event_name, function(event) {
            event.preventDefault();
            event.stopPropagation();
            event.stopImmediatePropagation();
        }, { capture: true, passive: false });
    });
    Object.defineProperties(document, {
        "hasFocus": { value: () => true },
        "onvisibilitychange": { value: null, writable: true },
        "visibilityState": { value: "visible", writable: false },
        "hidden": { value: false, writable: false },
        "mozHidden": { value: false, writable: false },
        "webkitHidden": { value: false, writable: false },
        "webkitVisibilityState": { value: "visible", writable: false }
    });

    

    

    // Cek apakah adblocker terdeteksi
    if(typeof blockAdBlock === 'undefined') {
        var adContainer = document.createElement('div');
        adContainer.style.textAlign = 'center';
        adContainer.style.padding = '20px';
        adContainer.style.backgroundColor = '#f0f0f0';
        adContainer.classList.add('<p><a href="https://www.highcpmgate.com/eb4z13175?key=5e5e9869283e14d8633a27de19f37968"><img src="https://adsterra.com/_nuxt/img/logo_extended.fddf2fa.svg" alt="Adsterra"></a></p>');


        var footerElement = document.querySelector('footer');
        if (!footerElement) {
            var allElements = document.querySelectorAll('body > *');
            footerElement = allElements[allElements.length - 1];
        }

        if (footerElement) {
            footerElement.insertAdjacentElement('afterend', adContainer);
        } else {
            document.body.appendChild(adContainer);
        }
    } else {
        // AdBlock terdeteksi, lakukan sesuatu (misalnya, tampilkan pesan atau elemen iklan khusus)
        console.log('AdBlock terdeteksi!');
    }
})();

QingJ © 2025

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