/wordlesolver.js Secret
Last active
February 4, 2022 23:07
Star
You must be signed in to star a gist
Wordle Solver Bookmarklet Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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