Last active
August 29, 2015 14:14
-
-
Save jasoncodes/d575f41d91b5305d0b60 to your computer and use it in GitHub Desktop.
Disable Hyphenation and Justification Bookmarklet
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
Disables hyphenation and full text justification. | |
Minified using http://chriszarate.github.io/bookmarkleter/. |
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
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)}}(); |
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
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