Duolingo Pro Beta (Support)

Fixi the Listening only mode from the original extension.

  1. // ==UserScript==
  2. // @name Duolingo Pro Beta (Support)
  3. // @namespace http://tampermonkey.net/
  4. // @license MIT
  5. // @version 2024-04-09
  6. // @description Fixi the Listening only mode from the original extension.
  7. // @author Zensud
  8. // @match https://www.duolingo.com/*
  9. // @icon https://imgs.search.brave.com/V03bRmemSGDlrBy5Iq1IdnhmfODnqNAC0L6F7si5F6w/rs:fit:32:32:1/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvY2NjMzk1YmM5/Y2ZhZTFkYTg3ZTlm/NjNhZjZiYjY3M2Yy/NTZmMmUyNDQwYzkx/MTY2MjJjMWRmYWRi/Mjc4NzQxMy93d3cu/ZHVvbGluZ28uY29t/Lw
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const listeningPage = "https://www.duolingo.com/practice-hub/listening-practice"; //Listening url
  17. let buttonClicked = false;
  18.  
  19. function navigateTolisteningPage() {
  20. window.location.href = listeningPage;
  21. }
  22.  
  23. //click Solve all button automaticlly
  24. function clickButtonOnce() {
  25. if (!buttonClicked) {
  26. const button = document.getElementById("solveAllButton");
  27. if (button) {
  28. button.click();
  29. buttonClicked = true;
  30. }
  31. }
  32. }
  33.  
  34. // Check if the current page is the practice-hub
  35. if (window.location.href === "https://www.duolingo.com/practice-hub") {
  36. // If on the practice-hub, navigate to the listening page
  37. navigateTolisteningPage();
  38. } else if (window.location.href === listeningPage) {
  39. // If on the listening, click the button
  40. clickButtonOnce();
  41. }
  42.  
  43. // Continuously check if the current page is the practice-hub or the listening page, and navigate/click button accordingly
  44. setInterval(function() {
  45. if (window.location.href === "https://www.duolingo.com/practice-hub") {
  46. navigateTolisteningPage();
  47. } else if (window.location.href === listeningPage) {
  48. clickButtonOnce();
  49. }
  50. }, 5000); // Adjust the interval
  51. })();

QingJ © 2025

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