font-transform

Enhance text content for a better reading experience

  1. // ==UserScript==
  2. // @name font-transform
  3. // @version 0.0.2
  4. // @description Enhance text content for a better reading experience
  5. // @author g4ryzhang
  6. // @include https://chat.openai.com/*
  7. // @grant none
  8. // @license MIT
  9. // @namespace https://gf.qytechs.cn/users/1048646
  10. // ==/UserScript==
  11.  
  12. const rf = () => {
  13. document.body.querySelectorAll('*:not(.flex-col):not(.capandbold)').forEach(node => {
  14. if (node.childElementCount == 0) {
  15. node.innerHTML = node.textContent.replaceAll(/\b[A-Za-z]+\b/g, match => {
  16. if (match.length < 3) return match;
  17. const len = Math.round(match.length / 2);
  18. return `<span class='capandbold' style='font-weight: 700;'>${match.substring(0, len)}</span>${match.substring(len)}`;
  19. });
  20. }
  21. });
  22. }
  23.  
  24. document.addEventListener("keydown", e => {
  25. if (e.code == 'F2') rf();
  26. });
  27.  

QingJ © 2025

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