简体   繁体   English

在萤火虫中,如何忽略新的ActiveXObject()中断

[英]in firebug, how to ignore new ActiveXObject() break

for reason I don't know, firebug constantly stop every time a line contains new ActiveXObject('ShockwaveFlash.ShockwaveFlash') , even when surrounded by try...catch (but no error are displayed in the console) 由于我不知道的原因,即使每行包含try...catch ,firebug也会在每次包含new ActiveXObject('ShockwaveFlash.ShockwaveFlash')的行中不断停止(但控制台中未显示任何错误)

I cannot "disable" it because everytime I change something, the offset created make it useless. 我不能“禁用”它,因为每次更改某些内容时,创建的偏移量都会使其无效。

See that code if you want to reproduce. 如果要复制,请参见该代码。

function getFlashVersion(){
 // ie
 try {
  try {
   // avoid fp6 minor version lookup issues
   // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
   var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
   try { axo.AllowScriptAccess = 'always'; }
   catch(e) { return '6,0,0'; }
  } catch(e) {}
  return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
  // other browsers
 } catch(e) {
  try {
   if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
    return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
   }
  } catch(e) {}
 }
 return '0,0,0';
}
var flash_version = getFlashVersion();

I got that error since a couple of firebug version, currently running on 1.12.4 if that matters 由于几个萤火虫版本(目前在1.12.4上运行),我收到了该错误

EDIT: I take a screenshot to make a better explanation of the problem. 编辑:我拍了一张屏幕快照,以更好地解释问题。

ActiveXObject未定义,您可以在面板的选项卡菜单中禁用/启用中断通知。

ActiveXObject is not defined 
You can disable/enable break notifications in panel's tab menu.

The "Copy" button will copy the error message with the line number. “复制”按钮将复制带有行号的错误消息。 The "Disable" button will disable that exact line (regardless of its content). “禁用”按钮将禁用该确切的行(无论其内容如何)。 So if I add or remove a line before that one, the "disable point" will be different. 因此,如果我在该行之前添加或删除一行,则“禁用点”将有所不同。

Also, as mentioned above, no error at are displayed in the console (there is some warning about "assignment to undeclared variable", but they are not related to theses breaks) 另外,如上所述,控制台中不会显示错误消息(存在有关“分配给未声明的变量的警告”,但与这些中断无关)

You need to click the Break On All Errors button ( 您需要单击“ 打破所有错误”按钮( 打破所有错误按钮 ) inside the Console panel to deactivate stopping the execution on JavaScript errors. ,以停用因JavaScript错误而停止执行。

Edit : There is a related problem in Firebug, which is causing this behavior. 编辑 :Firebug中有一个相关的问题,导致此行为。 Currently (in versions up to 1.12.4) the option Track Throw/Catch isn't working , ie Firebug will always break on errors even when they are surrounded by a try/catch block. 当前(在1.12.4以下的版本中),选项Track Throw / Catch不起作用 ,即Firebug总是会因错误而中断,即使它们被try / catch块包围。 This will be fixed as soon as Firebug has switched to a new debugger API . 一旦Firebug 切换到新的调试器API,此问题将得到解决。 This is planned for the next major release . 计划在下一个主要版本中使用

Furthermore there is an enhancement request for enabling correcting the line number of a persistent breakpoint in case the script has changed. 此外,存在一个增强请求,用于在脚本已更改的情况下纠正持久断点的行号。

Until the behavior of the Track Throw/Catch option is fixed you have to either disable Break On All Errors as described above, move the disabled breakpoints manually when the line number of the ActiveXObject() calls has changed or just continue the script execution. 在修复“ 跟踪抛出/捕获”选项的行为之前,您必须如上所述禁用“所有错误中断” ,在ActiveXObject()调用的行号更改后手动移动禁用的断点,或者仅继续执行脚本。

Sebastian 塞巴斯蒂安

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM