Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/423.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
firefox 4.0b1中jssh中的javascript错误_Javascript_Firefox_Javascript Events_Nserror_Jssh - Fatal编程技术网

firefox 4.0b1中jssh中的javascript错误

firefox 4.0b1中jssh中的javascript错误,javascript,firefox,javascript-events,nserror,jssh,Javascript,Firefox,Javascript Events,Nserror,Jssh,通过为新的firefox 4.0 beta 1编译和构建的jssh使用此javascript会返回一条奇怪的消息。这是代码(如果有点乱,很抱歉) 总之,代码会检查firefox窗口的所有帧,firefox窗口是我们单元测试的一个测试页面,其中有一个onclick元素,其中包含短语“再见,精彩”,而不是返回失败的响应,我们在最后收到了这个奇怪的N错误,我们无法解释 var firefoxWindow = getWindows()[0]; var browser = firefoxWindow.ge

通过为新的firefox 4.0 beta 1编译和构建的jssh使用此javascript会返回一条奇怪的消息。这是代码(如果有点乱,很抱歉) 总之,代码会检查firefox窗口的所有帧,firefox窗口是我们单元测试的一个测试页面,其中有一个onclick元素,其中包含短语“再见,精彩”,而不是返回失败的响应,我们在最后收到了这个奇怪的N错误,我们无法解释

var firefoxWindow = getWindows()[0];
var browser = firefoxWindow.getBrowser();
var doc = browser.contentDocument;


var elem = null;
var elems = doc.getElementsByTagName('td');

for(a=0;a < elems.length;a++){ if( ((elems[a] !== null && elems[a].hasAttributes() === true && elems[a].getAttribute('onclick') !== null && elems[a].getAttribute('onclick').toString().match(/doNothing/gim) !== null && elems[a].getAttribute('onclick').toString().match(/Goodbye Wonderful/gim).length >= 0) || (elems[a] !== null && elems[a].onclick !== null && elems[a].onclick.toString().match(/Goodbye Wonderful/gim) !== null && elems[a].onclick.toString().match(/Goodbye Wonderful/gim).length >= 0))) { elem = elems[a]; } }

var found = false;
var window = null; 

for(var i=0; i < firefoxWindow.frames.length; i++){if(firefoxWindow.frames[i].toString().toLowerCase().indexOf('object window') > -1){window = firefoxWindow.frames[i]; break;}}


function recursiveSearch(frames){ for(var i=0; i<frames.length; i++){var elems = frames[i].document.getElementsByTagName('td'); for(a=0;a < elems.length;a++){ if( ((elems[a] !== null && elems[a].hasAttributes() === true && elems[a].getAttribute('onclick') !== null && elems[a].getAttribute('onclick').toString().match(/Goodbye Wonderful/gim) !== null && elems[a].getAttribute('onclick').toString().match(/Goodbye Wonderful/gim).length >= 0) || (elems[a] !== null && elems[a].onclick !== null && elems[a].onclick.toString().match(/Goodbye Wonderful/gim) !== null && elems[a].onclick.toString().match(/Goodbye Wonderful/gim).length >= 0))) { elem = elems[a]; } } if(elem){found = true; return;} else{ if(frames[i].frames.length>0){recursiveSearch(frames[i].frames);}}}}if(!elem && window.frames.length > 0){ recursiveSearch(window.frames); }var origColor = '';if(elem !== null){origColor = elem.style.backgroundColor;if(origColor === null){origColor = '';} elem.style.backgroundColor = 'yellow';}
var firefoxWindow=getWindows()[0];
var browser=firefoxWindow.getBrowser();
var doc=browser.contentDocument;
var-elem=null;
var elems=doc.getElementsByTagName('td');
对于(a=0;a=null&&elems[a].onclick!==null&&elems[a].onclick.toString().match(/bye-would/gim)!==null&&elems[a].onclick.toString().match(/bye-would/gim).length>=0)){elem=elems[a];}
var=false;
var窗口=null;
对于(var i=0;i-1){window=firefoxWindow.frames[i];break;}
函数递归搜索(frames){for(var i=0;i=0)| |(elems[a]!==null&&elems[a]。onclick!==null&&elems[a]。onclick.toString().match(/bye-Wonderful/gim)!==null&&elems[a]。onclick.toString().match(/bye-Wonderful/gim.length>=0)){elem=elems[a]}如果(elem){find=true;如果(frames=true);则返回}{recursiveSearch(frames[i].frames);}}}}如果(!elem&&window.frames.length>0){recursiveSearch(window.frames);}var origColor='';if(elem!==null){origColor=elem.style.backgroundColor;if(origColor==null){origColor='';}elem.style.backgroundColor='yellow';}
以下是jssh的返回消息:


接收到:未捕获异常:[异常…”组件不可用“nsresult:”0x80040111(NS\u错误\u不可用)”位置:“JS frame::interactive:::line 1”数据:否]

JSSh在Firefox 4中不再受支持,处理起来非常混乱,切换到mozrepl,因为它主要是用javascript编写的,将我自己的javascript命令直接添加到扩展中似乎是完成某些事情的更好方法