Brute-force converts your typed text into uwu style across ALL websites seamlessly!
Versão de:
// ==UserScript==
// @name Universal uwuifyer
// @namespace http://tampermonkey.net
// @version 1.5
// @description Brute-force converts your typed text into uwu style across ALL websites seamlessly!
// @author You
// @license MIT
// @match *://*/*
// @include *
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
function uwuify(text) {
return text
.replace(/[lr]/g, 'w')
.replace(/[LR]/g, 'W')
.replace(/n([aeiou])/g, 'ny$1')
.replace(/N([aeiou])/g, 'Ny$1')
.replace(/N([AEIOU])/g, 'NY$1')
.replace(/ove/g, 'uv');
}
function forceInjectText(target, newText) {
target.focus();
if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') {
target.select();
} else {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(target);
selection.removeAllRanges();
selection.addRange(range);
}
document.execCommand('insertText', false, newText);
}
document.addEventListener('input', function(event) {
const target = event.target;
if (!target || target.dataset.isUwUing) return;
const isInput = target.tagName === 'INPUT' || target.tagName === 'TEXTAREA';
const isEditable = target.getAttribute('contenteditable') === 'true';
if (isInput || isEditable) {
const original = isInput ? target.value : target.innerText;
const converted = uwuify(original || "");
if (original !== converted) {
target.dataset.isUwUing = 'true';
forceInjectText(target, converted);
delete target.dataset.isUwUing;
}
}
}, true);
})();