Autodarts - Auto Fullscreen

Enables auto fullscreen-mode after game start

目前為 2025-03-07 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Autodarts - Auto Fullscreen
// @namespace    http://tampermonkey.net/
// @version      0.12
// @description  Enables auto fullscreen-mode after game start
// @author       benebelter
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @match        https://play.autodarts.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=autodarts.io
// @license      MIT
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    $(document).on('click', 'button:contains("Start game"), #enter_fullscreen', function(){  //  $(document).on('click', '.chakra-button', function(){
        // collapse side bar
        if( $('.css-17xejub').width() > 100 ){
            $('[aria-label="Collapse side bar"]').click();
        }

        if( window.innerHeight != screen.height) {
            document.querySelector("html").requestFullscreen();
        }

        if ($('#exit_fullscreen').length < 1) {
            $('.css-1jc8v6r').last().after('<a id="exit_fullscreen" class="chakra-menu__menuitem css-1jc8v6r" onclick="document.exitFullscreen();">Exit Fullscreen</a>');
        }

        if ($('#enter_fullscreen').length < 1) {
            $('.css-1jc8v6r').last().after('<a id="enter_fullscreen" class="chakra-menu__menuitem css-1jc8v6r">Enter Fullscreen</a>');
        }

    });
})();