020.html (1418B)
1 <!doctype html> 2 <title>Alert during dragenter for file drag</title> 3 <style> 4 body > div { 5 height: 200px; 6 width: 200px; 7 background-color: orange; 8 display: inline-block; 9 } 10 </style> 11 <script type="text/javascript"> 12 window.onload = function () { 13 var orange = document.getElementsByTagName('div')[0]; 14 orange.ondragenter = function (e) { 15 e.preventDefault(); 16 alert('JS alert'); 17 }; 18 orange.ondragover = orange.ondrop = function (e) { 19 e.preventDefault(); 20 }; 21 }; 22 </script> 23 <div draggable="true"></div> 24 25 <ol> 26 <li>Drag a file (one that your browser cannot open natively, such as an executable file) from your system file manager over the orange square.</li> 27 <li>An alert may appear - release the mouse over a blank part of the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag and accept any prompt to upload the file.</li> 28 <li>If a file download dialog appears, cancel it and return to this page.</li> 29 <li>Fail if the alert reappears.</li> 30 <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li> 31 <li>Fail if the mouse continues to show that a drag is in operation.</li> 32 <li>Try to select some text in this sentence. Fail if it is not possible.</li> 33 </ol>