Пользовательский шрифт usercript - PullRequest
0 голосов
/ 03 апреля 2020

Я пытаюсь написать пользовательский скрипт, который переопределяет шрифт на сайтах, но он не работает.

// @name         Grafo Everywhere
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://*/*
// @resource font https://cdn.discordapp.com/attachments/694299566190887054/694722341329961010/Grafo-Regular.ttf
// @grant GM.getResourceUrl
// ==/UserScript==

var style = document.createElement('style'); style.innerHTML = `
@font-face {
font-family: grafo;
src: GM.getResourceUrl("font");
}
.div { font-family: grafo; }
`; document.head.appendChild(style);

Что я делаю не так?

...