From 6605e55ca39af2b2ed34ac9c62943b56c003e866 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Wed, 16 Jun 1999 23:40:41 +0000 Subject: [PATCH] bug #5352: navigator.javaEnabled() now returns false if the "security.enable_java" preference is undefined, which it is if the "Advanced" preferences dialog has never been run, or you're running under viewer. a=chofmann, r=vidur --- dom/src/base/nsGlobalWindow.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index ab45cd2eeedc..46132a3f1b24 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -2710,19 +2710,9 @@ NavigatorImpl::JavaEnabled(PRBool* aReturn) return rv; } - rv = prefs->GetBoolPref("security.enable_java", aReturn); - -#if 0 - nsIJVMManager* manager = NULL; - rv = nsServiceManager::GetService(nsIJVMManager::GetCID(), - nsIJVMManager::GetIID(), - (nsISupports **)&manager); - - if (rv == NS_OK && manager != NULL) { - rv = manager->IsJavaEnabled(aReturn); - nsServiceManager::ReleaseService(nsIJVMManager::GetCID(), manager); - } -#endif + // if pref doesn't exist, map result to false. + if (prefs->GetBoolPref("security.enable_java", aReturn) != NS_OK) + *aReturn = PR_FALSE; return rv; }