<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<script>
function run() {
  let ifr = document.createElement("iframe");
  document.body.appendChild(ifr);

  let doc = ifr.contentWindow.document;
  doc.open();
  doc.write(`<script>document.cookie = "foo=bar"<\/script>`);
  doc.close();
}
</script>
</head>
<body onLoad="run();">
</body>
</html>
