I don't know your code, so i can't know, what that security error is...
You can use javascript to remove elements in iframe, and this shouldn't throw any error...
content of html with iframe...
<script>
let newsIframe = document.getElementById("newspage");
let newsHeader = iframe.contentWindow.document.getElementById("header");
newsHeader.style.display = "none";
let newsFooter = iframe.contentWindow.document.getElementById("footer");
newsFooter.style.display = "none";
</script>
more content...
That script tag with code must be after your <iframe>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…