您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
allowing to open many tabs without browser's knowing
- // ==UserScript==
- // @name Multi Tab Visibility
- // @copyright Ojo Ngono
- // @namespace violentmonkey/tampermonkey script
- // @version 1.2.8.4
- // @description allowing to open many tabs without browser's knowing
- // @author Ojo Ngono
- // @include *://*/*
- // @grant none
- // @@license Copyright OjoNgono
- // ==/UserScript==
- (function() {
- 'use strict';
- // Cek apakah skrip dijalankan di dalam iframe
- if (window.top !== window.self) {
- return; // Jika dijalankan di dalam iframe, hentikan skrip
- }
- console.log('Script is running on top window.');
- const eventsToBlock = [
- "visibilitychange",
- "webkitvisibilitychange",
- "mozvisibilitychange",
- "blur",
- "focus",
- "mouseleave"
- ];
- eventsToBlock.forEach(event_name => {
- document.addEventListener(event_name, function(event) {
- console.log(`Blocking event: ${event_name}`);
- event.preventDefault();
- event.stopPropagation();
- event.stopImmediatePropagation();
- }, { capture: true, passive: false });
- });
- console.log('Attempting to override visibility and focus properties.');
- // Function to safely define properties if configurable
- const defineSafeProperty = (obj, prop, descriptor) => {
- const propertyDescriptor = Object.getOwnPropertyDescriptor(obj, prop);
- if (!propertyDescriptor || propertyDescriptor.configurable) {
- Object.defineProperty(obj, prop, descriptor);
- } else {
- console.warn(`Property "${prop}" is non-configurable and cannot be redefined.`);
- }
- };
- defineSafeProperty(document, "hasFocus", { value: () => true });
- defineSafeProperty(document, "onvisibilitychange", { value: null, writable: true });
- defineSafeProperty(document, "visibilityState", { value: "visible", writable: false });
- defineSafeProperty(document, "hidden", { value: false, writable: false });
- defineSafeProperty(document, "mozHidden", { value: false, writable: false });
- defineSafeProperty(document, "webkitHidden", { value: false, writable: false });
- defineSafeProperty(document, "webkitVisibilityState", { value: "visible", writable: false });
- console.log('Properties override complete.');
- var adblockDetected = false;
- // Cara sederhana untuk mendeteksi adblocker
- 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) {
- console.log('AdBlock terdeteksi!');
- } else {
- console.log('Tidak ada AdBlock yang terdeteksi.');
- }
- }, 100);
- })();