JSFiddle - React, Tailwind, and code Playground

by Glutamat

JavaScript

var modified = (function getNonDefaultGlobals(window) {
        var iframe          = document.createElement("iframe"),
            modifiedGlobals = {},
            defaultGlobals;
    
        iframe.src = "about:blank";
    
        try {
            document.body.appendChild(iframe);
            defaultGlobals = iframe.contentWindow || {};
        } catch (e) {
            return window;
        }
    
        for (var global in window) {
            if (typeof defaultGlobals[global] === 'undefined') {
                modifiedGlobals[global] = window[global];
            } else if (typeof window[global]  === 'function' && window[global].name !== (defaultGlobals[global] || {}).name) {
                if ((window[global] || "").toString() !== (defaultGlobals[global] || "").toString()) {  
                    modifiedGlobals[global] = window[global];
                }
            } else if (typeof window[global]  !== 'function' && window[global] !== defaultGlobals[global] ) {
                modifiedGlobals[global] = window[global];
            }
        }
    
        document.body.removeChild(iframe);
    
        return modifiedGlobals;
    })(window);