Cool Jazz Font

Applies Cool Jazz font to web pages

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Cool Jazz Font
// @namespace    http://tampermonkey.net/ (or your personal URL)
// @version      1.1
// @description  Applies Cool Jazz font to web pages
// @author       You (or your name/handle)
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Create a style element
    const style = document.createElement('style');

    // Define the CSS rules
    // Note: @match *://*/* applies this font globally, which might not always be desired.
    // Consider restricting @match or adding @exclude rules if needed.
    style.textContent = `
        /* Import the Cool Jazz font */
        @import url('https://fonts.cdnfonts.com/css/cool-jazz-2');

        /* Apply the font to the entire page body */
        body {
            /* Use Cool Jazz, falling back to Arial, then generic sans-serif */
            font-family: 'Cool Jazz', Arial, sans-serif !important;
        }
    `;

    // Append the style element to the document's head
    document.head.appendChild(style);

})();