Skip to content

Instantly share code, notes, and snippets.

@flyingfisch
Last active December 30, 2015 21:40
Show Gist options
  • Save flyingfisch/ce6789a1cd5d44373272 to your computer and use it in GitHub Desktop.
Save flyingfisch/ce6789a1cd5d44373272 to your computer and use it in GitHub Desktop.
fixed disqus problem
// ==UserScript==
// @name easy-reading
// @namespace flyingfisch@toppagedesign.com
// @include *
// @version 1.22
// @grant none
// ==/UserScript==
// to install, click the raw button in the upper right
var hasStyleSheets = false;
var inFrame = window.self !== window.top;
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].href != null) {
hasStyleSheets = true;
}
}
if (!hasStyleSheets && !inFrame) {
var el = document.getElementsByTagName("body")[0].style;
el.maxWidth = '40em';
el.margin = '1em auto';
el.fontFamily = '"Palatino Linotype","Book Antiqua",Palatino,serif';
el.lineHeight = '1.7em';
el.fontSize = '18px';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment