Skip to content

Instantly share code, notes, and snippets.

@Down10
Created October 29, 2014 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Down10/37b8a77bb8d54536e475 to your computer and use it in GitHub Desktop.
Save Down10/37b8a77bb8d54536e475 to your computer and use it in GitHub Desktop.
Bookmarklet to toggle text in Safari to render in either full-pixel anti-aliased text or subpixel “LCD” anti-aliased text.
javascript:void((function(d){var%20l,tp='%2A%7B-webkit-font-smoothing%3A',ts='%20%21important%3B',wts='-webkit-text-stroke:0'+ts+'%7D',aafix=d.getElementById('fsaa'),subfix=d.getElementById('fssub'),autofix=d.getElementById('fsauto');if(aafix){aafix.parentNode.removeChild(aafix);l=d.createElement('link');l.rel='stylesheet';l.id='fssub';l.href='data:text/css,'+escape(tp+'subpixel-antialiased'+ts+wts);d.documentElement.childNodes[0].appendChild(l)}else%20if(subfix){subfix.parentNode.removeChild(subfix);l=d.createElement('link');l.rel='stylesheet';l.id='fsauto';l.href='data:text/css,'+escape(tp+'auto'+ts+wts);d.documentElement.childNodes[0].appendChild(l)}else%20if(autofix){autofix.parentNode.removeChild(autofix)}else{l=d.createElement('link');l.rel='stylesheet';l.id='fsaa';l.href='data:text/css,'+escape(tp+'antialiased'+ts+wts);d.documentElement.childNodes[0].appendChild(l)}})(document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment