开发者

Permissions error when debugging with dojo src

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 */ }
 开发者_JAVA技巧}


This issue is tracked in this bug report:

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

and it will be fixed in Dojo 1.5.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜