From 3805bb48a266e64b631db8c4f43c9d85c2775661 Mon Sep 17 00:00:00 2001 From: "morse%netscape.com" Date: Thu, 27 Jul 2006 14:56:39 +0000 Subject: [PATCH] bug 154485, p3p icon only takes effect on new windows, r=sgehani, sr=jag --- .../common/permissions/cookieTasksOverlay.xul | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/suite/common/permissions/cookieTasksOverlay.xul b/suite/common/permissions/cookieTasksOverlay.xul index f7650661740..cf932eb804e 100644 --- a/suite/common/permissions/cookieTasksOverlay.xul +++ b/suite/common/permissions/cookieTasksOverlay.xul @@ -91,17 +91,20 @@ // make sure p3p dll exists, else we can't keep pref set if (!("@mozilla.org/cookie-consent;1" in Components.classes)) { gPref.setIntPref("network.cookie.cookieBehavior", 0); - } else { - - // p3p pref is set so create an observer for changes in visibility of cookie icon - var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); - observerService.addObserver(cookieIconObserver, "cookieIcon", false); - - // determine whether or not cookie icon in this new window should be displayed - // we need to wait until window is created before displaying icon - addEventListener("load", listener, false); } } + + if ("@mozilla.org/cookie-consent;1" in Components.classes) { + + // p3p dll exists so create an observer for changes in visibility of cookie icon + var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); + observerService.addObserver(cookieIconObserver, "cookieIcon", false); + + // determine whether or not cookie icon in this new window should be displayed + // we need to wait until window is created before displaying icon + addEventListener("load", listener, false); + } + ]]>