您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
视频内显示时间
// ==UserScript== // @name [SNI模块] 显示时间 // @namespace cksni-module-show-timer // @version 1.0 // @description 视频内显示时间 // @author CKylinMC // @match https://*.bilibili.com/* // @grant unsafeWindow // @run-at document-start // @license GPLv3 // ==/UserScript== (function(){ let timerInterval = null; const padNum = (num,count=2)=>((''+Math.pow(10,count)).substr(1)+num).slice(-1*Math.max(count,(''+num).length)); const name = "当前时间"; const module = data=>{ data.logger.log(data); const {domHelper} = data.tools; clearInterval(timerInterval); return domHelper('span',{ css:{ float: "right", transform: "translateX(-30px)" }, init:span=>{ timerInterval = setInterval(()=>{ const time = new Date(); const fmt = `${padNum(time.getHours())}:${padNum(time.getMinutes())}:${padNum(time.getSeconds())}`; span.innerText = fmt; },1000); } }); }; if(!unsafeWindow.SNIMODULES){ unsafeWindow.SNIMODULES = {} } unsafeWindow.SNIMODULES[name] = module; })();