Force Font to Pretendard Variable

Force all fonts on a webpage to use Pretendard Variable

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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);
})();