SillyTavern Screenreader Accessibility Fixes

Adds Aria labels and roles to the various divs in SillyTavern.

  1. // ==UserScript==
  2. // @name SillyTavern Screenreader Accessibility Fixes
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-08-11
  5. // @description Adds Aria labels and roles to the various divs in SillyTavern.
  6. // @author originally by chigkim, userscriptified by fastfinge
  7. // @match http://127.0.0.1:8000/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=0.1
  9. // @grant none
  10. // @license public domain
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var divs = document.querySelectorAll('div');
  17. divs.forEach(function(div) {
  18. if (div.textContent.trim() === '' && div.hasAttribute('title')) {
  19. div.setAttribute('aria-label', div.getAttribute('title'));
  20. div.setAttribute('role', 'button');
  21. }
  22. });
  23. })();

QingJ © 2025

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