008-manual.html (1637B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>Data URI does match *</title> 5 </head> 6 <body> 7 <!-- 8 * allows any URL at all, so it should work 9 --> 10 <p>Load the following URL in a new tab (copy & paste it into the address bar):</p> 11 <noscript><p>Enable JavaScript and reload</p></noscript> 12 13 <script type="text/javascript"> 14 document.write('data:text/html,'+escape( 15 '<!doctype html>\ 16 <html>\ 17 <head>\ 18 <title>Data URI does match *<\/title>\ 19 <style type="text/css">\ 20 html, body { margin: 0; padding: 0; }\ 21 div { height: 100px; width: 100px; background: orange; }\ 22 iframe { border: none; height: 150px; width: 150px; }\ 23 <\/style>\ 24 <\/head>\ 25 <body>\ 26 <script type="text/javascript">\ 27 var seentypes = {};\ 28 if( self == top ) {\ 29 document.body.ondragenter = document.body.ondragover = document.body.ondrop = function (e) {\ 30 e.preventDefault();\ 31 if( e.type == "drop" ) {\ 32 document.body.innerHTML = ( seentypes.dragenter && seentypes.dragover ) ? "PASS" : "FAIL";\ 33 } else {\ 34 seentypes[e.type] = true;\ 35 }\ 36 };\ 37 document.write("<p>Drag the orange square below over this text, and release it. Fail if this text does not change.<\\\/p>");\ 38 document.write("<p><iframe src=\\""+location.href+"\\"><\\\/iframe><\\\/p>");\ 39 } else {\ 40 document.write("<div draggable=\\"true\\"><\\\/div>");\ 41 document.getElementsByTagName("div")[0].ondragstart = function (e) {\ 42 e.dataTransfer.effectAllowed = "copy";\ 43 e.dataTransfer.setData("text","dummy text");\ 44 e.dataTransfer.allowTargetOrigin("*");\ 45 };\ 46 }\ 47 <\/script>\ 48 <\/body>\ 49 <\/html>')); 50 51 </script> 52 </body> 53 </html>