Skip to content

Instantly share code, notes, and snippets.

@hypevhs
Created November 6, 2019 22:34
Show Gist options
  • Save hypevhs/159763730a431ab6ff7edf10f539f993 to your computer and use it in GitHub Desktop.
Save hypevhs/159763730a431ab6ff7edf10f539f993 to your computer and use it in GitHub Desktop.
Open in firefox with cache enabled. Every time you refresh the page another layer of iframe nesting is added.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<script>
function getContent() {
console.log('getcontent called');
setTimeout(function() {
var iframe = document.getElementById('wst-iframe');
console.log(iframe.contentWindow.document.readyState);
iframe.contentWindow.document.write('hey!');
iframe.contentWindow.document.close();
}, 200);
}
window.addEventListener('load', getContent);
</script>
</head>
<body>
<h1>WST Iframe Prototype</h1>
<iframe id="wst-iframe" width="1000" height="1000">
</iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment