Skip to content

Instantly share code, notes, and snippets.

@jasoncodes
Last active August 29, 2015 14:14
Show Gist options
  • Save jasoncodes/d575f41d91b5305d0b60 to your computer and use it in GitHub Desktop.
Save jasoncodes/d575f41d91b5305d0b60 to your computer and use it in GitHub Desktop.
Disable Hyphenation and Justification Bookmarklet
Disables hyphenation and full text justification.
Minified using http://chriszarate.github.io/bookmarkleter/.
javascript:void%20function(){for(var%20t=document.querySelectorAll(%22*%22),e=0;e%3Ct.length;++e){var%20l=t[e],n=window.getComputedStyle(l);%22auto%22==n.webkitHyphens%26%26(l.style.webkitHyphens=%22manual%22),%22justify%22==n.textAlign%26%26(l.style.textAlign=%22left%22)}}();
var elements = document.querySelectorAll('*');
for (var i = 0; i < elements.length; ++i) {
var element = elements[i];
var computedStyle = window.getComputedStyle(element);
if (computedStyle.webkitHyphens == 'auto') {
element.style.webkitHyphens = 'manual';
}
if (computedStyle.textAlign == 'justify') {
element.style.textAlign = 'left';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment