代码拉取完成,页面将自动刷新
// ==UserScript==
// @name patchForBug715838.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description Workaround Bug 715838 - Double-clicking title bar in small window sends click event to the maximized window on mouse position
// @include main
// @compatibility Firefox 4.0 5.0 6.0 7.0
// @author Alice0775
// @version 2012/01/07
// @Note
// ==/UserScript==
var bug715838 = {
timer: null,
duration: 500,
handleEvent: function(event) {
switch (event.type) {
case "mousemove":
this.onmousemove(event);
break;
case "resize":
this.onresize(event);
break;
case "mouseup":
this.onmouseup(event);
break;
case "unload":
this.uninit();
break;
}
},
init: function() {
window.addEventListener("unload", this, false);
window.addEventListener("resize", this, true);
},
uninit: function() {
window.removeEventListener("resize", this, true);
window.removeEventListener("unload", this, false);
},
onresize: function(event) {
if (event.originalTarget != window)
return;
if (window.windowState == window.STATE_MAXIMIZED) {
window.addEventListener("mouseup", this, true);
window.addEventListener("mousemove", this, true);
if (this.timer)
clearTimeout(this.timer);
this.timer = setTimeout(function(self) {
window.removeEventListener("mouseup", self, true);
window.removeEventListener("mousemove", self, true);
}, this.duration, this);
}
},
onmouseup: function(event) {
event.stopPropagation();
window.removeEventListener("mouseup", this, true);
window.removeEventListener("mousemove", this, true);
if (this.timer)
clearTimeout(this.timer);
},
onmousemove: function(event) {
window.removeEventListener("mousemove", this, true);
if (this.timer)
clearTimeout(this.timer);
setTimeout(function(self) {
window.removeEventListener("mouseup", self, true);
}, 0, this);
}
}
bug715838.init();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。