www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit af080fe3847e92ff67e412032b9fbaa848dc538b
parent 3edb6e0286495cc8a759e28af49943504ad557a2
Author: Simon Kornblith <simon@simonster.com>
Date:   Tue,  8 Aug 2006 21:40:33 +0000

allow EndNote MIME handler to be unregistered without restarting Firefox


Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/ingester.js | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/ingester.js b/chrome/chromeFiles/content/scholar/xpcom/ingester.js @@ -468,11 +468,17 @@ Scholar.Ingester.MIMEHandler = new function() { * registers URIContentListener to handle MIME types */ function init() { - if(!on && Scholar.Prefs.get("parseEndNoteMIMETypes")) { + var prefStatus = Scholar.Prefs.get("parseEndNoteMIMETypes"); + if(!on && prefStatus) { var uriLoader = Components.classes["@mozilla.org/uriloader;1"]. getService(Components.interfaces.nsIURILoader); uriLoader.registerContentListener(Scholar.Ingester.MIMEHandler.URIContentListener); on = true; + } else if(on && !prefStatus) { + var uriLoader = Components.classes["@mozilla.org/uriloader;1"]. + getService(Components.interfaces.nsIURILoader); + uriLoader.unRegisterContentListener(Scholar.Ingester.MIMEHandler.URIContentListener); + on = false; } } }