Force Font to Pretendard Variable

Force all fonts on a webpage to use Pretendard Variable

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Force Font to Pretendard Variable
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Force all fonts on a webpage to use Pretendard Variable
// @author       Heetaek Woo
// @match        *://*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 링크가 없는 경우, Pretendard Variable 폰트 링크를 추가
    const fontLink = document.createElement('link');
    fontLink.href = 'https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css';
    fontLink.rel = 'stylesheet';
    document.head.appendChild(fontLink);

    // 모든 텍스트 요소에 Pretendard Variable 적용
    const style = document.createElement('style');
    style.innerHTML = `
        * {
            font-family: 'Pretendard Variable', sans-serif !important;
        }
    `;
    document.head.appendChild(style);
})();