Enables auto fullscreen-mode after game start
当前为
// ==UserScript==
// @name Autodarts - Auto Fullscreen
// @namespace http://tampermonkey.net/
// @version 0.11
// @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")', function(){ // $(document).on('click', '.chakra-button', function(){
if( window.innerHeight != screen.height) {
console.log('fullscreen');
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();" style="border: 0px solid red;">Exit Fullscreen</a>');
if( $('.css-17xejub').width() > 100 ){
$('[aria-label="Collapse side bar"]').click();
}
}
});
})();