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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 6627063: Ignore JavaScript messages (alert/confirm/prompt) during unload handlers. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added a browsertest Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 220e7697c8a77768d31087e574619ef39fbeb6aa..e4fb6180cbbe9ce4a7b4d4b5b58af7c621baed1a 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -2406,6 +2406,7 @@ void TabContents::RunJavaScriptMessage(
const std::wstring& default_prompt,
const GURL& frame_url,
const int flags,
+ const bool unload_handler_being_run,
IPC::Message* reply_msg,
bool* did_suppress_message) {
// Suppress javascript messages when requested and when inside a constrained
@@ -2414,9 +2415,11 @@ void TabContents::RunJavaScriptMessage(
// Also suppress messages when showing an interstitial. The interstitial is
// shown over the previous page, we don't want the hidden page dialogs to
// interfere with the interstitial.
+ // Also suppress messages during beforeunload/unload event handlers.
bool suppress_this_message =
suppress_javascript_messages_ ||
showing_interstitial_page() ||
+ unload_handler_being_run ||
(delegate() && delegate()->ShouldSuppressDialogs());
if (delegate())
suppress_this_message |=
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698