Greasy Fork 还支持 简体中文。

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!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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;
    })

}