用video的bug来跳过进度条

Use the video bug to skip the progress bar

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

// ==UserScript==
// @name         用video的bug来跳过进度条
// @namespace    http://tampermonkey.net/
// @version      1.38
// @description  Use the video bug to skip the progress bar
// @author       lvandy
// @match        *://*/*
// @license MIT
// @grant        none
// @run-at       document-end
// ==/UserScript==
(function() {
    'use strict';

    // 等待页面加载完成
    window.addEventListener('DOMContentLoaded', function() {
        // 找到页面中的第一个视频元素
        var video = document.querySelector('video');

        // 检查视频元素是否存在
        if (video) {
            // 触发视频播放结束的事件
            video.dispatchEvent(new Event('ended'));

            // 等待2秒
            setTimeout(function() {
                // 将视频的播放时间设置为120秒
                video.currentTime = 120;
                // 如果需要自动播放,取消注释下一行
                // video.play();
            }, 2000);
        } else {
            console.error('没有找到视频元素');
        }
    });
})();

QingJ © 2025

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