Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tampermonkey script that removes '*' from kwerfeldein.
// ==UserScript==
// @name Closing the Gender*Gap
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Removes '*' and '_' gender gaps to make the text more readable.
// @author Daniel Höpfl
// @match https://kwerfeldein.de/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var txtWalker = document.createTreeWalker (
document.body,
NodeFilter.SHOW_TEXT,
{ acceptNode: function (node) {
//-- Skip whitespace-only nodes
if (node.nodeValue.trim() )
return NodeFilter.FILTER_ACCEPT;
return NodeFilter.FILTER_SKIP;
}
},
false
);
var txtNode = null;
while ((txtNode = txtWalker.nextNode()) != undefined) {
var oldTxt = txtNode.nodeValue;
oldTxt = oldTxt.replace(/[*_]([a-z]+)/g, '$1');
txtNode.nodeValue = oldTxt;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment