Greasy Fork 还支持 简体中文。

leetcode快捷键

leetcode快捷键0.11

  1. // ==UserScript==
  2. // @name leetcode快捷键
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.11
  5. // @description leetcode快捷键0.11
  6. // @author You
  7. // @match https://leetcode.cn/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.cn
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. /*
  16. * @Author: LOG
  17. * @FilePath: \油猴脚本\leetcode快捷键.js
  18. * @Descripttion:
  19. * @version:
  20. * @Date: 2022-05-29 13:54:07
  21. * @LastEditors: LOG
  22. * @LastEditTime: 2022-05-29 13:56:19
  23. */
  24.  
  25. // 监听F5键
  26. document.addEventListener('keydown', function(e) {
  27. if (e.keyCode == 116) {
  28. e.preventDefault();
  29. let RunCode=document.querySelectorAll('.runcode__20UZ')[0];
  30. console.log("runcode:",RunCode);
  31. RunCode.click();
  32. }
  33. });
  34. // 监听ctrl+s键
  35. document.addEventListener('keydown', function(e) {
  36. if (e.keyCode == 83 && e.ctrlKey) {
  37. e.preventDefault();
  38. let SubmitCode=document.querySelectorAll('.submit__-6u9')[0];
  39. console.log("SubmitCode:",SubmitCode);
  40. }
  41. })
  42. // Your code here...
  43. })();