uwuifyer

Instantly swaps letters as you press them into uwu style on Discord!

Από την 18/08/2026. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         uwuifyer
// @namespace    http://tampermonkey.net
// @version      1.2
// @description  Instantly swaps letters as you press them into uwu style on Discord!
// @author       You
// @license      MIT
// @match        https://*://
// @match        https://*://*
// @match        https://*://
// @match        https://discord.com*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // Quick single-character layout mapping
    function getUwUKey(key) {
        if (key === 'l' || key === 'r') return 'w';
        if (key === 'L' || key === 'R') return 'W';
        return null;
    }

    // Intercept keyboard hits immediately
    document.addEventListener('keydown', function(event) {
        const target = event.target;
        if (!target) return;

        // Only look at typing inputs
        if (target.getAttribute('contenteditable') === 'true' || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') {
            
            // Check if the pressed key needs to be uwuified
            const replacementKey = getUwUKey(event.key);
            
            if (replacementKey) {
                // Stop the real 'l' or 'r' from ever reaching Discord's input engine
                event.preventDefault();
                event.stopImmediatePropagation();

                // 1. Handle Discord's main Rich Text Chatbox
                if (target.getAttribute('contenteditable') === 'true') {
                    const reactKey = Object.keys(target).find(k => k.startsWith('__reactFiber$') || k.startsWith('__reactInternalInstance$'));
                    if (!reactKey) return;

                    try {
                        let node = target[reactKey];
                        while (node) {
                            if (node.memoizedProps && node.memoizedProps.editor) {
                                // Direct injection into Discord's internal text stream
                                node.memoizedProps.editor.insertText(replacementKey);
                                break;
                            }
                            node = node.return;
                        }
                    } catch (e) {
                        console.error("Keystroke override failed:", e);
                    }
                } 
                // 2. Handle standard plain inputs (Search bars, settings)
                else if (target.value !== undefined) {
                    const start = target.selectionStart;
                    const end = target.selectionEnd;
                    const val = target.value;
                    
                    // Insert 'w' or 'W' right where the cursor is flashing
                    target.value = val.slice(0, start) + replacementKey + val.slice(end);
                    target.setSelectionRange(start + 1, start + 1);
                    
                    // Tell the website something was typed
                    target.dispatchEvent(new Event('input', { bubbles: true }));
                }
            }
        }
    }, true); // Crucial: 'true' catches the finger press before Discord handles it
})();