Qwen.ai CodeBlock Font Fix (No More Serif)

让 Qwen Chat 代码快使用非衬线字体, 让代码快更加美观易读. Use sans-serif fonts to make the Qwen Chat code block more aesthetically pleasing and readable

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Qwen.ai CodeBlock Font Fix (No More Serif)
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  让 Qwen Chat 代码快使用非衬线字体, 让代码快更加美观易读. Use sans-serif fonts to make the Qwen Chat code block more aesthetically pleasing and readable
// @author       DBin_K
// @match        https://chat.qwen.ai/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // 设置目标字体
    const monoFont = '"Lucida Console", Consolas';

    // 创建 <style> 标签
    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = `
        .ͼ1 .cm-scroller {
            font-family: ${monoFont} !important;
        }
    `;

    // 插入到 <head> 中生效
    document.head.appendChild(style);
})();