Greasy Fork 还支持 简体中文。

ChatGPT Code Box Styling

Change the font size and enable word wrap in ChatGPT code boxes

目前為 2024-08-30 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name ChatGPT Code Box Styling
  3. // @description Change the font size and enable word wrap in ChatGPT code boxes
  4. // @name:zh-CN ChatGPT 代码字体变小
  5. // @description:zh-CN 让 ChatGPT 代码字体变小,
  6. // @namespace https://greasyfork.org/users/1169082/
  7. // @version 0.1.0.5
  8. // @author 人民的勤务员 <toniaiwanowskiskr47@gmail.com>
  9. // @match https://chatgpt.com/*
  10. // @grant none
  11. // @supportURL https://github.com/ChinaGodMan/UserScripts/issues
  12. // @homepageURL https://github.com/ChinaGodMan/UserScripts
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16.  
  17. (function () {
  18. 'use strict'
  19.  
  20. // 创建并插入自定义的CSS样式
  21. const style = document.createElement('style')
  22. style.type = 'text/css'
  23. style.innerHTML = `
  24. pre code {
  25. font-size: 12px !important; /* 设置字体大小为12px */
  26. white-space: pre-wrap !important; /* 设置自动换行 */
  27. word-break: break-word !important; /* 设置单词断行 */
  28. }
  29.  
  30. pre {
  31. overflow-x: auto !important; /* 允许水平滚动 */
  32. }
  33. `
  34. document.head.appendChild(style)
  35. })()