document.getElementById('iframeContent').addEventListener('load', function() { try { var doc = this.contentDocument || this.contentWindow.document; if (doc.body.innerHTML == "" || !doc.body.childElementCount) { myLog("The iframe might be blocked or is empty"); } else { myLog("The iframe loaded successfully"); } } catch (e) { myLog("Error accessing iframe:", e); } });