Skip to content

Instantly share code, notes, and snippets.

@osxtest
osxtest / getAllGlobals.js
Created April 4, 2024 02:22 — forked from colinrubbert/getAllGlobals.js
Get all runtime global variables set by the app
/**
* RuntimeGlobalsChecker
*
* You can use this utility to quickly check what variables have been added (or
* leaked) to the global window object at runtime (by JavaScript code).
* By running this code, the globals checker itself is attached as a singleton
* to the window object as "__runtimeGlobalsChecker__".
* You can check the runtime globals programmatically at any time by invoking
* "window.__runtimeGlobalsChecker__.getRuntimeGlobals()".
*