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.20250714125247
  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. span.textContent.trim() === 'Check network and retry.'
  16. );
  17. }
  18.  
  19. function searchAndClickIconButton() {
  20. for (const div of document.querySelectorAll('div')) {
  21. const svgPath = div.querySelector('svg path[d^="M12 .5C18.351.5"]');
  22. if (svgPath) {
  23. const btn = div.closest('.ds-icon-button');
  24. if (btn) {
  25. btn.click();
  26. break;
  27. }
  28. }
  29. }
  30. }
  31.  
  32. function init() {
  33. // Run once immediately
  34. if (hasServerBusyMessage()) {
  35. searchAndClickIconButton();
  36. }
  37. // Then observe all future changes
  38. new MutationObserver(() => {
  39. if (hasServerBusyMessage()) {
  40. searchAndClickIconButton();
  41. }
  42. }).observe(document.body, { childList: true, subtree: true });
  43. }
  44.  
  45. document.addEventListener('DOMContentLoaded', init);
  46. })();