Skip to content

Commit

Permalink
data-crystal: include all subdomains and fix css
Browse files Browse the repository at this point in the history
  • Loading branch information
euamotubaina committed Dec 28, 2024
1 parent 5813385 commit b9b4e38
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions data-crystal.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// ==UserScript==
// @name Data Crystal monospace
// @namespace github.com/euamotubaina
// @version 2024-12-15
// @version 2024-12-28
// @description Upgrade monospace font
// @author euamotubaina
// @match https://datacrystal.tcrf.net/*
// @match https://*.tcrf.net/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tcrf.net
// @grant none
// @downloadURL https://raw.githubusercontent.com/euamotubaina/userscripts/main/data-crystal.js
Expand All @@ -14,15 +14,12 @@
(() => {
'use strict';

window.addEventListener("load", () => {
// console.log(document.querySelectorAll("link[rel=stylesheet]"))
const linkEls = document.querySelectorAll("link[rel=stylesheet]");
if (linkEls) {
const preStyle = [...linkEls[1].sheet.cssRules].find(rule => rule.selectorText == 'textarea, pre, code, tt');
if (preStyle) {
preStyle.style.fontFamily = `"Roboto Mono", ${preStyle.style.fontFamily}`;
}
}
});
const customMonoEl = document.createElement('style');
customMonoEl.textContent = `
textarea, pre, code, tt {
font-family: 'Roboto Mono', 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', monospace;
}`;
document.head.appendChild(customMonoEl);


})();

0 comments on commit b9b4e38

Please sign in to comment.