JSFiddle - React, Tailwind, and code Playground

JavaScript

var iframeDataURISupport = { checked: false, supported: false, scriptingSupported: false };

function iframesSupportDataURIs(callback) {
    if (!iframeDataURISupport.checked) {
        var iframe = document.createElement('iframe'), alreadyCalled = false, done = function () {
            if (!alreadyCalled) {
                alreadyCalled = true;
                
                document.body.removeChild(iframe);
                
                console.log(iframeDataURISupport);
                
                callback && callback(iframeDataURISupport);
            }
        }, previousMessageHandler = window.onmessage, dataURI = 'data:text/html,<' + 'script>window.parent.postMessage("data: URIs supported", "*");<' + '/script>';
        
        window.onmessage = function (e) {
            if (e.data === 'data: URIs supported') {
                window.onmessage = previousMessageHandler;
                
                iframeDataURISupport.supported = true;
                iframeDataURISupport.scriptingSupported = true;
                
                done();
            } else {
                window.onmessage.apply(this, arguments);
            }
        };
        
        iframe.src = dataURI;
        iframe.setAttribute('style', 'display: inline-block; width: 0; height: 0; overflow: hidden; border: 0 none; padding: 0; margin: 0;'.replace(/;/g, ' !important;'));
        
        iframe.onload = function (e) {
            if (iframe.src === dataURI) {
                iframeDataURISupport.supported = true;
                
                setTimeout(done, 100);
            } else done();
        };
        
        document.body.appendChild(iframe);
        
        setTimeout(done, 500);
    } else {
        setTimeout(function () {
            callback && callback(iframeDataURISupport);
        }, 5);
    }
};

// Usage of this script
iframesSupportDataURIs(function(details) {
    alert('This browser ' + (details.supported ? 'supports' : 'does not...