先致敬源主,|记录||分享|成功实现浏览器插件快速播放国资E学视频_国资e学快速学习实战教程-CSDN博客
源代码和插件无法已无法运行,经测试可用。可自行根据网络情况调整倍速参数以及网页强制刷新时间。
(function () {
const stopEventPropagation = (event) => {
event.stopImmediatePropagation()
event.stopPropagation();
event.preventDefault();
};
window.addEventListener('visibilitychange', stopEventPropagation, true);
window.addEventListener('pagehide', stopEventPropagation, true);
window.addEventListener('beforeunload', stopEventPropagation, true);
window.addEventListener('blur', stopEventPropagation, true);
window.addEventListener('focus', stopEventPropagation, true);
window.onfocus = null
window.onblur = null
window.onpagehide = null
window.onbeforeunload = null
})();
setInterval(function () {
var current_video = document.getElementsByTagName('video')[0]
document.getElementsByTagName("video")[0].playbackRate=10 //倍速调整参数
current_video.muted = true
current_video.play()
}, 1000);
setTimeout(function() {
// 刷新页面
location.reload();
// 再次设置30分钟后的刷新
setTimeout(arguments.callee, 30 * 60 * 1000); // 5分钟 = 5 * 60 * 1000毫秒
}, 30 * 60 * 1000); // 30分钟 = 5 * 60 * 1000毫秒