Wordle - Word Reveal Hack

This script adds an element to the bottom of the page with the daily word. Simply hover it and the daily word is revealed. Click to show and alert. Always "guess" the word in the first try and impress your friends.

目前為 2022-02-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Wordle - Word Reveal Hack
// @namespace    q1k
// @version      1.3.1
// @description  This script adds an element to the bottom of the page with the daily word. Simply hover it and the daily word is revealed. Click to show and alert. Always "guess" the word in the first try and impress your friends.
// @author       q1k
// @include      *://www.powerlanguage.co.uk/wordle/*
// @include      *://www.nytimes.com/games/wordle/*
// @run-at       document-idle
// ==/UserScript==

var mydiv = document.createElement("div");
mydiv.setAttribute("id","word-reveal");
var styles = document.createElement("style");
styles.innerHTML="#word-reveal{user-select:none;text-align:center;line-height:1.5em;background:#555;color:#555;} #word-reveal:hover{color:white;} .game-id{display:none;}";

var game = document.querySelector("game-app").shadowRoot.querySelector("#game");
game.appendChild(styles);
game.appendChild(mydiv);
var word="";
if(location.domain=='www.powerlanguage.co.uk'){
    word=JSON.parse(localStorage.gameState).solution.toUpperCase();
} else {
    word=JSON.parse(localStorage['nyt-wordle-state']).solution.toUpperCase();
}
mydiv.addEventListener('click',function(e){
    alert("\nToday's word: \n\n" + word );
});
mydiv.innerHTML = "Today's word: " + word;