JetBrains the World

Let JetBrains take over the world.

  1. // ==UserScript==
  2. // @name JetBrains the World
  3. // @name:ja 世界をジェットブレインズに
  4. // @version 2024-3-21
  5. // @description Let JetBrains take over the world.
  6. // @description:ja ジェットブレインズに世界を任せよう。
  7. // @author PowfuArras
  8. // @match *://*/*
  9. // @icon https://cdn.glitch.global/0569f2ce-2c37-40fa-ae0e-360edca67c05/0978a0f9-98ab-4629-ac25-bf4b0b2abb21.image.png?v=1703726101721
  10. // @grant GM_setValue
  11. // @grant GM_getValue
  12. // @grant GM_registerMenuCommand
  13. // @run-at document-start
  14. // @namespace https://greasyfork.org/users/951187
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. "use strict";
  19. const fontLinkElement = document.createElement('link');
  20. fontLinkElement.rel = 'stylesheet';
  21. fontLinkElement.href = 'https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500&display=swap';
  22. document.head.appendChild(fontLinkElement);
  23.  
  24. const style = document.createElement('style');
  25. style.innerHTML = `* { font-family: 'JetBrains Mono', monospace !important; }`;
  26. if (GM_getValue(location.host, true)) document.head.appendChild(style);
  27.  
  28. GM_registerMenuCommand('Toggle for this site', function () {
  29. const enabled = GM_getValue(location.host, true);
  30. GM_setValue(location.host, !enabled);
  31. if (enabled) document.head.removeChild(style);
  32. else document.head.appendChild(style);
  33. });
  34. })();