Skip to content

Instantly share code, notes, and snippets.

@jwhamilton99
Last active Feb 4, 2022
Embed
What would you like to do?
Wordle Solver Bookmarklet Code
// Define an anonymous function
javascript:(function() {
// Check if you're actually on the Wordle page
if(window.location.host == "www.powerlanguage.co.uk" && window.location.pathname == "/wordle/") {
// Get the page's game object (#1)
let game = document.body.getElementsByTagName("game-app")[0];
// Check if the game is finished
if(game.gameStatus != "IN_PROGRESS") {
window.alert("Game is already finished.");
return;
}
// Input the game's solution into the board (#2 and #3)
game.addLetter(game.solution);
// Tell the game you actually inputted 5 letters (#4)
game.tileIndex = 5;
// Submit the inputted guess (#5)
game.submitGuess();
} else {
window.alert("You are currently not on the Wordle website.");
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment