Skip to content

Instantly share code, notes, and snippets.

@jwhamilton99
Last active February 4, 2022 23:07
Show Gist options
  • Save jwhamilton99/b9b50355490e41c147855a254c4442e5 to your computer and use it in GitHub Desktop.
Save jwhamilton99/b9b50355490e41c147855a254c4442e5 to your computer and use it in GitHub Desktop.
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