您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prints course duration on console
当前为
// ==UserScript== // @name Wes Bos Courses Duration // @namespace http://tampermonkey.net/ // @version 0.1 // @description Prints course duration on console // @author xaxim // @match https://javascript30.com/account/access/* // @match https://es6.io/account/access/* // @match https://reactforbeginners.com/account/access/* // @match https://sublimetextbook.com/account/access/* // @match https://flexbox.io/account/access/* // @match https://commandlinepoweruser.com/account/access/* // @match https://learnredux.com/account/access/* // @match https://masteringmarkdown.com/account/access/* // @grant none // ==/UserScript== (function() { 'use strict'; const timeNodes = Array.from(document.querySelectorAll('.duration')); const seconds = timeNodes .map(node => node.textContent) .map(timeStr => { const [mins, secs] = timeStr.split(':').map(parseFloat); return mins * 60 + secs; }) .reduce((total, current) => total + current); const minsPerHour = 60; const secsPerHour = minsPerHour * 60; let secondsLeft = seconds; const hours = Math.floor(secondsLeft / secsPerHour); secondsLeft = secondsLeft % secsPerHour; const minutes = Math.floor(secondsLeft / minsPerHour); secondsLeft = secondsLeft % minsPerHour; console.log(`${hours} hours ${minutes} minutes and ${secondsLeft} seconds`); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址