// ==UserScript== // @name 蛋蛋赞快进秒数 // @namespace DanDanZan // @version 1.12 // @description 蛋蛋赞快进秒数_设置改为10秒_左右快进、空格暂停、上下音量_如果浏览器自带热键控制造成冲突可以在脚本菜单里关闭 // @author noahyann // @match https://www.dandanzan10.top/* // @match https://www.dandanzan.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=dandanzan10.top // @grant GM_setValue // @grant GM_getValue // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @license MIT // @downloadURL none // ==/UserScript== let menuId = 0; function updateMenu(){ if(menuId == 0){ if(GM_getValue("noPause")==1){ menuId = GM_registerMenuCommand("空格暂停上下音量【关】",updateMenu); }else{ menuId = GM_registerMenuCommand("空格暂停上下音量【开】",updateMenu); } }else{ GM_unregisterMenuCommand(menuId); menuId = 0 GM_setValue("noPause",GM_getValue("noPause")==1?0:1); updateMenu(); } } updateMenu(); function new_timeupdate() { this.lastTime = this.currentTime; } function new_keydown(event) { var e = event || window.event; if (e) { //alert(e.keyCode); e.returnValue = false; if (e.keyCode == 37) { this.currentTime = this.lastTime-=10; // LEFT } else if (e.keyCode == 39) { this.currentTime = this.lastTime+=10; // RIGHT } if (GM_getValue("noPause") == 1){ return; } if (e.keyCode == 32) { this.paused == true ? this.play():this.pause();// SAPCE } else if (e.keyCode == 38) { this.volume += 0.1; // UP } else if (e.keyCode == 40) { this.volume -= 0.1; // DOWN } } } (function(){ var g_VideoElement = document.getElementsByTagName("VIDEO"); for (var i=0,j=g_VideoElement.length;i