Greasy Fork is available in English.

Universal Fullscreen (Alt+X)

Fullscreen toggle with console debugging

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Universal Fullscreen (Alt+X)
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Fullscreen toggle with console debugging
// @match        *://*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    
    console.log("✅ Fullscreen script loaded on this page.");

    document.addEventListener('keydown', function(e) {
        // Check if Alt + X is pressed
        if (e.altKey && e.key.toLowerCase() === 'x') {
            console.log("⌨️ Alt+X pressed!");
            e.preventDefault(); 

            if (!document.fullscreenElement) {
                console.log("Attempting to enter fullscreen...");
                if (document.documentElement.requestFullscreen) {
                    document.documentElement.requestFullscreen().then(() => {
                        console.log("🟢 Fullscreen entered successfully.");
                    }).catch(err => {
                        console.error(`🔴 Fullscreen blocked by browser: ${err.message}`);
                    });
                } else {
                    console.error("🔴 requestFullscreen API not supported on this page.");
                }
            } else {
                console.log("Attempting to exit fullscreen...");
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                }
            }
        }
    });
})();