新乡医学院学习系统10倍速插件

新乡医学院学习系统10倍速插件,节省时间,无风险,快速拿积分

  1. // ==UserScript==
  2. // @name 新乡医学院学习系统10倍速插件
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.7
  5. // @description 新乡医学院学习系统10倍速插件,节省时间,无风险,快速拿积分
  6. // @author ¥whz¥
  7. // @match https://www.xxyxyedu.com/edu/course/*
  8. // @match http://113.219.200.145:9000/console/index.aspx
  9. // @match http://113.219.200.145:9000/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=200.145
  11. // @require https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/layer/2.3/layer.js
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. function insertRate(){
  20. var select = $('iframe[id*="layui-layer-iframe"]').contents().find('select[id="selRate"]')
  21. if(select.length > 0) {
  22. console.log('aaaaaa',select.children())
  23. $('<option></option>')
  24. .css('color', 'red')
  25. .attr('value', '10').text('10')
  26. .appendTo(select);
  27.  
  28. console.log('aaaaaa',$('#selRate').children())
  29.  
  30. }
  31. }
  32.  
  33. let observerIframe = null
  34. function startObserverIframe(){
  35. var iframe = document.querySelector('iframe[id*=layui-layer-iframe]')
  36. // var hasIframe = iframe.body != undefined
  37. // 未创建时,在创建观察
  38. // if(observerIframe && !hasIframe){
  39. // observerIframe = null
  40. // }
  41. // if (hasIframe && !observerIframe){
  42. // observerIframe = new MutationObserver(function (records) {
  43. // insertRate()
  44. // });
  45. // observerIframe.observe( iframe.body, {
  46. // childList: true,
  47. // subtree: true,
  48. // });
  49. // }
  50. if(iframe){
  51. iframe.addEventListener('load', () => {
  52. if(iframe.contentDocument.body.childNodes.length > 0) {
  53. console.log('has child nodes');
  54. insertRate()
  55. }
  56. });
  57. }else{
  58.  
  59. // 兼容其他网站
  60. var video = document.querySelector('video')
  61. if(video){
  62. $('video')
  63. .on('loadedmetadata', function() {
  64. if($('#rate10Btn').length == 0){
  65. var videoCtrl = document.querySelector('.art-controls-right')
  66. $('<button>')
  67. .css('color', 'red')
  68. .attr('id', 'rate10Btn').text('10倍速')
  69. .appendTo(videoCtrl)
  70. .on('click', function() {
  71. // 获取视频元素并设置播放速度
  72. video.playbackRate = 10;
  73. alert('视频播放速度已设置为10倍!');
  74. });
  75. $('<button>')
  76. .css('color', 'red')
  77. .attr('id', 'rate16Btn').text('16倍速')
  78. .appendTo(videoCtrl)
  79. .on('click', function() {
  80. // 获取视频元素并设置播放速度
  81. video.playbackRate = 16;
  82. alert('视频播放速度已设置为16倍!');
  83. });
  84. }
  85. })
  86. }
  87. }
  88. }
  89.  
  90. var oldTime = new Date();
  91. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  92. var observer = new MutationObserver(function (records) {
  93. var newTime = new Date();
  94. if (newTime - oldTime > 200) {
  95. oldTime = newTime;
  96. startObserverIframe()
  97. }
  98. });
  99. var option = {
  100. childList: true,
  101. subtree: true,
  102. };
  103. observer.observe( document.body, option);
  104.  
  105.  
  106.  
  107. })();

QingJ © 2025

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