Last active
October 10, 2026 04:09
-
-
Save ugovaretto/4239fe7ba6aafce8b0ab9acc6abd4c7c to your computer and use it in GitHub Desktop.
Show nerdfonts in Deepseek Harness web terminal using Tampermonkey script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Tampermonkey scriot: USE EXISTING HEADER, REMOVE THIS HEADER AND ONLY COPY THE CODE AFTER 'user strict' | |
| // ==UserScript== | |
| // @name DeepSeek Local Nerd Font Canvas Enforcer | |
| // @match *://*:3080/* | |
| // @run-at document-start | |
| // @grant none | |
| // ==UserScript== | |
| (function() { | |
| 'use strict'; | |
| // 1. Target the raw HTML document element before any framework loops mount | |
| const style = document.createElement('style'); | |
| style.innerHTML = ` | |
| :root, html, body { | |
| --ds-font-family-code: "JetBrainsMono Nerd Font", "FiraCode Nerd Font", monospace !important; | |
| --dsw-font-code: "JetBrainsMono Nerd Font", "FiraCode Nerd Font", monospace !important; | |
| --dsw-font-monospace: "JetBrainsMono Nerd Font", "FiraCode Nerd Font", monospace !important; | |
| } | |
| `; | |
| document.documentElement.appendChild(style); | |
| // 2. Intercept dynamically built style nodes or shadow element injections | |
| const observer = new MutationObserver((mutations) => { | |
| mutations.forEach((mutation) => { | |
| mutation.addedNodes.forEach((node) => { | |
| if (node.nodeType === Node.ELEMENT_NODE) { | |
| // Force the font family straight down into any component matching a terminal layout container | |
| if (node.matches('div') || node.matches('canvas')) { | |
| node.style.setProperty('font-family', '"JetBrainsMono Nerd Font", "FiraCode Nerd Font", monospace', 'important'); | |
| } | |
| // Handle shadow-roots on components as they pop into view | |
| if (node.shadowRoot) { | |
| const shadowStyle = document.createElement('style'); | |
| shadowStyle.innerHTML = `* { font-family: "JetBrainsMono Nerd Font", "FiraCode Nerd Font", monospace !important; }`; | |
| node.shadowRoot.appendChild(shadowStyle); | |
| } | |
| } | |
| }); | |
| }); | |
| }); | |
| observer.observe(document.documentElement, { childList: true, subtree: true }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment