Shin KGS Fullscreen Option

Shin KGS Fullscreen Option - Click yellow Fullscreen button while in a game

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Shin KGS Fullscreen Option
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Shin KGS Fullscreen Option - Click yellow Fullscreen button while in a game
// @author       dracflam
// @match        https://shin.gokgs.com/*
// @require      https://code.jquery.com/jquery-3.2.1.min.js
// ==/UserScript==

$(document).ready(function() {
    addGlobalStyle('.GameScreen:-webkit-full-screen  {top: 0px;}');
    setTimeout(function(){
    var t=$('<a>').css('background','yellow').addClass('MainNav-feedback-button').html('Fullscreen').on('click',function() {
        if ( document.querySelector('.GameScreen')!==null)
            document.querySelector('.GameScreen').webkitRequestFullscreen();
        else
            alert('Watch or play a game first!');
    });
    $('.MainNav-feedback').prepend(t);
    }, 2000);
});
function addGlobalStyle(css) {
   var head, style;
   head = document.getElementsByTagName('head')[0];
   if (!head) { return; }
   style = document.createElement('style');
   style.type = 'text/css';
   style.innerHTML = css;
   head.appendChild(style);
}