OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script> | 4 <script> |
5 window.onbeforeunload = function() { | 5 window.onbeforeunload = function() { |
6 return "This is beforeunload from an iframe."; | 6 return "This is beforeunload from an iframe."; |
7 }; | 7 }; |
| 8 |
| 9 // JavaScript onbeforeunload dialogs require a user gesture. |
| 10 if (window.eventSender) { |
| 11 eventSender.mouseMoveTo(window.frameElement.offsetLeft + 5, |
| 12 window.frameElement.offsetTop + 5); |
| 13 eventSender.mouseDown(); |
| 14 eventSender.mouseUp(); |
| 15 } |
8 </script> | 16 </script> |
9 </body> | 17 </body> |
10 <p>This is an iframe with a beforeunload handler.</p> | 18 <p>This is an iframe with a beforeunload handler.</p> |
11 </body> | 19 </body> |
12 </html> | 20 </html> |
OLD | NEW |