Twitch, Fullscreen mode with chat

Enable fullscreen mode with chat when click fullscreen button or key down f key on theater mode

目前為 2022-11-13 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Twitch, Fullscreen mode with chat
// @name:ja      Twitch, チャット付きフルスクリーンモード
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Enable fullscreen mode with chat when click fullscreen button or key down f key on theater mode
// @description:ja シアターモードでフルスクリーンボタンを押すかFキーを押したとき、チャットありのフルスクリーンモードになります
// @author       You
// @match        https://www.twitch.tv/tororo_vtuber
// @icon         https://www.google.com/s2/favicons?sz=64&domain=twitch.tv
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    document.addEventListener("click", ev => {
        if (ev.path.find(e => e.getAttribute && e.getAttribute("data-a-target") == "player-fullscreen-button")) {
            if (!document.fullscreen) {
                ev.preventDefault();
                ev.stopPropagation();
                ev.stopImmediatePropagation();
                document.documentElement.requestFullscreen();
            }
        }
    });
    document.addEventListener("keydown", ev => {
        if (ev.key == "f" && !document.fullscreen) {
            ev.preventDefault();
            ev.stopPropagation();
            ev.stopImmediatePropagation();
            document.documentElement.requestFullscreen();
        }
    });
    // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址