JetBrains the World

Let JetBrains take over the world.

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         JetBrains the World
// @name:ja      世界をジェットブレインズに
// @version      2024-3-21
// @description  Let JetBrains take over the world.
// @description:ja ジェットブレインズに世界を任せよう。
// @author       PowfuArras
// @match        *://*/*
// @icon         https://cdn.glitch.global/0569f2ce-2c37-40fa-ae0e-360edca67c05/0978a0f9-98ab-4629-ac25-bf4b0b2abb21.image.png?v=1703726101721
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_registerMenuCommand
// @run-at       document-start
// @namespace https://greasyfork.org/users/951187
// ==/UserScript==

(function() {
    "use strict";
    const fontLinkElement = document.createElement('link');
    fontLinkElement.rel = 'stylesheet';
    fontLinkElement.href = 'https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500&display=swap';
    document.head.appendChild(fontLinkElement);

    const style = document.createElement('style');
    style.innerHTML = `* { font-family: 'JetBrains Mono', monospace !important; }`;
    if (GM_getValue(location.host, true)) document.head.appendChild(style);

    GM_registerMenuCommand('Toggle for this site', function () {
        const enabled = GM_getValue(location.host, true);
        GM_setValue(location.host, !enabled);
        if (enabled) document.head.removeChild(style);
        else document.head.appendChild(style);
    });
})();