Skip to content

Instantly share code, notes, and snippets.

@akx
Last active August 29, 2015 14:01
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 akx/eaf12f0f79dea1b27819 to your computer and use it in GitHub Desktop.
Save akx/eaf12f0f79dea1b27819 to your computer and use it in GitHub Desktop.
velhosuomi.js (bookmarklet)
javascript:(function(){[].slice.call(document.querySelectorAll("*")).filter(function(e){return-1==e.innerHTML.indexOf("<")}).forEach(function(e){var n=Math.random()<.7?"aeiou":"äeiöy";e.innerHTML=e.innerHTML.replace(/[aeiouyåäö]+/gi,function(e){var r=n[0|5*Math.random()];return e[0].toUpperCase()==e[0]&&(r=r.toUpperCase()),r})})}());
(function () {
[].slice.call(document.querySelectorAll("*")).filter(function (node) {
return node.innerHTML.indexOf("<") == -1;
}).forEach(function (node) {
var LETTERS = Math.random() < 0.7 ? ("aeiou") : ("äeiöy");
node.innerHTML = node.innerHTML.replace(/[aeiouyåäö]+/ig, function (m) {
var l = LETTERS[0 | (Math.random() * 5)];
if (m[0].toUpperCase() == m[0]) l = l.toUpperCase();
return l;
})
});
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment