Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Document.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
| index 2f2611587cd266c7d2a511d7d9522b7051e41614..3e0b81300fc9e19cc75c3e1f86d26de2afb6c99c 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp |
| @@ -3071,6 +3071,15 @@ bool Document::dispatchBeforeUnloadEvent(ChromeClient& chromeClient, |
| if (!frame() || beforeUnloadEvent->returnValue().isNull()) |
| return true; |
| + if (!frame()->hasReceivedUserGesture()) { |
|
Charlie Reis
2017/04/10 06:20:11
Sanity check: Does this mean the frame has receive
Avi (use Gerrit)
2017/05/05 15:30:04
This is actually about the document, not the frame
|
| + addConsoleMessage(ConsoleMessage::create( |
| + JSMessageSource, ErrorMessageLevel, |
| + "Blocked attempt to show a 'beforeunload' confirmation panel for a " |
| + "frame that never had a user gesture since its load. " |
| + "https://www.chromestatus.com/feature/5082396709879808")); |
| + return true; |
| + } |
| + |
| if (didAllowNavigation) { |
| addConsoleMessage(ConsoleMessage::create( |
| JSMessageSource, ErrorMessageLevel, |