roblox font update reverter

reverts the godawful font

სკრიპტის ინსტალაცია?
ავტორის შემოთავაზებული სკრიპტი

შეიძლება მოგეწონოს roblox classic light theme.

სკრიპტის ინსტალაცია
  1. // ==UserScript==
  2. // @name roblox font update reverter
  3. // @namespace wtf
  4. // @version 1.81
  5. // @description reverts the godawful font
  6. // @author You
  7. // @match https://www.roblox.com/*
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15.  
  16.  
  17. var link = document.createElement("link"); //font is missing on some systems, so we have to make sure it exists
  18. link.href = "https://fonts.googleapis.com/css?family=Source+Sans+Pro:100,200,300,400,500,600,700,800,900";
  19. link.rel = "stylesheet";
  20. document.getElementsByTagName("head")[0].appendChild(link);
  21.  
  22. // below from: https://stackoverflow.com/questions/39346747/tampermonkey-script-run-before-page-load
  23. new MutationObserver(function(mutations) { //create mutation observer that will observe page changes as the page loads
  24. if (document.getElementsByClassName('gotham-font')[0]) { //check if any element with "gotham-font" class has been inserted
  25. var gothamFontElements = document.getElementsByClassName("gotham-font"); //get all elements with the "gotham-font" class
  26. var gothamFontArray = Array.from(gothamFontElements) //create an array from that so we can run .forEach
  27. gothamFontArray.forEach(function(a){ //run the function for each element with the "gotham-font" class
  28. a.className = a.className.replace("gotham-font", ""); //set its className to its className without gotham-font (replace gotham-font with just blank)
  29. });
  30. }
  31. }).observe(document, {childList: true, subtree: true}); //observe page changes as the page loads. this stops the ugly ass font from appearing for a split second and stops it from appearing altogether
  32.  
  33.  
  34. // in Sept 2019 HCo Gotham SSm was added as the primary font-family in body and headers. this reverts that change
  35. var styleSheet = document.createElement("style")
  36. styleSheet.type = "text/css"
  37. styleSheet.innerText = `
  38. h1, h2, h3, h4, h5, body, pre {
  39. font-family: Source Sans Pro,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif !important;
  40. }
  41. `
  42. document.head.appendChild(styleSheet)
  43.  
  44.  
  45. })();