en.javascript.info/4-frames-and-windows/06-clickjacking/protector.view/iframe.html
Ilya Kantor 455d300d8d renames
2017-05-25 11:56:32 +03:00

41 lines
638 B
HTML

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<style>
#protector {
height: 100%;
width: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 99999999;
}
</style>
</head>
<body>
<div id="protector">
<a href="/" target="_blank">Go to the site</a>
</div>
<script>
if (top.document.domain == document.domain) {
protector.remove();
}
</script>
This text is always visible.
But if the page is shown inside a document from another domain, the div over it prevents any actions.
<button onclick="alert(1)">Click doesn't work in that case</button>
</body>
</html>