leetcode快捷键

leetcode快捷键0.11

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         leetcode快捷键
// @namespace    http://tampermonkey.net/
// @version      0.11
// @description  leetcode快捷键0.11
// @author       You
// @match        https://leetcode.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=leetcode.cn
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
/*
 * @Author: LOG
 * @FilePath: \油猴脚本\leetcode快捷键.js
 * @Descripttion:
 * @version:
 * @Date: 2022-05-29 13:54:07
 * @LastEditors: LOG
 * @LastEditTime: 2022-05-29 13:56:19
 */

// 监听F5键
document.addEventListener('keydown', function(e) {
    if (e.keyCode == 116) {
        e.preventDefault();
        let RunCode=document.querySelectorAll('.runcode__20UZ')[0];
        console.log("runcode:",RunCode);
        RunCode.click();
    }
});
// 监听ctrl+s键
document.addEventListener('keydown', function(e) {
    if (e.keyCode == 83 && e.ctrlKey) {
        e.preventDefault();
        let SubmitCode=document.querySelectorAll('.submit__-6u9')[0];
        console.log("SubmitCode:",SubmitCode);
    }
})
    // Your code here...
})();