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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/loader/resources/iframe-with-beforeunload.html
diff --git a/third_party/WebKit/LayoutTests/fast/loader/resources/iframe-with-beforeunload.html b/third_party/WebKit/LayoutTests/fast/loader/resources/iframe-with-beforeunload.html
index 0197c2b41cd4367f53e14e0472b668807fbcce1e..cd2bbb977eb563c717812864ba0ea176a679c7ab 100644
--- a/third_party/WebKit/LayoutTests/fast/loader/resources/iframe-with-beforeunload.html
+++ b/third_party/WebKit/LayoutTests/fast/loader/resources/iframe-with-beforeunload.html
@@ -5,6 +5,14 @@
window.onbeforeunload = function() {
return "This is beforeunload from an iframe.";
};
+
+ // JavaScript onbeforeunload dialogs require a user gesture.
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(window.frameElement.offsetLeft + 5,
+ window.frameElement.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
</script>
</body>
<p>This is an iframe with a beforeunload handler.</p>

Powered by Google App Engine
This is Rietveld 408576698