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.

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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
    });
})();