tags:

views:

78

answers:

2

I'm running with the src version of Dojo 1.4.2, in Firefox/Firebug.

Everytime I load my app I get a "Break On Error" because the Components.classes reference below hits a permission error.

There are three sub-questions here:

1). Can I stop this error happening? (Yes I could hack dojo to stop the call, but I see that as annoying hackery.) So far as I can tell the authors do expect this error in some/many environments.

2). Can I supress Break On Error in firebug to not break on this particualr condition/line of code. Generally Break on Error is really useful, don't want it disabled globally.

3). Why are we even hitting the lines in question. Why am seen as being in a "ChromeWindow", when running in Firefox?

Code in question, from dojo.js:

 if("ChromeWindow" in this &&
    window instanceof ChromeWindow ){
    try{
        Components.classes["@mozilla.org/moz/jssubscript-loader;1"];
            isFFExt = true;
            hostEnv = "ff_ext";
 }catch(e){ /* squelch Permission Denied error, which just means this is not an extension */ }
 }
+1  A: 

This bootstrapping code is to support the use of Dojo in Firefox extensions, which can also be written with Javascript. Yes, the exception is intentional (it's squelched for the common case of running within the FF browser window) and yes, it's extremely annoying. I don't know of any way to run with Firebug exceptions turned on and not hit this exception.

peller
Thanks. Hacking dojo obviously works, I feel unclean, but not as annoyed ;-)
djna
You're the second person to bring this up today. A conditional was proposed to get around this mess. Stay tuned.
peller
+1  A: 

This issue is tracked in this bug report:

http://bugs.dojotoolkit.org/ticket/11090

and it will be fixed in Dojo 1.5.

jrburke