Created
August 22, 2023 13:22
-
-
Save biaocy/e80b83af1c13c9f6bd712efb759822ed to your computer and use it in GitHub Desktop.
Replace twitter ugly font in Chinese
This file contains 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
// ==UserScript== | |
// @name Twitter font beauty | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Replace twitter ugly font in Chinese! | |
// @author Bill Chan | |
// @match https://twitter.com/* | |
// @icon | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var rule = `div[data-testid="tweetText"] > span { | |
font-family: system-ui !important; | |
}`; | |
var styleElement = document.createElement("style"); | |
styleElement.type = "text/css"; | |
if (styleElement.style.cssText) { | |
styleElement.style.cssText = rule; | |
} else { | |
styleElement.appendChild(document.createTextNode(rule)); | |
} | |
document.getElementsByTagName("head")[0].appendChild(styleElement); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment