用video的bug来跳过进度条

Use the video bug to skip the progress bar

目前為 2024-08-04 提交的版本,檢視 最新版本

// ==UserScript==
// @name         用video的bug来跳过进度条
// @namespace    http://tampermonkey.net/
// @version      1.28
// @description  Use the video bug to skip the progress bar
// @author       lvandy
// @match        *://*/*
// @license MIT
// @grant        none
// ==/UserScript==



(function() {
 'use strict'; // 启用严格模式

 // 触发视频播放结束的事件
 function triggerVideoEndedEvent() {
     var video = document.querySelector("video");
     if (video) {
         video.dispatchEvent(new Event("ended")); // 触发视频结束事件
     }
 }

 // 当页面上发生点击事件时,触发视频结束事件
 document.addEventListener('click', function(event) {
     if (event.button === 0) { // 左键点击
         triggerVideoEndedEvent(); // 触发视频播放结束事件
     }
 });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址