AtCoder_CustomTest_Run_Shortcut

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

Fra og med 29.10.2022. Se den nyeste version.

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.5
// @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.key === 'Enter'){
          let elements = document.getElementsByClassName('btn btn-primary');
          for(let element of elements){
              if(element.innerText === "実行"){
                  element.click();
              }
          }
      }
  });
})();