您的位置:首页 > Web前端 > JavaScript

GreaseMokey 里面搞笑的JavaScript代码

2008-04-04 17:09 441 查看
在GreaseMokey里又一段代码,是GreaseMokey的开发者发现了一个firefox的bug,然后写在注释里,firefox的开发者看到了这段话,于是在下面给出了解决方案,并且回复了。

  // This is the most amazing thing I have ever seen.
  // Multiple statements in the JavaScript interpreter were causing a crash
  // in FF 1.0.x.
  // I described it to Brendan, and, after a bit of thought, he knew right off
  // the top of his head that adding a pointless eval() would fix it. Magic.
  eval("42");
  var sandbox = new this.sandboxCtor();
  var storage = new GM_ScriptStorage(script);
  var logger = new GM_ScriptLogger(script);
  var xmlhttpRequester = new GM_xmlhttpRequester(this.unsafeContentWin,
                                                 this.chromeWindow);
//在firefox1.0.X中,当又多个表达式的时候会导致firefox崩溃
//你只要在里面添加以个eval()行了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: