AtCoder_CustomTest_Run_Shortcut

AtCoderのコードテストにおいてCtrl+Enterで実行ができるようになります。You can run by using Ctrl + Enter in Custom Test of AtCoder

Pada tanggal 28 Oktober 2022. Lihat %(latest_version_link).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         AtCoder_CustomTest_Run_Shortcut
// @namespace    https://greatest.deepsurf.us/ja/users/570127
// @version      0.1.3
// @description  AtCoderのコードテストにおいてCtrl+Enterで実行ができるようになります。You can run by using Ctrl + Enter in Custom Test of AtCoder
// @author       universato
// @grant        none
// @match        https://atcoder.jp/contests/*/custom_test
// @match        https://atcoder.jp/contests/*/custom_tets*
// @license      MIT
// @supportURL   https://twitter.com/universato
// ==/UserScript==

(function() {
    document.addEventListener('keydown', function (event) {
        if ((event.ctrlKey || event.metaKey) && event.keyCode === 13){
            var elements = document.getElementsByClassName('btn btn-primary');
            for(var i = 0; i < elements.length; ++i){
                // console.log(elements[i].innerHTML)
                if(elements[i].innerHTML === "実行"){
                    elements[i].click();
                }
            }
        }
    }, false);
})();