Change font for YouTube

%description%

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        Change font for YouTube
// @namespace   fds
// @description %description%
// @include     https://www.youtube.com/*
// @include     https://studio.youtube.com/*
// @include     https://googleusercontent.com/*
// @exclude     %exclude%
// @version     1
// @grant       none
// @require     https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==

// jshint esversion: 8

function changeFontOfIFrameCtnts(iframeToChange)
{
	for(let elementCur of $("*", iframeToChange.contentDocument.body))
		if(elementCur.nodeName == "iframe")
			changeFontOfIFrameCtnts(elementCur);
		else if(elementCur.style.fontFamily != "" && elementCur.style.fontFamily != undefined && elementCur.style.fontFamily != null)
			elementCur.style.fontFamily = "Times New Roman";
}

if($("#google-feedback-wizard").length == 0)
{
	var timer = setInterval(
		function()
		{
			if($("#google-feedback-wizard").length > 0 && $("#snapshot", $("#google-feedback-wizard")[0].contentDocument).length > 0)
			{
				clearInterval(timer);

				changeFontOfIFrameCtnts($("#google-feedback-wizard")[0]);
			}
		}, 5000);
}