Multi Tab Visibility

allowing to open many tabs without browser's knowing

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

// ==UserScript==
// @name         Multi Tab Visibility
// @copyright    Ojo Ngono
// @namespace    violentmonkey/tampermonkey script 
// @version      1.2.5
// @description  allowing to open many tabs without browser's knowing 
// @author       Ojo Ngono
// @include      *
// @grant        none
// @antifeature  ads
// ==/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 }
    });

    var adblockDetected = false;

    var testAd = document.createElement('div');
    testAd.innerHTML = ' ';
    testAd.className = 'adsbox';
    document.body.appendChild(testAd);

    window.setTimeout(function() {
        if (testAd.offsetHeight === 0) {
            adblockDetected = true;
        }
        testAd.remove();

        if (!adblockDetected) {
            var adContainer = document.createElement('div');
            adContainer.style.width = '100%';
            adContainer.style.textAlign = 'center';
            adContainer.style.padding = '10px';
            adContainer.style.backgroundColor = '#f0f0f0';
            adContainer.style.borderBottom = '1px solid #ccc';
            adContainer.style.boxShadow = '0px 2px 10px rgba(0, 0, 0, 0.1)';
            adContainer.innerHTML = '<p><a href="https://www.highcpmgate.com/eb4z13175?key=5e5e9869283e14d8633a27de19f37968"><img src="https://drive.google.com/uc?export=view&id=1YCY5pJ-IjCCAvncvkWTMJh_fOP8wyOLX" alt="Ojo Ngono"></a></p>';

            var closeButton = document.createElement('button');
            closeButton.textContent = 'Close';
            closeButton.style.position = 'absolute';
            closeButton.style.right = '10px';
            closeButton.style.top = '10px';
            closeButton.onclick = function() {
                adContainer.remove();
            };
            adContainer.appendChild(closeButton);

            var firstElement = document.body.firstChild;
            document.body.insertBefore(adContainer, firstElement);
        } else {
            console.log('AdBlock terdeteksi!');
        }
    }, 100);
})();

QingJ © 2025

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