您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2021/7/22下午11:04:19
// ==UserScript== // @name xiaobentong.com // @namespace Violentmonkey Scripts // @match http://xbtxbtyx.xiaobentong.com/autActivity/intoAutoStudy // @grant none // @version 1.0 // @author - // @description 2021/7/22下午11:04:19 // ==/UserScript== (function() { let video = document.querySelector('video'); let ul = $('.course-con'); let liList = ul.find('li'); let totalLength = liList.length; let timer = null; setTimeout(() => { video = document.querySelector('video'); ul = $('.course-con'); liList = ul.find('li'); totalLength = liList.length; init(); }, 4000) function init() { if (!video) { _turnNextPage(); return; } video.play(); timer = setInterval(() => { let dT = video.duration; let cT = video.currentTime; console.log(dT, cT); if (cT >= dT) { clearInterval(timer); _turnNextPage(); } }, 3000) } function _turnNextPage() { let nextIndex = getNextCurIndex(); if (nextIndex + 1 > totalLength) { alert('已完成本章阅读,请选择下一章节!!!'); return -1; } let url = $(liList[nextIndex]).find('a').attr('href'); setTimeout(() => { window.location.href = url; },2000) } function getNextCurIndex() { let index = -1; Array.from(liList).some((v, i) => { if ($(v).hasClass('cur')) { index = i; return true; } }) return ++index; } })()