自用雨课堂防止自动暂停

Prevent YKT video auto pause

// ==UserScript==
// @name         自用雨课堂防止自动暂停
// @namespace    http://tampermonkey.net/
// @version      2025-06-12
// @description Prevent YKT video auto pause
// @author       You
// @match        https://*.yuketang.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=yuketang.cn
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
  'use strict';

  // 等待视频加载完成
  const waitForVideo = setInterval(() => {
    const videos = document.querySelectorAll('video');
    if (videos.length > 0) {
      clearInterval(waitForVideo);
      
      // 批量劫持 pause 方法
      videos.forEach(video => {
        video.pause = function() {
          console.log("阻止了暂停!");
        };
      });
    }
  }, 1000);
})();