Created
July 1, 2018 05:53
-
-
Save yehgdotnet/a59b9a05de4b48d6f10939e8580a3ceb to your computer and use it in GitHub Desktop.
TamperMonkey Use Readable Font from MEDIUM.COM
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 Readable_Font | |
// @namespace http://yehg.net | |
// @version 0.1 | |
// @author yehg.net | |
// @description TamperMonkey Use Readable Font from MEDIUM.COM | |
// @author You | |
// @match http://your-favourite-news-site/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var cssId = 'readable_css'; // you could encode the css path itself to generate id.. | |
if (!document.getElementById(cssId)) | |
{ | |
var head = document.getElementsByTagName('head')[0]; | |
var link = document.createElement('link'); | |
link.id = cssId; | |
link.rel = 'stylesheet'; | |
link.type = 'text/css'; | |
link.href = 'https://glyph.medium.com/css/e/sr/latin/e/ssr/latin/e/ssb/latin/m2.css'; | |
link.media = 'all'; | |
head.appendChild(link); | |
var link1 = document.createElement('link'); | |
link1.rel = 'stylesheet'; | |
link1.type = 'text/css'; | |
link1.href = 'https://cdn-static-1.medium.com/_/fp/css/main-branding-base.Wd2nhDzXq-LXOBFJaK5iAA.css'; | |
link1.media = 'all'; | |
head.appendChild(link1); | |
} | |
var s = document.createElement("style"); | |
s.type = "text/css"; | |
s.textContent = "* { color:black; font-size: 18px!important; font-family: 'medium-content-serif-font'!important; }"; | |
document.head.appendChild(s); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment