Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/loader/resources/iframe-with-beforeunload.html

Issue 2801813005: Only show a beforeunload dialog if a frame has had a user gesture since its load. (Closed)
Patch Set: one last bit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698