text-to-os.html (936B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>drag and drop - dragging plain text onto the OS</title> 5 </head> 6 <body> 7 8 <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p> 9 <p>This testcase requires an external application that accepts dropping of text from other applications - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p> 10 <p draggable="true">Drag this paragraph to the other application and release it. Pass if "PASS" appears in the other application, and the drag placeholder disappears when the drag is released.</p> 11 <script type="text/javascript"> 12 document.getElementsByTagName('p')[2].ondragstart = function (e) { 13 e.dataTransfer.effectAllowed = 'copy'; 14 e.dataTransfer.setData('Text', 'PASS'); 15 }; 16 </script> 17 18 </body> 19 </html>