TestGorilla Full Screen Exit Bypass

Prevents TestGorilla from forcing users out of fullscreen mode by overriding exitFullscreen(), spoofing fullscreenElement, and blocking fullscreenchange event listeners. Useful for uninterrupted fullscreen experience during assessments.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         TestGorilla Full Screen Exit Bypass
// @namespace    https://greasyfork.org/en/users/1461725-scriptninja
// @version      1.0.6
// @description  Prevents TestGorilla from forcing users out of fullscreen mode by overriding exitFullscreen(), spoofing fullscreenElement, and blocking fullscreenchange event listeners. Useful for uninterrupted fullscreen experience during assessments.
// @author       ScriptNinja
// @license      MIT
// @match        https://*.testgorilla.com/*
// @icon         https://www.google.com/s2/favicons?domain=testgorilla.com
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Override exitFullscreen to do nothing
    if (document.exitFullscreen) {
        document.exitFullscreen = function() {
            console.log("Blocked exitFullscreen");
            return Promise.resolve(); // Fake success
        };
    }

    // Block fullscreenchange events
    const originalAddEventListener = EventTarget.prototype.addEventListener;
    EventTarget.prototype.addEventListener = function(type, listener, options) {
        if (type === 'fullscreenchange') {
            console.log("Blocked fullscreenchange listener");
            return; // Do not add the event listener
        }
        originalAddEventListener.call(this, type, listener, options);
    };

    // Spoof fullscreen state
    Object.defineProperty(document, 'fullscreenElement', {
        get: () => document.documentElement, // Always return the root element as "fullscreen"
        configurable: true
    });
})();