The following excerpt is for educational purposes only. Wordle is the creation of Josh Wardle.
To begin with, it's not that hard, it was literally encoded in a plain-text list as a constant which was included when you load the page. All we do here is reformat the list into a readable one.
How I extracted it:
- Copy the array of words from
main.js
. Press F12 to open DevTools on Chrome/Edge and you'll find resources that the page loads under the 'Sources' tab. Here you can find a 'minified' version ofmain.js
, which means it's been simplified to only include the important things that keeps the page functional, which means variables and function names are replaced with arbitrary shorter ones and compacted.
DevTools offers to "prettify" our javascript so it looks more readable. Finding which array is which is easy, just look up a known so