🚫 Bypass Fullscreen Detection 🚫

Tricks websites into thinking they are always in fullscreen mode

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

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