gemini字体

Applies Times New Roman font to the main body text of AI responses on both Gemini and ChatGPT, while preserving all other formatting.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         gemini字体
// @namespace    http://tampermonkey.net/
// @version      2.3
// @description  Applies Times New Roman font to the main body text of AI responses on both Gemini and ChatGPT, while preserving all other formatting.
// @author       toufu
// @match        https://gemini.google.com/*
// @match        https://chat.openai.com/*
// @match        https://chatgpt.com/*
// @grant        GM_addStyle
// @run-at       document-start
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const css = `
        /* --- Gemini --- */
        /* Targets the main response container on Gemini */
        .markdown {
            font-family: "Times New Roman", serif !important;
        }

        /* --- ChatGPT --- */
        /* Directly targets text-containing elements within the assistant's message block */
        div[data-message-author-role="assistant"] p,
        div[data-message-author-role="assistant"] li,
        div[data-message-author-role="assistant"] ol,
        div[data-message-author-role="assistant"] ul,
        div[data-message-author-role="assistant"] blockquote {
            font-family: "Times New Roman", serif !important;
        }

        /* --- Universal Code Block Styling --- */
        /* Restores monospace font for code blocks on both platforms */
        .markdown pre,
        .markdown code,
        div[data-message-author-role="assistant"] pre,
        div[data-message-author-role="assistant"] code {
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace !important;
        }
    `;

    GM_addStyle(css);
})();