From 49c6f4f617cde417afab708e5401209f5560fb02 Mon Sep 17 00:00:00 2001 From: "doronr%us.ibm.com" Date: Mon, 22 Aug 2005 14:07:32 +0000 Subject: [PATCH] Bug 298202 - java preference ignored depending on java plugin location when javascript calls into Java directly. r=jst sr=shaver --- modules/oji/src/nsJVMManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/oji/src/nsJVMManager.cpp b/modules/oji/src/nsJVMManager.cpp index bfcbfa00c53..99e680ad97d 100644 --- a/modules/oji/src/nsJVMManager.cpp +++ b/modules/oji/src/nsJVMManager.cpp @@ -374,8 +374,14 @@ nsJVMManager::nsJVMManager(nsISupports* outer) NS_INIT_AGGREGATED(outer); nsCOMPtr branch = do_GetService(NS_PREFSERVICE_CONTRACTID); - if (branch) + if (branch) { branch->AddObserver("security.enable_java", this, PR_FALSE); + PRBool prefBool = PR_TRUE; + nsresult rv = branch->GetBoolPref("security.enable_java", &prefBool); + if (NS_SUCCEEDED(rv)) { + SetJVMEnabled(prefBool); + } + } } nsJVMManager::~nsJVMManager()