根本停不下来

炫迈,根本停不下来

目前为 2021-04-05 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 根本停不下来
  3. // @namespace a23187.cn
  4. // @version 1.0.1
  5. // @author sudongpo
  6. // @description 炫迈,根本停不下来
  7. // @icon64 https://addons.cdn.mozilla.net/user-media/addon_icons/2273/2273929-64.png?modified=bb95c65b
  8. // @supportURL https://addons.mozilla.org/zh-CN/firefox/addon/%E6%A0%B9%E6%9C%AC%E5%81%9C%E4%B8%8D%E4%B8%8B%E6%9D%A5/
  9. // @match https://*.xuetangx.com/*
  10. // @require http://code.jquery.com/jquery-3.4.1.min.js
  11. // @grant none
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. if(window.location.hash.match(/^#\/video\//)) {
  18. var timeoutHandle;
  19. var refresh_wait_time = 40;
  20.  
  21. var time_remain = refresh_wait_time;
  22.  
  23. var intervalHandle = setInterval(() => {
  24. if($(".spinner").css("display") != "none") {
  25. document.title = "视频加载中 ( " + time_remain +"s 后自动刷新 )";
  26. if(time_remain == refresh_wait_time) {
  27. timeoutHandle = setTimeout(() => location.reload(true), time_remain * 1000);
  28. }
  29. time_remain--;
  30. } else {
  31. clearTimeout(timeoutHandle);
  32. time_remain = refresh_wait_time;
  33. var play_btn = $(".xt_video_player_play_btn");
  34. if(!play_btn.hasClass("xt_video_player_play_btn_pause")) {
  35. play_btn.click();
  36. }
  37. document.title = "根本停不下来";
  38. }
  39. }, 1000);
  40.  
  41. $("#video").on("ended", () => {
  42. clearInterval(intervalHandle);
  43. document.title = "看完啦";
  44. });
  45. }
  46. })();

QingJ © 2025

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