AtCoder_submit_keyboard_shortcut

atcoderにおいてCtrl+Enterで提出ができるようになります

2019-03-03 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

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!)

  1. // ==UserScript==
  2. // @name AtCoder_submit_keyboard_shortcut
  3. // @version 1.0
  4. // @description atcoderにおいてCtrl+Enterで提出ができるようになります
  5. // @author Osmium_1008
  6. // @license MIT
  7. // @include https://atcoder.jp/contests/*/tasks/*
  8. // @include https://atcoder.jp/contests/*/submit
  9. // @include https://*.contest.atcoder.jp/submit
  10. // @supportURL https://twitter.com/Osmium_1008
  11. // @namespace https://greatest.deepsurf.us/users/251827
  12. // ==/UserScript==
  13. (function() {
  14. document.addEventListener('keydown', function (event) {
  15. if ((event.ctrlKey||event.metaKey)&&event.keyCode==13){
  16. if((window.location.href).match(new RegExp('contests'))!=null){
  17. console.log("new");
  18. document.getElementById('submit').click();
  19. }
  20. else{
  21. console.log("old");
  22. (document.getElementsByClassName('btn btn-primary btn-large'))[0].click();
  23. }
  24. }
  25. }, false);
  26. })();