NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name rot17
// @namespace http://tampermonkey.net/
// @version 0.1
// @description mangle text so user can appreciate the layout better! (you need to switch it on and off for all sites using Tampermonkey's menu!)
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let text_nodes = [];
function recursiveWalk(node) {
if (node) {
node = node.firstChild;
while (node !== null) {
if (node.nodeType == 3) {
// Text node, do something, eg:
text_nodes.push(node);
} else if (node.nodeType == 1) {
recursiveWalk(node);
}
node = node.nextSibling;
}
}
}
recursiveWalk(document.body);
text_nodes.forEach((node) => {
node.textContent = node.textContent.replace(/[aeiouöäü]/gi, 'a').replace(/[b-z]/gi, 't');
});
})();