Last active
August 29, 2015 14:06
-
-
Save itzaks/3ed3df7a875e06308cc7 to your computer and use it in GitHub Desktop.
Simple bookmarklet for injecting readability styles straight into the page.
This file contains hidden or 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
| (function() { | |
| function loadScript(a,b){ | |
| var c=document.createElement('script'); | |
| c.type='text/javascript';c.src=a; | |
| var d=document.getElementsByTagName('head')[0],done=false; | |
| c.onload=c.onreadystatechange=function(){ | |
| if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){ | |
| done=true; | |
| b() | |
| } | |
| }; | |
| d.appendChild(c) | |
| } | |
| loadScript('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', function(){ | |
| $('body, p, td').css({ | |
| fontSize: '21px', | |
| fontFamily: "'Sentinel SSm A', 'Sentinel SSm B', 'Palatino Linotype', 'Book Antiqua', Palatino, serif", | |
| lineHeight: '36.3999977111816px' | |
| }); | |
| $('body').css({ | |
| maxWidth: '750px', margin: '0 auto' | |
| }); | |
| }) | |
| })(); | |
| /* Bookmarklet vvvvvv | |
| javascript:(function() { function loadScript(a,b){ var c=document.createElement('script'); c.type='text/javascript';c.src=a; var d=document.getElementsByTagName('head')[0],done=false; c.onload=c.onreadystatechange=function(){ if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){ done=true; b() } }; d.appendChild(c) } loadScript('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', function(){ $('body, p, td').css({ fontSize: '21px', fontFamily: "'Sentinel SSm A', 'Sentinel SSm B', 'Palatino Linotype', 'Book Antiqua', Palatino, serif", lineHeight: '36.3999977111816px' }); $('body').css({ maxWidth: '750px', margin: '0 auto' }); }) })(); | |
| just copy paste ^^^^^^*/ |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on this: http://css-tricks.com/bookmarklet-colorize-text-45-75-characters-line-length-testing/
And some styles from readability.
When readability doesn't work, this can be a dirty fix for still applying some styles.