SillyTavern - Excessive text hiding

Removes all dialogues on the current page each time the 1 key on the keyboard is pressed except for the last 10 dialogues and new dialogues.

  1. // ==UserScript==
  2. // @name SillyTavern - Excessive text hiding
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.9.7
  5. // @description Removes all dialogues on the current page each time the 1 key on the keyboard is pressed except for the last 10 dialogues and new dialogues.
  6. // @author Kurayami
  7. // @match http://127.0.0.1:8000/*
  8. // @license LGPL-3.0-or-later
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. window.addEventListener("keypress", function(event) {
  14. if (event.key === "1") { hidden(); }
  15. });
  16. function hidden() {
  17. var elements = document. getElementsByClassName("mes");
  18. for(let i = 1; i < elements.length; i++) {
  19. elements[i].style.display = "null";
  20. }
  21. for(let i = 1; i < elements.length - 10; i++) {
  22. elements[i].style.display = "none";
  23. }
  24. }
  25. })();

QingJ © 2025

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