用video的bug来跳过进度条

Use the video bug to skip the progress bar

当前为 2024-08-04 提交的版本,查看 最新版本

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

(function() {
    'use strict';

    // Function to skip video to 3600 seconds or end
    function skipVideo() {
        var video = document.querySelector('video');
        if (video) {
            // Set the current time to 3600 seconds or the end if the video is shorter
            video.currentTime = Math.min(3600, video.duration);
            // Dispatch the 'ended' event to trigger any end-of-video actions
            video.dispatchEvent(new Event('ended'));
        }
    }

    // Wait for the DOM to be fully loaded before running the function
    window.addEventListener('load', skipVideo);
})();

QingJ © 2025

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