I've got a main html file which loads another html file in the same directory through an iframe. There is a button on the main page which targets the html file from the iframe. It's using this function:
<script>
function myFunction() {
var x = document.getElementsByTagName("iframe")[0].contentWindow;
x.exportRoot.gotoAndPlay(2);
}
</script>
Live it works like intended: when I click the button it starts the Animate CC animation from within the iframe. When I view the file locally however I get this error message in the console window:
SecurityError (DOM Exception 18): Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match.
I've read this has to do with same-origin policy. Which would make sense if the main page was at another domain as the iframe page. But both html file are locally in the same directory.
My browsers (tried both Safari and Chrome) nonetheless see that as two different domains? Is there something I can change to make it work locally too?