Skip to content

Instantly share code, notes, and snippets.

@wanderer06
Last active August 28, 2018 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wanderer06/b01772fa0a1deed83eb7750901207474 to your computer and use it in GitHub Desktop.
Save wanderer06/b01772fa0a1deed83eb7750901207474 to your computer and use it in GitHub Desktop.
List all non-standard properties on the window.
(function () {
var results, currentWindow, typedResult
iframe = document.createElement('iframe');
iframe.style.display = 'none';
document.body.appendChild(iframe);
currentWindow = Object.keys(window);
results = currentWindow.filter(function(prop) {
return !iframe.contentWindow.hasOwnProperty(prop);
});
typedResult = {};
results.forEach(key => {
const keyType = typeof window[key];
(typedResult[keyType] || (typedResult[keyType] = {}, typedResult[keyType]))[key] = window[key];
});
console.log(typedResult);
document.body.removeChild(iframe);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment