Wordle Solution

Don't let wordle intimidate you, for you will always win. Hover your mouse on the wordle logo at top of page and you will see the daily word!

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

You will need to install an extension such as Tampermonkey 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         Wordle Solution
// @namespace    http://github.com/Alex-M-Howard/UserSCripts
// @version      1.0
// @match        https://*.nytimes.com/games/wordle/*
// @description  Don't let wordle intimidate you, for you will always win. Hover your mouse on the wordle logo at top of page and you will see the daily word!
// @author       Alex Howard
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    const header = document.getElementsByTagName("header")

    let timer = setInterval(function () {
        if (header.length > 0){
            console.log('Now we are here')
            runMouseOver(timer)
            //header[0].firstElementChild.nextElementSibling.innerText = solution
            clearInterval(timer);
        }
    }, 1000)
}

)()

function runMouseOver(timer) {
    clearInterval(timer);
    const solution = (JSON.parse(localStorage['nyt-wordle-state']).solution).toUpperCase();
    const header = document.getElementsByTagName("header")[0];
    let text = header.firstElementChild.nextElementSibling;
    const logo = text.innerText

    header.addEventListener("mouseover", function (event) {
        text.innerText = solution;
        return
    })

    header.addEventListener("mouseout", function (event) {
        text.innerText = logo;
    })

}