【发布时间】:2010-05-11 06:54:14
【问题描述】:
我在 Firefox/Firebug 中使用 src 版本的 Dojo 1.4.2 运行。
每次我加载我的应用时,我都会收到“Break On Error”,因为下面的 Components.classes 引用遇到了权限错误。
这里有三个子问题:
1)。我可以阻止这个错误的发生吗? (是的,我可以破解 dojo 来停止通话,但我认为这很烦人。)据我所知,作者确实预计在某些/许多环境中会出现此错误。
2)。我可以在 firebug 中抑制 Break On Error 以 不 在此特定条件/代码行上中断。通常 Break on Error 真的很有用,不希望全局禁用它。
3)。为什么我们甚至会触及有问题的界限。为什么在 Firefox 中运行时被视为处于“ChromeWindow”中?
有问题的代码,来自 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 */ }
}
【问题讨论】:
标签: dojo