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

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: Created 4 years, 9 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>
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() {
15 window.setTimeout(clickLink, 100);
clamy 2016/03/22 16:33:46 The browser will hang in BeforeUnload, so I can't
16 return true;
17 }
18
19 window.addEventListener("beforeunload", function(e){
20 var confirmationMessage = "foo";
21 e.returnValue = confirmationMessage;
22 return confirmationMessage;
23 });
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