If you can run the script before loading any other scripts, you can save the list of properties of the embedded window:
var builtInProps = [] for(key in window){ builtInProps.push(key); }
Then after all your scripts load
var pollution = []; for(key in window){ // check to make sure this key is in builtInProps, otherwise push it to "pollution" }
source share