Greasy Fork is available in English.
每隔15秒模拟按下向下键,仅在长江雨课堂下执行
当前为
// ==UserScript==
// @license MIT
// @name Auto Press Down Key for Changjiang Yuketang
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description 每隔15秒模拟按下向下键,仅在长江雨课堂下执行
// @author Your Name
// @match https://changjiang.yuketang.cn/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 定义按键函数
function pressDownKey() {
// 创建按下向下键的事件
const event = new KeyboardEvent('keydown', {
key: 'ArrowDown',
keyCode: 40,
code: 'ArrowDown',
which: 40,
bubbles: true
});
// 触发事件
document.dispatchEvent(event);
}
// 设置间隔时间(15秒)
const intervalTime = 15000; // 15秒
// 每隔15秒按一次向下键
setInterval(pressDownKey, intervalTime);
})();