Created
November 28, 2022 05:14
-
-
Save rainrisa/e0aa4c1f384880674409a86d6b503877 to your computer and use it in GitHub Desktop.
Get list of all global variables on a website
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
Object.keys(window).filter( | |
(x) => | |
typeof window[x] !== "function" && | |
Object.entries(Object.getOwnPropertyDescriptor(window, x)).filter( | |
(entry) => | |
["value", "writable", "enumerable", "configurable"].includes(entry[0]) && | |
entry[1] | |
).length === 4 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source: https://stackoverflow.com/a/52693392