Shin KGS Fullscreen Option

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
}