🚫 Bypass Fullscreen Detection 🚫

Tricks websites into thinking they are always in fullscreen mode

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         🚫 Bypass Fullscreen Detection 🚫
// @namespace    http://tampermonkey.net
// @version      1.0
// @description  Tricks websites into thinking they are always in fullscreen mode
// @author       Otjl12
// @match        *://*/*
// @grant        none
// @run-at       document-start
// @license      MIT
// @compatible   chrome
// @compatible   firefox
// @compatible   edge
// @compatible   brave
// @compatible   opera
// @compatible   safari
// ==/UserScript==

(function() {
    'use strict';

    // 1. Lie to the website about the current fullscreen element
    // Instead of returning null when minimized, it will pretend the page body is maximized
    Object.defineProperty(document, 'fullscreenElement', {
        get: () => document.body,
        configurable: true
    });

    Object.defineProperty(document, 'webkitFullscreenElement', {
        get: () => document.body,
        configurable: true
    });

    Object.defineProperty(document, "fullscreenEnabled", {
        get: () => true,
        configurable: true
    });

    // 2. Kill the events that tell the website "you just left fullscreen"
    const blockEvents = ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];

    blockEvents.forEach(eventType => {
        window.addEventListener(eventType, function(e) {
            e.stopImmediatePropagation();
        }, true);

        document.addEventListener(eventType, function(e) {
            e.stopImmediatePropagation();
        }, true);
    });

    console.log("Fullscreen spoofing active.");
})();