Persistent Auto-Click "Continue" on UpLearn

Continuously simulates user click on UpLearn's "Continue" button across multiple lessons/pages in SPA environment like React (no full reloads needed). 🧠✨

  1. // ==UserScript==
  2. // @name Persistent Auto-Click "Continue" on UpLearn
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Continuously simulates user click on UpLearn's "Continue" button across multiple lessons/pages in SPA environment like React (no full reloads needed). 🧠✨
  6. // @author JustSimplyDnaie
  7. // @match *://*.uplearn.co.uk/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. const BUTTON_SELECTOR = 'button[type="submit"]';
  16. const OBSERVER_DELAY = 500; // How often to check DOM changes
  17. let clickedRecently = false;
  18.  
  19. function simulateClick(element) {
  20. console.log('[Auto-Click] Simulating click on "Continue"...');
  21. const mouseEvent = new MouseEvent('click', {
  22. bubbles: true,
  23. cancelable: true,
  24. view: window,
  25. });
  26. element.dispatchEvent(mouseEvent);
  27. clickedRecently = true;
  28.  
  29. setTimeout(() => {
  30. clickedRecently = false;
  31. }, 3000); // prevent double-clicking during countdown transitions
  32. }
  33.  
  34. function tryClickContinue() {
  35. if (clickedRecently) return;
  36.  
  37. const buttons = document.querySelectorAll(BUTTON_SELECTOR);
  38. for (const btn of buttons) {
  39. if (btn.textContent.trim().toLowerCase() === 'continue') {
  40. console.log('[Auto-Click] Found "Continue" button. Clicking...');
  41. simulateClick(btn);
  42. break;
  43. }
  44. }
  45. }
  46.  
  47. // Setup MutationObserver to detect dynamic content changes
  48. const observer = new MutationObserver(() => {
  49. tryClickContinue();
  50. });
  51.  
  52. window.addEventListener('load', () => {
  53. console.log('[Auto-Click] Loaded. Watching for DOM changes...');
  54. observer.observe(document.body, {
  55. childList: true,
  56. subtree: true
  57. });
  58.  
  59. // Initial check in case button already present
  60. setTimeout(tryClickContinue, 1000);
  61. });
  62. })();