Last active
August 29, 2015 14:14
-
-
Save grejppi/14af4ce3603b39115e60 to your computer and use it in GitHub Desktop.
iltasas
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
// ==UserScript== | |
// @name iltasas | |
// @namespace https://gist.github.com/grejppi/14af4ce3603b39115e60 | |
// @include http://www.iltasanomat.fi/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function ses(s) { | |
var e = s.match(/([Ss][AEIOUYÄÖaeiouyäö])/g); | |
return null === e ? ' ' : (e.forEach(function (s, e, n) { | |
n[e] = s.substr(0, 2) + s.substr(0, 1) | |
}), e.join(' ') + ' ') | |
} | |
function sis(s) { | |
if (s = s || document.body, 3 == s.nodeType) s.nodeValue = ses(s.nodeValue); | |
else { | |
var e = s.childNodes; | |
if (e) for (var n = e.length; n--; ) sis(e[n]) | |
} | |
} | |
sis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment