Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (17 sloc) 0.74 kb
f44057d Reviewed by Adele Peterson.
ap@apple.com authored
1 <body onload="document.getElementById('dummy').focus();">
2 <iframe src="data:text/html,<body onload='document.getElementsByTagName(&quot;input&quot;)[0].focus()'><input></body>" id=victim name=victim>
3 </iframe>
4 <script>
5
6 var cur_pos = 0;
7
8 function maybe_redirect(e) {
9 var evt = window.event ? event : e;
10 var cc = evt.charCode ? evt.charCode : evt.keyCode;
11
12 document.getElementById('victim').focus();
13 frames['victim'].focus();
14
15 document.getElementById('dummy').value += String.fromCharCode(cc).toLowerCase();
16
17 setTimeout('focus();document.getElementById("dummy").focus()',1);
18 }
19
20
21 </script>
22 <p>Type some text. It should only appear in the below input field.</p>
23 <input type=text onkeydown="maybe_redirect(event)" id=dummy>
24 </body>
Something went wrong with that request. Please try again.