Index: chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc |
diff --git a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc |
index dd52e788c6c634380fed2c5ca9a9966a4076e6e1..1dfd9f48b1d8be5708f131de3ce0e0f8f5b145d4 100644 |
--- a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc |
+++ b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc |
@@ -16,6 +16,7 @@ |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
#include "chrome/common/chrome_features.h" |
#include "components/app_modal/javascript_dialog_manager.h" |
+#include "content/public/browser/render_frame_host.h" |
DEFINE_WEB_CONTENTS_USER_DATA_KEY(JavaScriptDialogTabHelper); |
@@ -86,6 +87,13 @@ void JavaScriptDialogTabHelper::RunJavaScriptDialog( |
// Eventually, for subsequent phases of http://bit.ly/project-oldspice, |
// turn off focus stealing for other dialog types. |
*did_suppress_message = true; |
+ alerting_web_contents->GetMainFrame()->AddMessageToConsole( |
+ content::CONSOLE_MESSAGE_LEVEL_WARNING, |
+ "A window.prompt() dialog generated by this page was suppressed " |
+ "because this page is not the active tab of the front window. " |
+ "Please make sure your dialogs are triggered by user interactions " |
+ "to avoid this situation. " |
+ "https://www.chromestatus.com/feature/5637107137642496"); |
return; |
} |