加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
patchForBug641090.uc.js 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
alice0775 提交于 2011-06-11 03:05 . first commit
// ==UserScript==
// @name patchForBug641090.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description Bug641090 context/right-click menu "Search Google for" broken in popup windows, displays assertion failed dialog, And Firefox should open the new tab in a full browser window
// @include main
// @compatibility Firefox 4.0
// @author Alice0775
// @version 2011/03/12
// @Note
// ==/UserScript==
var bug641090 = {
handleEvent: function(event) {
switch (event.type) {
case "unload":
this.uninit();
break;
}
},
init: function() {
window.addEventListener("unload", this, false);
this.patch();
},
uninit: function() {
window.removeEventListener("unload", this, false);
this.unPatch();
},
patch: function() {
this.BrowserSearch_loadSearch = BrowserSearch.loadSearch;
var func = BrowserSearch.loadSearch.toString();
func = func.replace(
'if (useNewTab) {',
<><![CDATA[
openLinkIn(submission.uri.spec,
useNewTab ? "tab" : "current",
{ postData: submission.postData,
relatedToCurrent: true });
return;
$&
]]></>
);
BrowserSearch.loadSearch = new Function(
func.match(/\((.*)\)\s*\{/)[1],
func.replace(/^function\s*.*\s*\(.*\)\s*\{/, '').replace(/}$/, '')
);
},
unPatch: function() {
BrowserSearch.loadSearch = this.BrowserSearch_loadSearch;
}
}
bug641090.init();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化