代码拉取完成,页面将自动刷新
// ==UserScript==
// @name patchForBug647813.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description Workaround Bug 647813 - HTML5 Form Validation tooltips are truncated with select elements and Bug 661761 - Validation bubble appears in the corner of the browser window if input field has display: none
// @include main
// @compatibility Firefox 4.0 5.0 6.0 7.0
// @author Alice0775
// @version 2011/08/11 Bug 647813 was fixed
// @version 2011/04/05
// @Note
// ==/UserScript==
var bug647813 = {
handleEvent: function(event) {
switch (event.type) {
case "popupshowing":
this.movePosition(event);
break;
case "unload":
this.uninit();
break;
}
},
init: function() {
window.addEventListener("unload", this, false);
this.patch();
},
uninit: function() {
this.popup.removeEventListener("popupshowing", this, false);
window.removeEventListener("unload", this, false);
},
patch: function() {
let popup = this.popup = document.getElementById("invalid-form-popup");
//popup.removeAttribute("type"); /*Bug 647813 was fixed*/
popup.setAttribute("level", "top");
popup.addEventListener("popupshowing", this, false);
},
movePosition: function(event) {
let popup = this.popup;
let xx = popup.boxObject.screenX;
let yy = popup.boxObject.screenY;
let w = popup.boxObject.width;
let h = popup.boxObject.height;
let wx = content.screenX;
let wy = content.screenY;
let wh = content.outerHeight;
let ww = content.outerWidth;
if (yy + h + 5 >= wy + wh )
popup.moveTo(wx + ww / 2 - w / 2, wy + wh / 2 - h / 2);
if (xx <= wx)
popup.moveTo(wx, yy);
if (xx + w >= wx + ww)
popup.moveTo(wx + ww - w, yy);
}
}
bug647813.init();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。