GreaseMokey 里面搞笑的JavaScript代码

在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()行了

你可能感兴趣的:(JavaScript,firefox)