Last active
April 30, 2016 16:38
-
-
Save AlbertoMonteiro/b525001263efcceb7f6cd9bb86a15b9d to your computer and use it in GitHub Desktop.
Blocked a frame with origin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Index</title> | |
</head> | |
<body> | |
<div> | |
<h1>This is a IFrame</h1> | |
</div> | |
</body> | |
<script src="file.js"></script> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.domain = "s3-website-sa-east-1.amazonaws.com"; | |
window.alberto = { | |
nome: "Alberto", | |
idade: 26, | |
seApresentar: function() { | |
alert("Ola eu sou " + this.nome + " e tenho " + this.idade + " anos.") | |
} | |
}; | |
setTimeout(function () { | |
var parent = window.parent; | |
parent.doAlert(window.alberto); | |
var h1Title = document.querySelectorAll("h1")[0]; | |
h1Title.style = "color: red"; | |
h1Title.textContent = "A mensagem foi enviada para a window.parent"; | |
}, 2000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Index</title> | |
<script src="file.js"></script> | |
</head> | |
<body> | |
<div> | |
<h1>This page hosts a IFrame</h1> | |
<hr /> | |
<iframe src="http://crossiframesample2.s3-website-sa-east-1.amazonaws.com/" frameborder="1"></iframe> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.domain = "s3-website-sa-east-1.amazonaws.com"; | |
window.doAlert = function (pessoa) { | |
pessoa.seApresentar(); | |
var h1Title = document.querySelectorAll("h1")[0]; | |
h1Title.style = "color: red"; | |
h1Title.textContent = "Pessoa recebida: " + pessoa.nome; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment