Let's say you're adding this script directly to the html file that contains the "parent" window code (ie, it has the iframe). Make sure the iframe is defined when this code executes (so, put the script block after the iframe element, or use a window.onload or document.ready handler)
<iframe class='content-frame'></iframe>
...
<script>
document.getElementsByClassName("content-frame")[0].addEventListener("load", function () {
// the document in the iframe has loaded. let's hide that ribbon bar
var ribbonBar = this.contentDocument.getElementById("suiteBarDelta");
if (ribbonBar) {
ribbonBar.style.visibility = 'hidden';
} else {
console.log("uh oh, ribbonBar still does not exist");
}
});
</script>
I really don't know if Sharepoint does a lot of shenanigans to build the content in the iframe (like, calling async requests to get the ribbon bar) - but that would certainly break this code (and you would get the uh oh message in the console).