AARP - Go To Next Video

trying to skip to the next video during the AARP driver-ed class

  1. // ==UserScript==
  2. // @name AARP - Go To Next Video
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description trying to skip to the next video during the AARP driver-ed class
  6. // @author You
  7. // @license MIT
  8. // @match https://app.aarpdriversafety.org/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=aarpdriversafety.org
  10. // @grant none
  11. // @require http://code.jquery.com/jquery-3.5.1.min.js
  12. // ==/UserScript==
  13. /* globals jQuery, $, waitForKeyElements */
  14.  
  15. (function() {
  16. 'use strict';
  17. const wait = 5000; // 5 seconds
  18. var counter = 0;
  19.  
  20. setInterval(function(){
  21. const currentUrl = window.location.href;
  22. // we are in the table of contents page
  23. if(currentUrl.indexOf('/dash/index') > 0) {
  24. console.log('going to the next section');
  25. // go to the next available section
  26. $("div[data-test='currentIcon'] div.gritIcon__wrap").click();
  27. }
  28. const video = document.querySelector("video");
  29. if(video) {
  30. console.log('hello video');
  31. video.muted = true;
  32. video.play();
  33. video.pause();
  34. video.currentTime = video.duration; // go to the end of the video
  35.  
  36. const isDisabled = $('#arrow-next').is(":disabled");
  37. if (!isDisabled) {
  38. let arrow = $('.icon.gritIcon--arrow-forward');
  39. arrow.click();
  40. }
  41. } else {
  42. console.log('hello: ' + counter);
  43. const timer = $('div.isTimer span.children div').text();
  44. if (timer == "00:00") {
  45. let arrow = $('.icon.gritIcon--arrow-forward');
  46. arrow.click();
  47. counter++;
  48. console.log('goodbye: ' + counter);
  49. }
  50. }
  51. }, wait);
  52. })();

QingJ © 2025

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