Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: timelapse
Fetching contributors…

Cannot retrieve contributors at this time

file 24 lines (17 sloc) 0.74 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<body onload="document.getElementById('dummy').focus();">
<iframe src="data:text/html,<body onload='document.getElementsByTagName(&quot;input&quot;)[0].focus()'><input></body>" id=victim name=victim>
</iframe>
<script>

var cur_pos = 0;

function maybe_redirect(e) {
  var evt = window.event ? event : e;
  var cc = evt.charCode ? evt.charCode : evt.keyCode;

  document.getElementById('victim').focus();
  frames['victim'].focus();

  document.getElementById('dummy').value += String.fromCharCode(cc).toLowerCase();

  setTimeout('focus();document.getElementById("dummy").focus()',1);
}


</script>
<p>Type some text. It should only appear in the below input field.</p>
<input type=text onkeydown="maybe_redirect(event)" id=dummy>
</body>
Something went wrong with that request. Please try again.