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

Side by Side Diff: content/test/data/hang_before_unload.html

Issue 1825523002: Do not reset navigation state when BeforeUnload is cancelled by a commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 8 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
(Empty)
1 <html>
2
3 <head><title>Possible BeforeUnload</title>
Charlie Reis 2016/03/29 18:33:21 Why "Possible"?
clamy 2016/03/30 13:31:11 Because the first version did not have the dialog
4 <script>
5 function clickLink() {
6 var evt = document.createEvent("MouseEvents");
7 evt.initMouseEvent("click", true, true, window,
8 0, 0, 0, 0, 0, false, false,
9 false, false, 0, null);
10 var target = document.getElementById("link");
11 target.dispatchEvent(evt);
12 }
13
14 function clickLinkSoon() {
Charlie Reis 2016/03/29 18:33:21 nit: Use consistent indent.
clamy 2016/03/30 13:31:11 Done.
15 window.setTimeout(clickLink, 100);
16 return true;
17 }
18
19 window.addEventListener("beforeunload", function(e){
Charlie Reis 2016/03/29 18:33:21 nit: Space before {
clamy 2016/03/30 13:31:11 Done.
20 var confirmationMessage = "foo";
21 e.returnValue = confirmationMessage;
22 return confirmationMessage;
23 });
Charlie Reis 2016/03/29 18:33:21 nit: 2 fewer spaces.
clamy 2016/03/30 13:31:11 Done.
24
25 </script>
26 </head>
27
28 <a href="title2.html" id="link">link</a><br>
29
30 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698