gemini字体

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();