Login Via Token

Adds a button to the login screen for your token. This one actually works and looks good

// ==UserScript==
// @name         Login Via Token
// @namespace    https://v15.studio/
// @version      v69.420.1
// @description  Adds a button to the login screen for your token. This one actually works and looks good
// @author       Emmet_v15
// @license      BSD
// @match        *://discord.com/login*
// @grant        none
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @run-at       document-end
// ==/UserScript==

function waitForElm(selector) {
    return new Promise(resolve => {
        if (document.querySelector(selector)) {
            return resolve(document.querySelector(selector));
        }

        const observer = new MutationObserver(mutations => {
            if (document.querySelector(selector)) {
                resolve(document.querySelector(selector));
                observer.disconnect();
            }
        });

        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
    });
}
waitForElm('.button-ejjZWC').then((elm) => {
    var button = '<div id="deez" type="nutz" class="marginBottom8-emkd0_ button-1cRKG6 lookFilled-1H2Jvj button-ejjZWC colorBrand-2M3O3N sizeLarge-2xP3-w fullWidth-3M-YBR grow-2T4nbg" style="display:flex;justify-content:center;align-items:center;"><div class="contents-3NembX">Log In Via Token</div></div>'
    $(button).insertAfter('[type="submit"]');
    var tokenIn = '<div class="marginBottom20-315RVT marginTop20-2T8ZJx"><label class="label-7akf7- eyebrow-2wJAoF defaultColor-3Olr-9 defaultMarginlabel-26Urq5" id="pp" for="pp">Token<span class="required-1eGkuP">*</span></label><div class="inputWrapper-2K8ds1"><input class="inputDefault-Ciwd-S input-3O04eu" name="token" type="password" placeholder="" aria-label="Token" autocomplete="off" maxlength="999" spellcheck="false" id="tokenIn" aria-labelledby="" value=""></div></div>'
    $(tokenIn).insertAfter(`[type="submit"]`);

    document.getElementById("deez").addEventListener("click", function(){
        var token = document.getElementById("tokenIn").value;
        window.localStorage = document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage;
        window.setInterval(() => window.localStorage.token = `"${token}"`);
        window.location.reload();
    });
});