Before i explain the problem please understand that i am not trying to access a DOM element but rather some js code from inside the iframe.
Consider my structure
<body>
<script>
class PlayerClient{
constructor(){
alert('Successfuly called')
}
}
</script>
<section id="The-Big-Picture">
<iframe src="/app/explore/sp/home" frameborder="0" width="100%" height="91%">
Sorry your browser does not support inline frames.
</iframe>
</section>
</body>
This iframe is SAMEORIGIN and all i'm trying todo is to instantiate the class PlayerClient from inside the iframe like so new window.parent.PlayerClient(). Why would i want to do this? Because i found it to be DRYer declaring the class in one location only.
Here is an image of the HTML structure
The blue highlight returns undefined