Skip to content

Instantly share code, notes, and snippets.

@robertrypula
Last active March 2, 2021 14:35
Show Gist options
  • Save robertrypula/83c1f36070c1991370adf1c8882f5e98 to your computer and use it in GitHub Desktop.
Save robertrypula/83c1f36070c1991370adf1c8882f5e98 to your computer and use it in GitHub Desktop.
Adds 'kurwa' to any website that you want. Simply execute the script in the Console tab in DevTools (F12)
document.querySelectorAll('*').forEach(function(element) {
var content = element.innerHTML.trim().replace(/ +(?= )/g, '');
var wordList = content.split(' ');
var numberOfKurwa = Math.max(1, Math.round(wordList.length * 0.2));
var randomPosition;
var i;
if (content.indexOf('<') === -1 && wordList.length > 1) {
while (numberOfKurwa--) {
randomPosition = Math.max(
1,
Math.floor(Math.random() * wordList.length)
);
wordList.splice(randomPosition, 0, 'kurwa');
}
element.innerHTML = wordList.join(' ');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment