惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
P
Proofpoint News Feed
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
F
Fortinet All Blogs
C
Check Point Blog
博客园_首页
I
InfoQ
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
美团技术团队
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research

LINUX DO - 最新话题

谷歌云盘下载700g数据集,求方法 OpenAI推出了100美元的Pro订阅后,plus的Codex 5小时限额大幅缩水 之前买的super grok居然还没掉 关于CPA认证文件周限 佬们,默认CDK的要求是什么等级啊? 最新版本的微信群聊机器人方案 有没有人知道如何free号没有封,那么是否可以循环使用,因为我看主要是周限 L站改版了?吓我一跳,我以为我浏览器崩了 淘宝这种宽带可信吗,500兆移动宽带月费8元到2099年 docker内部应用访问宿主机mysql和redis时被拒绝connection refuse Erp全栈想转行做Ai有什么推荐的吗 boost有bug 佬们,有没有靠谱点的 Plus 购买渠道 大妈,狗妈用的 lg 服务有源头开源项目吗? 有人有能过验证码打码的嘛 上次帖里好像发过通过大模型来打码的 gpt plus 封号似乎也太快了点,一天就给封号了 按流量/token收费的国产官方AI推荐 我算是知道了为什么Oracle总是ABC了 佬友们帮我分析一下 ChatGPT Team账号只有一个人使用和4个席位邀请满了使用的总额度是一样的吗? gpt-free 10个带rt CPA反代claude是默认1m吗? 我终于敢说我做出来windows上tmux的替代了,目标windows/全平台最强的终端Ai编程工具 claude pro升级max,除了原来的$20,好像还能再领一次$100 关于AI agent的知识框架 独乐乐不如众乐乐,分享一下我的的AI对话程序 佬们自建网站支付问题是怎么解决的 怎么能让gpt模仿claude风格输出 codex free已经死了,下一个会是plus或者team吗 请问chatgpt pro里的fast模式,速度快了,降智吗
【篡改猴脚本】油管进度条调整
kksk32 (𒐪) · 2026-05-09 · via LINUX DO - 最新话题

本人喜欢看一些油管上的播客,某句没听清楚的时候需要拉进度条,但是默认跳跃五秒有点多了。

这个好像是油猴论坛找的脚本忘记出处了,但是有点小bug,第一次加载视频不会生效,给优化了一下

// ==UserScript==
// @name         YouTube Skip Time Customizer Fixed
// @namespace    http://tampermonkey.net/
// @version      2.2
// @description  Customize YouTube skip time by arrow key and block Numpad0~Numpad9 function
// @author       TrainingDummy1
// @match        https://www.youtube.com/*
// @run-at       document-start
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
  'use strict';

  if (window.__ytSkipTimeCustomizerInstalled) return;
  window.__ytSkipTimeCustomizerInstalled = true;

  const step = 3;

  function isTargetPage() {
    return location.pathname === '/watch' || location.pathname.startsWith('/shorts/');
  }

  function getVideo() {
    return (
      document.querySelector('video.html5-main-video') ||
      [...document.querySelectorAll('video')].find(v => Number.isFinite(v.duration)) ||
      document.querySelector('video')
    );
  }

  function isTypingTarget(target) {
    if (!(target instanceof Element)) return false;

    const tag = target.tagName;

    return (
      tag === 'INPUT' ||
      tag === 'TEXTAREA' ||
      target.isContentEditable ||
      target.closest('[contenteditable="true"]') ||
      target.closest('[role="textbox"]') ||
      target.id === 'contenteditable-root'
    );
  }

  function stopEvent(event) {
    event.preventDefault();
    event.stopPropagation();
    event.stopImmediatePropagation();
  }

  function seekVideo(direction) {
    const video = getVideo();

    if (!video || !Number.isFinite(video.duration) || !Number.isFinite(video.currentTime)) {
      console.warn('没有找到可用的视频元素');
      return;
    }

    const targetTime = Math.max(
      0,
      Math.min(video.duration, video.currentTime + direction * step)
    );

    let retries = 0;
    const maxRetries = 5;
    const tolerance = 0.15;

    function accurateSeek() {
      video.currentTime = targetTime;

      if (
        Math.abs(video.currentTime - targetTime) < tolerance ||
        retries >= maxRetries
      ) {
        return;
      }

      retries++;
      setTimeout(accurateSeek, 100);
    }

    accurateSeek();
  }

  function onKeyDown(event) {
    if (!isTargetPage()) return;
    if (isTypingTarget(event.target)) return;

    if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {
      stopEvent(event);

      const direction = event.key === 'ArrowRight' ? 1 : -1;
      seekVideo(direction);
      return;
    }

    if (/^Numpad\d$/.test(event.code)) {
      stopEvent(event);
    }
  }

  window.addEventListener('keydown', onKeyDown, {
    capture: true,
    passive: false
  });

  console.log(`YouTube 方向键 ${step} 秒快进/快退脚本已启用`);
})();

image
此处数字为自定义快进秒数