[Project_owners] Components not defined ?!

Eric H. Jung eric.jung at yahoo.com
Thu May 25 21:06:13 EDT 2006


Hi,

I have some code which yields a very strange error. The steps to
reproduce are:

In overlay:

var proxyService = 
  Components.classes["@mozilla.org/network/protocol-proxy-service;1"]
  .getService(Components.interfaces.nsIProtocolProxyService);

proxyService.registerFilter(this, 0); // |this| implements
applyFilter()

applyFilter : function(proxyService, uri, proxy) {
  var p = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
    .getService(Components.interfaces.nsIPromptService);
}

After a second FF browser is opened and the initial one is closed, this
always results in the error:

"ReferenceError: Components is not defined" for the Components.classes
line. This happens regardless of which Components.classes object I try
to use. How can this be!? How can I access the Components object in
this context?

Thanks for any ideas,
Eric
Eric




More information about the Project_owners mailing list