Wordle Autocomplete

Complete the current Wordle with just the click of a button

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Wordle Autocomplete
// @namespace    https://spin.rip/
// @version      1.0
// @description  Complete the current Wordle with just the click of a button
// @author       Spinfal
// @match        https://www.nytimes.com/games/wordle/index.html
// @icon         https://www.google.com/s2/favicons?domain=nytimes.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const img = document.createElement("img");
    img.src = "https://cdn.spin.rip/r/cheat.png";
    img.setAttribute("style", "filter: invert(100%); width: 1.48em; height: 1.48em; padding-left: 0.4em; cursor: pointer;");
    img.setAttribute("aria-label", "Run Cheat");

    window.onload = () => {
        const solution = JSON.parse(localStorage.getItem('nyt-wordle-state')).solution.split("");

        document.querySelector("body > game-app").shadowRoot.querySelector("game-theme-manager > header > div.menu-right").appendChild(img);

        document.querySelector("body > game-app").shadowRoot.querySelector("game-theme-manager > header > div.menu-right > img").addEventListener("click", () => {
            document.querySelector("body > game-app").shadowRoot.querySelector("game-theme-manager > header > div.title").innerText = " Wordle owo ";
            solution.forEach(letter => {
                clickKey(letter);
            });
        });
    }

    function clickKey(data) {
        document.querySelector("body > game-app").shadowRoot.querySelector("#game > game-keyboard").shadowRoot.querySelector("#keyboard").querySelector(`[data-key=${data}]`).click();
    }
})();