Skip to content

Instantly share code, notes, and snippets.

@dev-zzo
Created December 20, 2017 15:18
Show Gist options
  • Select an option

  • Save dev-zzo/97c416b17b5305af1e4bea86b3da9ffe to your computer and use it in GitHub Desktop.

Select an option

Save dev-zzo/97c416b17b5305af1e4bea86b3da9ffe to your computer and use it in GitHub Desktop.
<html>
<body>
<script>
document.cookie = "FANCYPANTS";
console.log("parent origin: " + self.location.origin);
console.log("cookie: " + document.cookie);
var html = '<bo'+'dy><scr'+'ipt>console.log("iframe origin: " + self.location.origin);console.log("cookie: " + document.cookie);</scr'+'ipt></bo'+'dy>';
var iframe = document.createElement('iframe');
iframe.src = 'data:text/html;charset=utf-8,' + encodeURI(html);
document.body.appendChild(iframe);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment