DeepSeek Retry Clicker

Automatically clicks retry icon when server is busy on chat.deepseek.com

  1. // ==UserScript==
  2. // @name DeepSeek Retry Clicker
  3. // @description Automatically clicks retry icon when server is busy on chat.deepseek.com
  4. // @match https://chat.deepseek.com/*
  5. // @version 0.0.1.20250529074528
  6. // @namespace https://greasyfork.org/users/1435046
  7. // ==/UserScript==
  8.  
  9. (function () {
  10. 'use strict';
  11.  
  12. function hasServerBusyMessage() {
  13. return Array.from(document.querySelectorAll('span')).some(span =>
  14. span.textContent.trim() === 'Server busy, please try again later.'
  15. );
  16. }
  17.  
  18. function searchAndClickIconButton() {
  19. for (const div of document.querySelectorAll('div')) {
  20. const svgPath = div.querySelector('svg path[d^="M12 .5C18.351.5"]');
  21. if (svgPath) {
  22. const btn = div.closest('.ds-icon-button');
  23. if (btn) {
  24. btn.click();
  25. break;
  26. }
  27. }
  28. }
  29. }
  30.  
  31. function init() {
  32. // Run once immediately
  33. if (hasServerBusyMessage()) {
  34. searchAndClickIconButton();
  35. }
  36. // Then observe all future changes
  37. new MutationObserver(() => {
  38. if (hasServerBusyMessage()) {
  39. searchAndClickIconButton();
  40. }
  41. }).observe(document.body, { childList: true, subtree: true });
  42. }
  43.  
  44. document.addEventListener('DOMContentLoaded', init);
  45. })();