CheatTheSystem

Blocks native fullscreen transitions while emulating a true fullscreen state to websites, and suppresses tab-switch / visibility detection.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         CheatTheSystem
// @namespace    http://bdstudios.nl
// @version      2025-10-03
// @description  Blocks native fullscreen transitions while emulating a true fullscreen state to websites, and suppresses tab-switch / visibility detection. 
// @author       JTD
// @match        *://*/*
// @license MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=proxyahh1.vercel.app
// @grant        none
// ==/UserScript==

// content_script.js
(function () {
  'use strict';
  function inject(fn) {
    const s = document.createElement('script');
    s.textContent = '(' + fn.toString() + ')();';
    (document.documentElement || document.head || document.body).appendChild(s);
    s.remove();
  }

  inject(function () {
    try {
      // Fake fullscreen request
      Element.prototype.requestFullscreen = function () {
        // set fake fullscreen element
        document._fakeFullscreenEl = this;
        // fire event so sites think it happened
        setTimeout(() => {
          document.dispatchEvent(new Event("fullscreenchange"));
        }, 0);
        return Promise.resolve(this);
      };
      Element.prototype.mozRequestFullScreen = Element.prototype.requestFullscreen;
      Element.prototype.webkitRequestFullscreen = Element.prototype.requestFullscreen;

      // Fake exitFullscreen
      document.exitFullscreen = function () {
        document._fakeFullscreenEl = null;
        setTimeout(() => {
          document.dispatchEvent(new Event("fullscreenchange"));
        }, 0);
        return Promise.resolve();
      };

      // Always report a fullscreen element (truthy)
      Object.defineProperty(document, 'fullscreenElement', {
        get() { return document._fakeFullscreenEl || document.documentElement; },
        configurable: true
      });
    } catch (e) {}

    try {
      Object.defineProperty(document, 'hidden', {
        get() { return false; },
        configurable: true
      });
      Object.defineProperty(document, 'visibilityState', {
        get() { return 'visible'; },
        configurable: true
      });
      document.hasFocus = function () { return true; };
      window.hasFocus = function () { return true; };
    } catch (e) {}

    function stopEvent(e) { try { e.stopImmediatePropagation(); } catch (err) {} }
    addEventListener('visibilitychange', stopEvent, true);
    addEventListener('blur', stopEvent, true);
    addEventListener('focus', stopEvent, true);
    addEventListener('pageshow', stopEvent, true);
    addEventListener('pagehide', stopEvent, true);

    const origDocAdd = Document.prototype.addEventListener;
    Document.prototype.addEventListener = function (type, listener, opts) {
      if (type === 'visibilitychange' || type === 'blur' || type === 'focus') {
        return origDocAdd.call(this, type, function () {}, opts);
      }
      return origDocAdd.call(this, type, listener, opts);
    };
  });
})();