From 6aebadf6dae7bd8cdd8d90c0e6285916bdb51e48 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Fri, 12 Apr 2002 02:15:43 +0000 Subject: [PATCH] Fix for 136985, add api for finding out if a global window is running a timeout or still loading, r=jst, sr=blake --- dom/public/base/nsPIDOMWindow.h | 2 ++ dom/src/base/nsGlobalWindow.cpp | 7 +++++++ dom/src/base/nsGlobalWindow.h | 1 + modules/libpref/src/init/all.js | 3 +++ 4 files changed, 13 insertions(+) diff --git a/dom/public/base/nsPIDOMWindow.h b/dom/public/base/nsPIDOMWindow.h index 4818d3d93d9d..a2a11aab22a8 100644 --- a/dom/public/base/nsPIDOMWindow.h +++ b/dom/public/base/nsPIDOMWindow.h @@ -84,6 +84,8 @@ public: NS_IMETHOD GetExtantDocument(nsIDOMDocument** aDocument) = 0; NS_IMETHOD ReallyCloseWindow() = 0; + + NS_IMETHOD IsLoadingOrRunningTimeout(PRBool* aResult) = 0; }; #endif // nsPIDOMWindow_h__ diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index b4cd26942cb4..de7d49b11b19 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -2813,6 +2813,13 @@ GlobalWindowImpl::ReallyCloseWindow() return NS_OK; } +NS_IMETHODIMP +GlobalWindowImpl::IsLoadingOrRunningTimeout(PRBool* aResult) +{ + *aResult = !mIsDocumentLoaded || mRunningTimeout; + return NS_OK; +} + NS_IMETHODIMP GlobalWindowImpl::UpdateCommands(const nsAString& anAction) { diff --git a/dom/src/base/nsGlobalWindow.h b/dom/src/base/nsGlobalWindow.h index 8e071502b015..31ac7fb4c490 100644 --- a/dom/src/base/nsGlobalWindow.h +++ b/dom/src/base/nsGlobalWindow.h @@ -187,6 +187,7 @@ public: NS_IMETHOD GetExtantDocument(nsIDOMDocument** aDocument); NS_IMETHOD ReallyCloseWindow(); + NS_IMETHOD IsLoadingOrRunningTimeout(PRBool* aResult); // nsIDOMViewCSS NS_DECL_NSIDOMVIEWCSS diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index d7a86aa3735a..d46b242aaa68 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -690,3 +690,6 @@ pref("update_notifications.provider.0.datasource", "chrome://communicator-region // if true, allow plug-ins to override internal imglib decoder mime types in full-page mode pref("plugin.override_internal_types", false); +// See bug 136985. Gives embedders a pref to hook into to show +// a popup blocker if they choose. +pref("browser.popups.showPopupBlocker", true);