用video的bug来跳过进度条

Use the video bug to skip the progress bar

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

// ==UserScript==
// @name         用video的bug来跳过进度条
// @namespace    http://tampermonkey.net/
// @version      1.23
// @description  Use the video bug to skip the progress bar
// @author       lvandy
// @match        *://*/*
// @license MIT
// @grant        none
// ==/UserScript==
// 定义一个函数来跳转到视频的最后1秒
function jumpToLastSecond(video) {
  // 检查视频元素是否已经加载了duration属性
  if (video && !isNaN(video.duration)) {
    // 设置当前播放时间为视频的总时长减去1秒
    video.currentTime = video.duration - 1;
  } else {
    console.log('无法获取视频时长或视频元素未准备好。');
  }
}

// 获取页面上的第一个视频元素
var videoElement = document.querySelector('video');

// 如果找到了视频元素,调用函数跳转到视频的最后1秒
if (videoElement) {
  jumpToLastSecond(videoElement);
} else {
  console.log('页面上没有找到视频元素。');
}

QingJ © 2025

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