I tried to enter a script inside an iframe trying to implement this method, child and parent do not belong to the same domain (I know that XSS is prevented in recent browsers) is there any way to insert a script to the child of the click button on the parent element. (similar startup scripts in the chrome console)
var myIframe = document.getElementById("myIframeId");
var script = myIframe.contentWindow.document.createElement("script");
script.type = "text/javascript";
script.src = "randomshit.js";
myIframe.contentWindow.document.body.appendChild(script);
source
share