AtCoder_CustomTest_Run_Shortcut

You can run by using Ctrl + Enter in Custom Test of AtCoder

La data de 30-10-2022. Vezi ultima versiune.

  1. // ==UserScript==
  2. // @name AtCoder_CustomTest_Run_Shortcut
  3. // @name:ja AtCoderカスタムテスト実行ショートカット
  4. // @namespace https://greatest.deepsurf.us/ja/users/570127
  5. // @version 0.1.7
  6. // @description You can run by using Ctrl + Enter in Custom Test of AtCoder
  7. // @description:ja AtCoderのコードテストにおいてCtrl+Enterで実行ができるようになります。
  8. // @author universato
  9. // @grant none
  10. // @match https://atcoder.jp/contests/*/custom_test
  11. // @match https://atcoder.jp/contests/*/custom_tets*
  12. // @license MIT
  13. // @supportURL https://twitter.com/universato
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. document.addEventListener('keydown', function (event) {
  18. if ((event.ctrlKey || event.metaKey) && event.key === 'Enter'){
  19. const elements = document.getElementsByClassName('btn btn-primary');
  20. for(let element of elements){
  21. if(element.innerText === '実行'){
  22. element.click();
  23. }
  24. }
  25. }
  26. });
  27. })();