CheatTheSystem

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
    };
  });
})();