AutoScroll Plus

AutoScroll avec contrôle de vitesse et navigation rapide

  1. // ==UserScript==
  2. // @name AutoScroll Plus
  3. // @namespace https://gf.qytechs.cn/users/1429467
  4. // @description AutoScroll avec contrôle de vitesse et navigation rapide
  5. // @include http*
  6. // @version 1.0
  7. // @author Lakfu sama
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. let scrolling = false;
  15. let speed = 50; // Temps en ms entre chaque scroll (plus bas = plus rapide)
  16. let scrollInterval;
  17.  
  18. function startScrolling() {
  19. if (!scrolling) {
  20. scrolling = true;
  21. scrollInterval = setInterval(() => {
  22. window.scrollBy(0, 5); // Ajuste la valeur pour modifier l'incrément du scroll
  23. }, speed);
  24. }
  25. }
  26.  
  27. function stopScrolling() {
  28. scrolling = false;
  29. clearInterval(scrollInterval);
  30. }
  31.  
  32. function increaseSpeed() {
  33. if (speed > 10) {
  34. speed -= 10;
  35. restartScrolling();
  36. }
  37. }
  38.  
  39. function decreaseSpeed() {
  40. speed += 10;
  41. restartScrolling();
  42. }
  43.  
  44. function restartScrolling() {
  45. if (scrolling) {
  46. stopScrolling();
  47. startScrolling();
  48. }
  49. }
  50.  
  51. function scrollToTop() {
  52. window.scrollTo({ top: 0, behavior: 'smooth' });
  53. }
  54.  
  55. function scrollToBottom() {
  56. window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
  57. }
  58.  
  59. // Raccourcis clavier
  60. document.addEventListener('keydown', function(event) {
  61. switch (event.key) {
  62. case 's': // Démarrer/Pause (toggle)
  63. scrolling ? stopScrolling() : startScrolling();
  64. break;
  65. case '+': // Augmenter la vitesse
  66. increaseSpeed();
  67. break;
  68. case '-': // Diminuer la vitesse
  69. decreaseSpeed();
  70. break;
  71. case 't': // Aller en haut
  72. scrollToTop();
  73. break;
  74. case 'b': // Aller en bas
  75. scrollToBottom();
  76. break;
  77. }
  78. });
  79.  
  80. console.log("AutoScroll Plus chargé :\n[s] Démarrer/Pause | [+] Augmenter vitesse | [-] Diminuer vitesse | [t] Haut | [b] Bas");
  81. })();

QingJ © 2025

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